From 51237e44182e7b87244d58c0be650d98a9e874b4 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 26 Nov 2024 17:55:40 -0500 Subject: [PATCH] guix: Apply codesignatures to all MacOS binaries --- contrib/guix/libexec/codesign.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/contrib/guix/libexec/codesign.sh b/contrib/guix/libexec/codesign.sh index ac912b33be..8729798886 100755 --- a/contrib/guix/libexec/codesign.sh +++ b/contrib/guix/libexec/codesign.sh @@ -82,8 +82,17 @@ mkdir -p "$DISTSRC" done ;; *darwin*) - # Apply detached codesignatures to dist/ (in-place) - signapple apply dist/Bitcoin-Qt.app codesignatures/osx/dist/Bitcoin-Qt.app + case "$HOST" in + arm64*) ARCH="arm64" ;; + x86_64*) ARCH="x86_64" ;; + esac + + # Apply detached codesignatures (in-place) + signapple apply dist/Bitcoin-Qt.app codesignatures/osx/"${HOST}"/dist/Bitcoin-Qt.app + find "${DISTNAME}" -wholename "*/bin/*" -type f | while read -r bin + do + signapple apply "${bin}" "codesignatures/osx/${HOST}/${bin}.${ARCH}sign" + done # Make a .zip from dist/ cd dist/ @@ -91,6 +100,14 @@ mkdir -p "$DISTSRC" | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" find . | sort \ | zip -X@ "${OUTDIR}/${DISTNAME}-${HOST}.zip" + cd .. + + # Make a .tar.gz from bins + find "${DISTNAME}" -print0 \ + | sort --zero-terminated \ + | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ + | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 ) ;; *) exit 1