Skip to content

Commit 01bf08c

Browse files
committed
OSX: Dummy sign templates with linker-signed
This should fix potentially improper signing done by osxcross, and allow running those on Apple M1.
1 parent 2d656c9 commit 01bf08c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

build-release.sh

+27
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,31 @@ sign_macos() {
7070
fi
7171
}
7272

73+
sign_macos_template() {
74+
if [ -z "${OSX_HOST}" ]; then
75+
return
76+
fi
77+
osx_tmpdir=$(ssh "${OSX_HOST}" "mktemp -d")
78+
reldir="$1"
79+
is_mono="$2"
80+
81+
if [[ "${is_mono}" == "1" ]]; then
82+
extra_files="osx_template.app/Contents/Resources/data.mono.*/Mono/lib/*.dylib"
83+
fi
84+
85+
scp "${reldir}/osx.zip" "${OSX_HOST}:${osx_tmpdir}"
86+
ssh "${OSX_HOST}" "
87+
cd ${osx_tmpdir} && \
88+
unzip osx.zip && \
89+
codesign --force -s - \
90+
--options=linker-signed \
91+
-v ${extra_files} osx_template.app/Contents/MacOS/* && \
92+
zip -r osx_signed.zip osx_template.app"
93+
94+
scp "${OSX_HOST}:${osx_tmpdir}/osx_signed.zip" ${reldir}/osx.zip
95+
ssh "${OSX_HOST}" "rm -rf ${osx_tmpdir}"
96+
}
97+
7398
godot_version=""
7499
templates_version=""
75100
build_classical=1
@@ -209,6 +234,7 @@ if [ "${build_classical}" == "1" ]; then
209234
chmod +x osx_template.app/Contents/MacOS/godot_osx*
210235
zip -q -9 -r "${templatesdir}/osx.zip" osx_template.app
211236
rm -rf osx_template.app
237+
sign_macos_template ${templatesdir} 0
212238

213239
## Server (Classical) ##
214240

@@ -414,6 +440,7 @@ if [ "${build_mono}" == "1" ]; then
414440
chmod +x osx_template.app/Contents/MacOS/godot_osx*
415441
zip -q -9 -r "${templatesdir_mono}/osx.zip" osx_template.app
416442
rm -rf osx_template.app
443+
sign_macos_template ${templatesdir_mono} 1
417444

418445
## Server (Mono) ##
419446

0 commit comments

Comments
 (0)