commit dea33cdfa1f2f5e2a324088e6e1aa8cd71de560b
parent 15b0ba3637872e945c69bd92dbc669a0dd847ddc
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Thu, 13 Aug 2015 17:07:29 -0600
adjust Mac executable signing in ".dmg" mode
To satisfy the latest code-signing checks, copy the "Racket" shared
library into each ".app" and sign it before attempting to sign the
application.
Diffstat:
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/distro-build-client/info.rkt b/distro-build-client/info.rkt
@@ -2,7 +2,7 @@
(define collection "distro-build")
-(define deps '("base"
+(define deps '(["base" #:version "6.2.900.9"]
"ds-store-lib"))
(define build-deps '("at-exp-lib"))
diff --git a/distro-build-client/installer-dmg.rkt b/distro-build-client/installer-dmg.rkt
@@ -4,7 +4,8 @@
racket/format
racket/runtime-path
ds-store
- ds-store/alias)
+ ds-store/alias
+ compiler/exe-dylib-path)
(provide installer-dmg
make-dmg)
@@ -31,6 +32,7 @@
(printf "Copying ~a\n" src-dir)
(define dest-dir (build-path work-dir volname))
(copy-directory/files src-dir dest-dir
+ #:preserve-links? #t
#:keep-modify-seconds? #t)
(when readme
(call-with-output-file*
@@ -86,6 +88,16 @@
(path-replace-suffix name #"")))
(define exe (build-path f "Contents" "MacOS" name))
(when (file-exists? exe)
+ ;; Move a copy of the `Racket` framework into the ".app":
+ (when (regexp-match #rx"^@executable_path/[.][.]/[.][.]/[.][.]/lib/Racket.framework/"
+ (find-matching-library-path exe "Racket"))
+ (define so (build-path (build-path f "Contents" "MacOS" "Racket")))
+ (copy-file (build-path (build-path f 'up "lib" "Racket.framework" "Racket"))
+ so)
+ (system*/show codesign "-s" sign-identity so)
+ ;; Update executable to point to the adjacent copy of "Racket"
+ (update-matching-library-path exe "Racket" "@executable_path/Racket"))
+ ;; Sign ".app":
(system*/show codesign "-s" sign-identity f)))))
(check-bins (build-path dest-dir "bin"))
(check-bins (build-path dest-dir "lib"))