Skip to content

Commit 148c010

Browse files
committed
working on macOS Sierra signing issues seen in processing#4705
1 parent 4bba9f2 commit 148c010

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

build/build.xml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -624,29 +624,41 @@
624624
<arg line="${jdk.path.macosx}/Contents/Home/bin/keytool macosx/work/Processing.app/Contents/PlugIns/jdk${jdk.esoteric}.jdk/Contents/Home/jre/bin"/>
625625
</exec>
626626

627+
<property name="contents.dir"
628+
location="macosx/work/Processing.app/Contents" />
629+
627630
<!-- Replace libjli.dylib symlink with actual file.
628631
Deals with code signing issues on OS X 10.9.5+ -->
629-
<property name="jli.path" value="macosx/work/Processing.app/Contents/PlugIns/jdk${jdk.esoteric}.jdk/Contents/MacOS/libjli.dylib" />
632+
<property name="jli.path" value="${contents.dir}/PlugIns/jdk${jdk.esoteric}.jdk/Contents/MacOS/libjli.dylib" />
630633
<delete file="${jli.path}" />
631634
<exec executable="cp">
632635
<arg line="${jdk.path.macosx}/Contents/Home/jre/lib/jli/libjli.dylib ${jli.path}"/>
633636
</exec>
634637

635-
<copy todir="macosx/work/Processing.app/Contents/Java">
638+
<copy todir="${contents.dir}/Java">
636639
<fileset dir=".." includes="core/library/**" /> <!-- why this? -->
637640
<!--<fileset dir="shared" includes="launch4j/**" />-->
638641
<fileset dir="shared" includes="lib/**" />
639642
<fileset file="shared/revisions.txt" />
640643
</copy>
641644

645+
<!-- Use the Processing executable as the stub for exported apps.
646+
This works b/c everything app-specific is in Info.plist. -->
647+
<property name="app.stub" value="${contents.dir}/Java/modes/java/application/mac-app-stub" />
648+
<!-- Grab a copy of the stub binary before it is signed.
649+
(See processing.mode.java.JavaBuild for usage.)
650+
Prevents signing errors with exported apps. -->
651+
<copy file="${contents.dir}/MacOS/Processing" tofile="${app.stub}" />
652+
<!-- The ant copy command does not preserve permissions. -->
653+
<chmod file="${app.stub}" perm="ugo+x" />
654+
642655
<antcall target="assemble">
643-
<param name="target.path"
644-
value="macosx/work/Processing.app/Contents/Java" />
656+
<param name="target.path" value="${contents.dir}/Java" />
645657
</antcall>
646658

647659
<exec executable="macosx/language_gen.py" />
648660

649-
<property name="launch4j.dir" value="macosx/work/Processing.app/Contents/Java/modes/java/application/launch4j" />
661+
<property name="launch4j.dir" value="${contents.dir}/Java/modes/java/application/launch4j" />
650662

651663
<!-- rename the version we need -->
652664
<move file="${launch4j.dir}/bin/windres-macosx"
@@ -717,17 +729,6 @@
717729
depends="macosx-build"
718730
description="Create a downloadable .zip for the Mac OS X version">
719731

720-
<!-- The ant copy command does not preserve permissions. -->
721-
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
722-
723-
<!-- Now handled by the app bundler -->
724-
<!--
725-
<replace file="macosx/work/Processing.app/Contents/Info.plist"
726-
token="VERSION" value="${version}" />
727-
<replace file="macosx/work/Processing.app/Contents/Info.plist"
728-
token="REVISION" value="${revision}" />
729-
-->
730-
731732
<antcall target="macosx-dist-sign" />
732733

733734
<exec executable="ditto" dir="macosx/work">

java/src/processing/mode/java/JavaBuild.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,8 @@ protected boolean exportApplication(File destFolder,
796796

797797
File macosFolder = new File(contentsFolder, "MacOS");
798798
macosFolder.mkdirs();
799-
Util.copyFile(new File(contentsOrig, "MacOS/Processing"),
799+
// This is an unsigned copy of the app binary (see build/build.xml)
800+
Util.copyFile(mode.getContentFile("application/mac-app-stub"),
800801
new File(contentsFolder, "MacOS/" + sketch.getName()));
801802

802803
File pkgInfo = new File(contentsFolder, "PkgInfo");

todo.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ X https://github.com/processing/processing/issues/4825
55
X clean up error message for sketchbook location
66
X https://github.com/processing/processing/issues/4942
77

8+
gohai
9+
X IO library updates
10+
X https://github.com/processing/processing/pull/5044
811

912
_ Application Exports report as "Damaged" on macOS Sierra
1013
_ https://github.com/processing/processing/issues/4705
1114
_ could provide script to un-quarrantine
1215
_ xattr -d -r com.apple.quarantine
16+
_ https://github.com/steakknife/unsign
1317

1418
_ should ant run launch the .app so that launchsvcs stuff works properly?
1519

0 commit comments

Comments
 (0)