Skip to content

Commit a62ad43

Browse files
committed
Sign osx-bundle if necessary
Use an ad-hoc signature unless another signature is specified via the environment variable AEGISUB_BUNDLE_SIGNATURE.
1 parent 286f7bb commit a62ad43

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/osx-bundle.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,16 @@ echo
105105
echo "---- Fixing libraries ----"
106106
sudo python3 "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $?
107107

108+
echo
109+
echo "---- Signing ----"
110+
# Even if the binaries were already ad-hoc signed during compilation,
111+
# they need to be resigned after bundling and rewriting dylib paths.
112+
if codesign -d "${PKG_DIR}/Contents/MacOS/aegisub"; then
113+
for fname in "${PKG_DIR}/Contents/MacOS/"*; do
114+
codesign -s ${AEGISUB_BUNDLE_SIGNATURE:--} -vf "${fname}"
115+
done
116+
codesign -s ${AEGISUB_BUNDLE_SIGNATURE:--} -vf "${PKG_DIR}/"
117+
fi
118+
108119
echo
109120
echo "Done creating \"${PKG_DIR}\""

0 commit comments

Comments
 (0)