diff options
Diffstat (limited to 'contrib/guix/libexec/build.sh')
-rw-r--r-- | contrib/guix/libexec/build.sh | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 550b1b8f40..5be3baeefa 100644 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -3,6 +3,14 @@ export LC_ALL=C set -e -o pipefail export TZ=UTC +if [ -n "$V" ]; then + # Print both unexpanded (-v) and expanded (-x) forms of commands as they are + # read from this file. + set -vx + # Set VERBOSE for CMake-based builds + export VERBOSE="$V" +fi + # Check that environment variables assumed to be set by the environment are set echo "Building for platform triple ${HOST:?not set} with reference timestamp ${SOURCE_DATE_EPOCH:?not set}..." echo "At most ${MAX_JOBS:?not set} jobs will run at once..." @@ -141,19 +149,17 @@ make -C depends --jobs="$MAX_JOBS" HOST="$HOST" \ # Source Tarball Building # ########################### -# Create the source tarball and move it to "${OUTDIR}/src" if not already there -if [ -z "$(find "${OUTDIR}/src" -name 'bitcoin-*.tar.gz')" ]; then - ./autogen.sh - env CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" ./configure --prefix=/ - make dist GZIP_ENV='-9n' ${V:+V=1} - mkdir -p "${OUTDIR}/src" - mv "$(find "${PWD}" -name 'bitcoin-*.tar.gz')" "${OUTDIR}/src/" -fi +# Define DISTNAME variable. +# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME +source contrib/gitian-descriptors/assign_DISTNAME + +GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz" -# Determine the full path to our source tarball -SOURCEDIST="$(find "${OUTDIR}/src" -name 'bitcoin-*.tar.gz')" -# Determine our distribution name (e.g. bitcoin-0.18.0) -DISTNAME="$(basename "$SOURCEDIST" '.tar.gz')" +# Create the source tarball if not already there +if [ ! -e "$GIT_ARCHIVE" ]; then + mkdir -p "$(dirname "$GIT_ARCHIVE")" + git archive --output="$GIT_ARCHIVE" HEAD +fi ########################### # Binary Tarball Building # @@ -187,7 +193,9 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" cd "$DISTSRC" # Extract the source tarball - tar --strip-components=1 -xf "${SOURCEDIST}" + tar -xf "${GIT_ARCHIVE}" + + ./autogen.sh # Configure this DISTSRC for $HOST # shellcheck disable=SC2086 @@ -220,7 +228,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" # Make the os-specific installers case "$HOST" in *mingw*) - make deploy ${V:+V=1} + make deploy ${V:+V=1} BITCOIN_WIN_INSTALLER="${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" ;; esac @@ -232,11 +240,6 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" # Install built Bitcoin Core to $INSTALLPATH make install DESTDIR="${INSTALLPATH}" ${V:+V=1} - case "$HOST" in - *mingw*) - cp -f --target-directory="$OUTDIR" ./*-setup-unsigned.exe - ;; - esac ( cd installed @@ -264,7 +267,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" cp "${DISTSRC}/doc/README_windows.txt" "${DISTNAME}/readme.txt" ;; *linux*) - cp "${DISTSRC}/doc/README.md" "${DISTNAME}/" + cp "${DISTSRC}/README.md" "${DISTNAME}/" ;; esac @@ -307,7 +310,7 @@ case "$HOST" in ( cd ./windeploy mkdir unsigned - cp --target-directory=unsigned/ "$OUTDIR"/bitcoin-*-setup-unsigned.exe + cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" find . -print0 \ | sort --zero-terminated \ | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ |