Skip to content

Commit

Permalink
guix: Apply codesignatures to all MacOS binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Dec 2, 2024
1 parent cc53342 commit 51237e4
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions contrib/guix/libexec/codesign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,32 @@ 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/
find . -print0 \
| 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
Expand Down

0 comments on commit 51237e4

Please sign in to comment.