Skip to content

Commit

Permalink
Move macOS jre into separate folder & replace existing signature
Browse files Browse the repository at this point in the history
For whatever reason, when unzipping the archive with Java during
the p2 installation process, the newline at the end of the legal
files is removed. That renders the code signature invalid. Therefore,
we unzip here with Jave and the sign the archive.
  • Loading branch information
buchen committed Sep 15, 2024
1 parent 2709198 commit 117dac2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bundles/name.abuchen.zulu.jre.macosx.aarch64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<download.filePostfix>macosx_aarch64.zip</download.filePostfix>
<download.unzippedFolderPostfix>macosx_aarch64</download.unzippedFolderPostfix>
<download.jre.folder>zulu-21.jre</download.jre.folder>
<jre.folder></jre.folder>
<jre.folder>jre</jre.folder>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:../Eclipse/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/Contents/Home/lib/libjli.dylib);
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:../Eclipse/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/jre/Contents/Home/lib/libjli.dylib);

instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:null);

instructions.install = \
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/Contents/Home/,targetFile:bin,permissions:755,options:-R);\
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/Contents/Home/lib,targetFile:jspawnhelper,permissions:755);\
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/jre/Contents/Home/,targetFile:bin,permissions:755,options:-R);\
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/jre/Contents/Home/lib,targetFile:jspawnhelper,permissions:755);\
2 changes: 1 addition & 1 deletion bundles/name.abuchen.zulu.jre.macosx.x86_64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<download.filePostfix>macosx_x64.zip</download.filePostfix>
<download.unzippedFolderPostfix>macosx_x64</download.unzippedFolderPostfix>
<download.jre.folder>zulu-21.jre</download.jre.folder>
<jre.folder></jre.folder>
<jre.folder>jre</jre.folder>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:../Eclipse/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/Contents/Home/lib/libjli.dylib);
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:../Eclipse/plugins/name.abuchen.zulu.jre.macosx.aarch64_${version}/jre/Contents/Home/lib/libjli.dylib);

instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:null);

instructions.install = \
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.x86_64_${version}/Contents/Home/,targetFile:bin,permissions:755,options:-R);\
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.x86_64_${version}/Contents/Home/lib,targetFile:jspawnhelper,permissions:755);\
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.x86_64_${version}/jre/Contents/Home/,targetFile:bin,permissions:755,options:-R);\
org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/plugins/name.abuchen.zulu.jre.macosx.x86_64_${version}/jre/Contents/Home/lib,targetFile:jspawnhelper,permissions:755);\
21 changes: 17 additions & 4 deletions bundles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@
</else>
</ac:if>
<move file="${project.build.directory}/downloads/${download.unzippedFolder}${download.unzippedFolderPostfix}/${download.jre.folder}" tofile="${project.build.directory}/downloads/${jre.folder}"/>
<!-- resign the package because unzipping with Java removes the newline at the end of the legal files -->
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<contains string="${project.artifactId}" substring="macos"/>
<then>
<exec executable="codesign">
<arg value="-s"/>
<arg value="${env.CODESIGN_ID}"/>
<arg value="--deep"/>
<arg value="--timestamp"/>
<arg value="--options"/>
<arg value="runtime"/>
<arg value="--force"/>
<arg value="-vvv"/>
<arg value="${project.build.directory}/downloads/${jre.folder}"/>
</exec>
</then>
</ac:if>
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -146,10 +163,6 @@
<includes>
<include>${jre.folder}/**/*</include>
</includes>
<excludes>
<exclude>zulu21.36.17-ca-jre21.0.4-macosx_x64</exclude>
<exclude>zulu21.36.17-ca-jre21.0.4-macosx_aarch64</exclude>
</excludes>
</fileSet>
<!-- filter p2.inf w/ correct version info -->
<fileSet>
Expand Down

0 comments on commit 117dac2

Please sign in to comment.