0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

guix: Make source tarball using git-archive

This commit is contained in:
Carl Dong 2020-04-22 13:05:37 -04:00
parent 395c1137f6
commit f5a6ac4f48
No known key found for this signature in database
GPG key ID: 0CC52153197991A5
2 changed files with 27 additions and 16 deletions

View file

@ -141,19 +141,17 @@ make -C depends --jobs="$MAX_JOBS" HOST="$HOST" \
# Source Tarball Building # # Source Tarball Building #
########################### ###########################
# Create the source tarball and move it to "${OUTDIR}/src" if not already there # Define DISTNAME variable.
if [ -z "$(find "${OUTDIR}/src" -name 'bitcoin-*.tar.gz')" ]; then # shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
./autogen.sh source contrib/gitian-descriptors/assign_DISTNAME
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
# Determine the full path to our source tarball GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
SOURCEDIST="$(find "${OUTDIR}/src" -name 'bitcoin-*.tar.gz')"
# Determine our distribution name (e.g. bitcoin-0.18.0) # Create the source tarball if not already there
DISTNAME="$(basename "$SOURCEDIST" '.tar.gz')" if [ ! -e "$GIT_ARCHIVE" ]; then
mkdir -p "$(dirname "$GIT_ARCHIVE")"
git archive --output="$GIT_ARCHIVE" HEAD
fi
########################### ###########################
# Binary Tarball Building # # Binary Tarball Building #
@ -187,7 +185,9 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
cd "$DISTSRC" cd "$DISTSRC"
# Extract the source tarball # Extract the source tarball
tar --strip-components=1 -xf "${SOURCEDIST}" tar -xf "${GIT_ARCHIVE}"
./autogen.sh
# Configure this DISTSRC for $HOST # Configure this DISTSRC for $HOST
# shellcheck disable=SC2086 # shellcheck disable=SC2086
@ -234,7 +234,15 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
case "$HOST" in case "$HOST" in
*mingw*) *mingw*)
cp -f --target-directory="$OUTDIR" ./*-setup-unsigned.exe # This step not only moves the unsigned NSIS executable to
# "${OUTDIR}", but also renames it
#
# from:
# bitcoin-@PACKAGE_VERSION@-win64-setup-unsigned.exe
# to:
# ${DISTNAME}-win64-setup-unsigned.exe
#
cp -f ./bitcoin-*-win64-setup-unsigned.exe "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
;; ;;
esac esac
( (
@ -264,7 +272,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
cp "${DISTSRC}/doc/README_windows.txt" "${DISTNAME}/readme.txt" cp "${DISTSRC}/doc/README_windows.txt" "${DISTNAME}/readme.txt"
;; ;;
*linux*) *linux*)
cp "${DISTSRC}/doc/README.md" "${DISTNAME}/" cp "${DISTSRC}/README.md" "${DISTNAME}/"
;; ;;
esac esac
@ -307,7 +315,7 @@ case "$HOST" in
( (
cd ./windeploy cd ./windeploy
mkdir unsigned mkdir unsigned
cp --target-directory=unsigned/ "$OUTDIR"/bitcoin-*-setup-unsigned.exe cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
find . -print0 \ find . -print0 \
| sort --zero-terminated \ | sort --zero-terminated \
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \

View file

@ -17,6 +17,7 @@
(gnu packages pkg-config) (gnu packages pkg-config)
(gnu packages python) (gnu packages python)
(gnu packages shells) (gnu packages shells)
(gnu packages version-control)
(guix build-system gnu) (guix build-system gnu)
(guix build-system trivial) (guix build-system trivial)
(guix gexp) (guix gexp)
@ -181,6 +182,8 @@ chain for " target " development."))
;; Scripting ;; Scripting
perl perl
python-3.7 python-3.7
;; Git
git
;; Native gcc 9 toolchain targeting glibc 2.27 ;; Native gcc 9 toolchain targeting glibc 2.27
(make-gcc-toolchain gcc-9 glibc-2.27)) (make-gcc-toolchain gcc-9 glibc-2.27))
(let ((target (getenv "HOST"))) (let ((target (getenv "HOST")))