Skip to content

Commit

Permalink
Merge pull request #94 from kieler/als/aarch64
Browse files Browse the repository at this point in the history
Add Apple Silicon dedicated product builds
  • Loading branch information
a-sr authored Oct 25, 2023
2 parents 3582cfd + 69dc786 commit 00765a4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: KIELER RCA MacOS
path: build/de.cau.cs.kieler.semantics.product.repository/target/products/sccharts_rca_*-macosx.cocoa.x86_64.tar.gz
path: build/de.cau.cs.kieler.semantics.product.repository/target/products/sccharts_rca_*-macosx.cocoa.*.tar.gz
if-no-files-found: error

# Kieler Compiler CLI
Expand Down Expand Up @@ -167,7 +167,9 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: KIELER Compiler Diagrams CLI MacOS Jar
path: build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.jar
path: |
build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.jar
build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.aarch64.jar
if-no-files-found: error

# - name: Archive KIELER Compiler Diagrams CLI Windows
Expand Down
8 changes: 4 additions & 4 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
<!-- TODO Future Apple M1/M2 chip support? -->
<!-- <environment>
<!-- Apple M1/M2 chip support -->
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>arm64</arch>
</environment> -->
<arch>aarch64</arch>
</environment>
</environments>
</configuration>
</plugin>
Expand Down
13 changes: 13 additions & 0 deletions build/scripts/uberjar.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ def extract(args, extracted, merged, klighd):
klighd_swt['win'] = target
elif 'cocoa.macosx.x86_64' in jar:
klighd_swt['osx'] = target
elif 'cocoa.macosx.aarch64' in jar:
klighd_swt['osx.aarch64'] = target
else:
stop('Unknown platform-specific SWT fragment: ', jar)
# Remove unwanted files from fragment directory
Expand Down Expand Up @@ -298,8 +300,10 @@ def create_standalone_scripts(args, jar, target_dir, klighd):
jar_linux = jar['linux']
jar_win = jar['win']
jar_osx = jar['osx']
jar_osx_arm = jar['osx.aarch64']
else:
jar_linux = jar_win = jar_osx = jar
jar_osx_arm = None

# linux
if jar_linux:
Expand Down Expand Up @@ -336,6 +340,15 @@ def create_standalone_scripts(args, jar, target_dir, klighd):
if args.java8:
with open(join(target_dir, args.name + '-osxJava8'), 'wb') as file:
write_script(file, osx_cmd % default_options, code)

# osx ARM 64
if jar_osx_arm:
with open(jar_osx_arm, 'rb') as jar_file:
code = jar_file.read()
osx_cmd = '#!/usr/bin/env bash\nexec java -XstartOnFirstThread %s -jar $0 "$@" \n'

with open(join(target_dir, args.name + '-osx-aarch64'), 'wb') as file:
write_script(file, osx_cmd % (default_options + java9_options), code)

def write_script(file, command, code):
print('Creating script', basename(file.name))
Expand Down

0 comments on commit 00765a4

Please sign in to comment.