Skip to content

Commit a3856b1

Browse files
committed
fix macos-14 code signing
1 parent d7c5039 commit a3856b1

File tree

6 files changed

+34
-3
lines changed

6 files changed

+34
-3
lines changed

build/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ build_darwin () {
4545
echo "build launcher ..."
4646
brew install gcc
4747
gcc src/calm.c -o calm
48+
# codesign for macos-14 enhanced security
49+
sudo codesign --sign - --force calm
4850

4951
echo "remove Windows fonts dir ..."
5052
sed '/<dir>C:\\Windows\\Fonts<\/dir>/d' s/usr/all/fonts.conf > tmp-fonts.conf

entry.lisp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
(dist-by-new-process)
7777
(u:calm-log "building macOS Application...")
7878
(u:load-from-calm "s/usr/macos/bundle.lisp")
79+
(u:calm-log "signing macOS Application...")
80+
(u:load-from-calm "s/usr/macos/sign.lisp")
7981
(u:calm-log "building macOS DMG, this may take a while...")
8082
(u:load-from-calm "s/usr/macos/dmg.lisp"))
8183
#+win32
@@ -132,6 +134,8 @@
132134
#+darwin
133135
("make-bundle" (u:load-from-calm "s/usr/macos/bundle.lisp"))
134136
#+darwin
137+
("sign-app" (u:load-from-calm "s/usr/macos/sign.lisp"))
138+
#+darwin
135139
("make-dmg" (u:load-from-calm "s/usr/macos/dmg.lisp"))
136140

137141
#+win32

s/dev/darwin/config-lib.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ ls -lah .
6565
# copy all typelibs
6666
cp -L -R $(brew --prefix)/lib/girepository-1.0/*.typelib ./
6767

68-
# codesign for macos-14, since we changed those libs
69-
ls *.dylib | xargs -I _ codesign --sign - --force --preserve-metadata=entitlements,requirements,flags,runtime _
68+
# codesign for macos-14 enhanced security
69+
sudo codesign --sign - --force *.*
70+

s/dev/darwin/pack.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export DIST_DIR=./calm-dist/
1818

1919
./calm make-bundle
2020

21+
./calm sign-app
22+
2123
if [ -n "${CI}" ]; then
2224
echo working around for macos-13 on github ...
2325
# A workaround mentioned here https://github.com/actions/runner-images/issues/7522

s/usr/macos/bundle.lisp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
;; clean old bunlde
1919
(uiop:delete-directory-tree app-dir :validate t :if-does-not-exist :ignore)
2020

21+
(u:calm-log "signing everything before bundling, some files need sudo permission...")
22+
(u:exec (str:concat "find " dist-dir-abs " -type f | xargs -I _ sudo codesign --sign - --force _"))
23+
2124
(ensure-directories-exist app-content-dir)
2225
(ensure-directories-exist app-receipt-dir)
2326
(ensure-directories-exist app-resources-dir)
@@ -38,7 +41,10 @@
3841
dist-dir-abs
3942
app-macos-dir)
4043
;; copy icon
41-
(u:copy-file app-icon-abs (merge-pathnames "icon.icns" app-resources-dir)))
44+
(u:copy-file app-icon-abs (merge-pathnames "icon.icns" app-resources-dir))
45+
46+
(u:calm-log "signing the application bundle itself...")
47+
(u:exec (str:concat "sudo codesign --sign - --force " app-name ".app")))
4248

4349
(u:calm-log-fancy "~%Application Bundle created: ~A.app~%" app-name))
4450

s/usr/macos/sign.lisp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#-calm
2+
(ql:quickload :calm)
3+
(in-package :calm)
4+
(calm-config)
5+
6+
(defun sign-app (app-name)
7+
(uiop:chdir *calm-env-app-dir*)
8+
9+
(u:calm-log "signing everything, some files need sudo permission...")
10+
(u:exec (str:concat "find " app-name ".app -type f | xargs -I _ sudo codesign --sign - --force _"))
11+
(u:calm-log "signing the app itself...")
12+
(u:exec (str:concat "sudo codesign --sign - --force " app-name ".app"))
13+
(u:calm-log-fancy "~%APP signed: ~A.app~%" app-name))
14+
15+
(sign-app
16+
(u:get-from-env-or-ask 'app-name "Hello"))

0 commit comments

Comments
 (0)