From c709665c1a2442a98d4e7ea75166a889a8077802 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 26 May 2020 22:27:18 +0200 Subject: [PATCH] Add a build script for users. FTL can be build by simply running "./build.sh" Signed-off-by: DL6ER --- .circleci/build-CI.sh | 12 +++++++++++- .circleci/config.yml | 1 - build.sh | 17 +++++++++++++++++ src/gen_version.cmake | 4 ++-- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100755 build.sh diff --git a/.circleci/build-CI.sh b/.circleci/build-CI.sh index 2ac1afb9..23728a48 100644 --- a/.circleci/build-CI.sh +++ b/.circleci/build-CI.sh @@ -1,7 +1,17 @@ #!/bin/bash +# Pi-hole: A black hole for Internet advertisements +# (c) 2020 Pi-hole, LLC (https://pi-hole.net) +# Network-wide ad blocking via your own hardware. +# +# FTL Engine +# Build script for Circle CI +# +# This file is copyright under the latest version of the EUPL. +# Please see LICENSE file for your rights under this license. rm -rf cmake/ && \ mkdir cmake && \ cd cmake && \ cmake -DSTATIC="${1}" .. && \ -cmake --build . -- GIT_BRANCH="${2}" GIT_TAG="${3}" CIRCLE_JOB="${4}" -j 4 \ No newline at end of file +cmake --build . -- GIT_BRANCH="${2}" GIT_TAG="${3}" CIRCLE_JOB="${4}" -j 4 && \ +mv pihole-FTL ../ diff --git a/.circleci/config.yml b/.circleci/config.yml index c60c2a9c..d3d18609 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,6 @@ version: 2 BRANCH=$([ -z "$CIRCLE_TAG" ] && echo "$CIRCLE_BRANCH" || echo "master") [[ $CIRCLE_JOB == *"qemu"* ]] && DOCKERIFNEEDED="docker run --rm -v $(pwd):/workspace -w /workspace pihole/ftl-build:arm-qemu " $DOCKERIFNEEDED bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" - cp cmake/pihole-FTL . - run: name: "Binary checks" command: bash test/arch_test.sh diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..43716660 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Pi-hole: A black hole for Internet advertisements +# (c) 2020 Pi-hole, LLC (https://pi-hole.net) +# Network-wide ad blocking via your own hardware. +# +# FTL Engine +# Build script for FTL +# +# This file is copyright under the latest version of the EUPL. +# Please see LICENSE file for your rights under this license. + +rm -rf cmake/ && \ +mkdir cmake && \ +cd cmake && \ +cmake .. && \ +cmake --build . -- -j $(nproc) && \ +cp pihole-FTL ../ diff --git a/src/gen_version.cmake b/src/gen_version.cmake index 7bac0441..5682e0fa 100644 --- a/src/gen_version.cmake +++ b/src/gen_version.cmake @@ -59,8 +59,8 @@ if(NOT DEFINED GIT_TAG) endif() # If CIRCLE_JOB is unset (local compilation), ask uname -m and add locally compiled comment -if(DEFINED ENV{CIRCLE_JOB}) - set(FTL_ARCH "$ENV{CIRCLE_JOB} (compiled on CI)") +if(DEFINED CIRCLE_JOB) + set(FTL_ARCH "${CIRCLE_JOB} (compiled on CI)") else() execute_process( COMMAND uname -m