@@ -141,19 +141,17 @@ make -C depends --jobs="$MAX_JOBS" HOST="$HOST" \
141141# Source Tarball Building #
142142# ##########################
143143
144- # Create the source tarball and move it to "${OUTDIR}/src" if not already there
145- if [ -z " $( find " ${OUTDIR} /src" -name ' bitcoin-*.tar.gz' ) " ]; then
146- ./autogen.sh
147- env CONFIG_SITE=" ${BASEPREFIX} /${HOST} /share/config.site" ./configure --prefix=/
148- make dist GZIP_ENV=' -9n' ${V: +V=1}
149- mkdir -p " ${OUTDIR} /src"
150- mv " $( find " ${PWD} " -name ' bitcoin-*.tar.gz' ) " " ${OUTDIR} /src/"
151- fi
144+ # Define DISTNAME variable.
145+ # shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
146+ source contrib/gitian-descriptors/assign_DISTNAME
147+
148+ GIT_ARCHIVE=" ${OUTDIR} /src/${DISTNAME} .tar.gz"
152149
153- # Determine the full path to our source tarball
154- SOURCEDIST=" $( find " ${OUTDIR} /src" -name ' bitcoin-*.tar.gz' ) "
155- # Determine our distribution name (e.g. bitcoin-0.18.0)
156- DISTNAME=" $( basename " $SOURCEDIST " ' .tar.gz' ) "
150+ # Create the source tarball if not already there
151+ if [ ! -e " $GIT_ARCHIVE " ]; then
152+ mkdir -p " $( dirname " $GIT_ARCHIVE " ) "
153+ git archive --output=" $GIT_ARCHIVE " HEAD
154+ fi
157155
158156# ##########################
159157# Binary Tarball Building #
@@ -187,7 +185,9 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
187185 cd " $DISTSRC "
188186
189187 # Extract the source tarball
190- tar --strip-components=1 -xf " ${SOURCEDIST} "
188+ tar -xf " ${GIT_ARCHIVE} "
189+
190+ ./autogen.sh
191191
192192 # Configure this DISTSRC for $HOST
193193 # shellcheck disable=SC2086
@@ -234,7 +234,15 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
234234
235235 case " $HOST " in
236236 * mingw* )
237- cp -f --target-directory=" $OUTDIR " ./* -setup-unsigned.exe
237+ # This step not only moves the unsigned NSIS executable to
238+ # "${OUTDIR}", but also renames it
239+ #
240+ # from:
241+ 242+ # to:
243+ # ${DISTNAME}-win64-setup-unsigned.exe
244+ #
245+ cp -f ./bitcoin-* -win64-setup-unsigned.exe " ${OUTDIR} /${DISTNAME} -win64-setup-unsigned.exe"
238246 ;;
239247 esac
240248 (
@@ -264,7 +272,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
264272 cp " ${DISTSRC} /doc/README_windows.txt" " ${DISTNAME} /readme.txt"
265273 ;;
266274 * linux* )
267- cp " ${DISTSRC} /doc/ README.md" " ${DISTNAME} /"
275+ cp " ${DISTSRC} /README.md" " ${DISTNAME} /"
268276 ;;
269277 esac
270278
@@ -307,7 +315,7 @@ case "$HOST" in
307315 (
308316 cd ./windeploy
309317 mkdir unsigned
310- cp --target-directory=unsigned/ " $OUTDIR " /bitcoin- * -setup-unsigned.exe
318+ cp --target-directory=unsigned/ " ${ OUTDIR} / ${DISTNAME} -win64 -setup-unsigned.exe"
311319 find . -print0 \
312320 | sort --zero-terminated \
313321 | tar --create --no-recursion --mode=' u+rw,go+r-w,a+X' --null --files-from=- \
0 commit comments