Files
bitcoin/contrib/guix/libexec/build_win.sh
will 1fe87c2505 guix: cache GUI depends separately
The GUI manifest has a distinct Guix profile and consequently produces
different depends build IDs. Previously this mean that the gui build
would invalidate the build cache for the non-guix build.

Move guix builds under a GUIX/ root, and further BUILD/ and GUI/ trees,
so that local developer builds, GUI and non GUI guix builds can all
co-exist together.

There will end up being more copies of build depends packages, (local
builds, and two guix variants), but these all use different toolchains
and toolsets so this is desirable.
2026-09-10 11:44:54 +01:00

66 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit.
export LC_ALL=C.UTF-8
set -o errexit -o pipefail
# shellcheck source=setup.sh
source "$(dirname "${BASH_SOURCE[0]}")/setup.sh"
# setup mingw-w64 toolchain
mingw_w64_toolchain
BASE_CACHE="${BASE_CACHE:-$PWD/depends/built}/GUIX/BUILD"
# Build the depends tree
make -C depends --jobs="$JOBS" HOST="$HOST" \
${V:+V=1} \
${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \
${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \
${build_CC+build_CC="$build_CC"} \
${build_CXX+build_CXX="$build_CXX"} \
NO_QT=1
# CFLAGS
HOST_CFLAGS="-O2 -g"
HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
HOST_CFLAGS+=" -fdebug-prefix-map=${DISTSRC}/src=."
HOST_CFLAGS+=" -fno-ident"
# CXXFLAGS
HOST_CXXFLAGS="$HOST_CFLAGS"
# LDFLAGS
HOST_LDFLAGS="-Wl,--no-insert-timestamp -Wl,--fatal-warnings"
mkdir -p "$DISTSRC"
(
cd "$DISTSRC"
# Extract the source tarball
tar --strip-components=1 -xf "${GIT_ARCHIVE}"
# Configure this DISTSRC for $HOST
env CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \
cmake -S . -B build \
--toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \
-DBUILD_BENCH=OFF \
-DBUILD_FUZZ_BINARY=OFF \
-DBUILD_GUI=OFF \
-DBUILD_GUI_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="${INSTALLPATH}" \
-DREDUCE_EXPORTS=ON \
-DWITH_CCACHE=OFF
# Build Bitcoin Core
cmake --build build -j "$JOBS"
# Install built Bitcoin Core
cmake --install build
)
rm -rf "$DISTSRC"/build
exit 0