Skip to content

Commit

Permalink
build: support custom CONFIG_FLAGS for guix-build
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Jan 30, 2025
1 parent 809d7e7 commit 87b3abc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions contrib/guix/guix-build
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ profiledir_for_host() {
echo "${PROFILES_BASE}/${1}${2:+-${2}}"
}

CONFIG_FLAGS="${CONFIG_FLAGS:--DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD_FUZZ_BINARY=OFF}"

#########
# BUILD #
Expand Down Expand Up @@ -361,6 +362,7 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}:
...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")'
...outputting in: '$(outdir_for_host "$HOST")'
...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")'
CONFIG_FLAGS: ${CONFIG_FLAGS}
ADDITIONAL FLAGS (if set)
ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS}
ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS}
Expand Down Expand Up @@ -462,6 +464,7 @@ EOF
DISTSRC="$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")" \
OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")" \
DIST_ARCHIVE_BASE=/outdir-base/dist-archive \
CONFIG_FLAGS="$CONFIG_FLAGS" \
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
)

Expand Down
5 changes: 1 addition & 4 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ mkdir -p "$OUTDIR"
# Binary Tarball Building #
###########################

# CONFIGFLAGS
CONFIGFLAGS="-DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD_FUZZ_BINARY=OFF"

# CFLAGS
HOST_CFLAGS="-O2 -g"
HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
Expand Down Expand Up @@ -242,7 +239,7 @@ mkdir -p "$DISTSRC"
cmake -S . -B build \
--toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \
-DWITH_CCACHE=OFF \
${CONFIGFLAGS}
${CONFIG_FLAGS}

# Build Bitcoin Core
cmake --build build -j "$JOBS" ${V:+--verbose}
Expand Down

0 comments on commit 87b3abc

Please sign in to comment.