Skip to content

Commit

Permalink
Pass custom DEP_OPTS and CONFIG_FLAGS to 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 b0d78c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 6 additions & 1 deletion contrib/guix/guix-build
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ mkdir -p "$OUTDIR_BASE"
# Download the depends sources now as we won't have internet access in the build
# container
for host in $HOSTS; do
make -C "${PWD}/depends" -j"$JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"}
make -C "${PWD}/depends" -j"$JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} "$DEP_OPTS"
done

# Usage: outdir_for_host HOST SUFFIX
Expand All @@ -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,8 @@ 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")'
DEP_OPTS: ${DEP_OPTS}
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 +465,8 @@ 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 \
DEP_OPTS="$DEP_OPTS" \
CONFIG_FLAGS="$CONFIG_FLAGS" \
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
)

Expand Down
8 changes: 3 additions & 5 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \
x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \
x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
x86_64_linux_STRIP=x86_64-linux-gnu-strip
x86_64_linux_STRIP=x86_64-linux-gnu-strip \
"$DEP_OPTS"

case "$HOST" in
*darwin*)
Expand Down Expand Up @@ -205,9 +206,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 +240,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 b0d78c9

Please sign in to comment.