@@ -141,19 +141,17 @@ make -C depends --jobs="$MAX_JOBS" HOST="$HOST" \
141
141
# Source Tarball Building #
142
142
# ##########################
143
143
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"
152
149
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
157
155
158
156
# ##########################
159
157
# Binary Tarball Building #
@@ -187,7 +185,9 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
187
185
cd " $DISTSRC "
188
186
189
187
# Extract the source tarball
190
- tar --strip-components=1 -xf " ${SOURCEDIST} "
188
+ tar -xf " ${GIT_ARCHIVE} "
189
+
190
+ ./autogen.sh
191
191
192
192
# Configure this DISTSRC for $HOST
193
193
# shellcheck disable=SC2086
@@ -234,7 +234,15 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
234
234
235
235
case " $HOST " in
236
236
* 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"
238
246
;;
239
247
esac
240
248
(
@@ -264,7 +272,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
264
272
cp " ${DISTSRC} /doc/README_windows.txt" " ${DISTNAME} /readme.txt"
265
273
;;
266
274
* linux* )
267
- cp " ${DISTSRC} /doc/ README.md" " ${DISTNAME} /"
275
+ cp " ${DISTSRC} /README.md" " ${DISTNAME} /"
268
276
;;
269
277
esac
270
278
@@ -307,7 +315,7 @@ case "$HOST" in
307
315
(
308
316
cd ./windeploy
309
317
mkdir unsigned
310
- cp --target-directory=unsigned/ " $OUTDIR " /bitcoin- * -setup-unsigned.exe
318
+ cp --target-directory=unsigned/ " ${ OUTDIR} / ${DISTNAME} -win64 -setup-unsigned.exe"
311
319
find . -print0 \
312
320
| sort --zero-terminated \
313
321
| tar --create --no-recursion --mode=' u+rw,go+r-w,a+X' --null --files-from=- \
0 commit comments