mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-24 18:23:26 -03:00
guix: Apply all codesignatures to Windows binaries
This commit is contained in:
parent
51237e4418
commit
ba67aa681e
1 changed files with 25 additions and 7 deletions
|
@ -70,16 +70,34 @@ mkdir -p "$DISTSRC"
|
|||
|
||||
case "$HOST" in
|
||||
*mingw*)
|
||||
find "$PWD" -name "*-unsigned.exe" | while read -r infile; do
|
||||
infile_base="$(basename "$infile")"
|
||||
|
||||
# Codesigned *-unsigned.exe and output to OUTDIR
|
||||
# Apply detached codesignatures
|
||||
WORKDIR=".tmp"
|
||||
mkdir -p ${WORKDIR}
|
||||
cp -r --target-directory="${WORKDIR}" "unsigned/${DISTNAME}"
|
||||
find "${WORKDIR}/${DISTNAME}" -name "*.exe" -type f -exec rm {} \;
|
||||
find unsigned/ -name "*.exe" -type f | while read -r bin
|
||||
do
|
||||
bin_base="$(realpath --relative-to=unsigned/ "${bin}")"
|
||||
mkdir -p "${WORKDIR}/$(dirname "${bin_base}")"
|
||||
osslsigncode attach-signature \
|
||||
-in "$infile" \
|
||||
-out "${OUTDIR}/${infile_base/-unsigned}" \
|
||||
-in "${bin}" \
|
||||
-out "${WORKDIR}/${bin_base/-unsigned}" \
|
||||
-CAfile "$GUIX_ENVIRONMENT/etc/ssl/certs/ca-certificates.crt" \
|
||||
-sigin codesignatures/win/"$infile_base".pem
|
||||
-sigin codesignatures/win/"${bin_base}".pem
|
||||
done
|
||||
|
||||
# Move installer to outdir
|
||||
cd "${WORKDIR}"
|
||||
find . -name "*setup.exe" -print0 \
|
||||
| xargs -0r mv --target-directory="${OUTDIR}"
|
||||
|
||||
# Make .zip from binaries
|
||||
find "${DISTNAME}" -print0 \
|
||||
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
|
||||
find "${DISTNAME}" \
|
||||
| sort \
|
||||
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 )
|
||||
;;
|
||||
*darwin*)
|
||||
case "$HOST" in
|
||||
|
|
Loading…
Add table
Reference in a new issue