Skip to content

Commit

Permalink
Fix Mac arm64 (#92)
Browse files Browse the repository at this point in the history
* Update pr.yml

* Update electron-builder.yml

* Update electron-builder.yml

* Update electron-builder.yml

* Update electron-builder.yml

* Update electron-builder.yml

* Update jdks.csv

* Update jdks.csv

* jdktool update

* jdktool update

* Update pr.yml
  • Loading branch information
freekode authored Jan 13, 2025
1 parent 8d0be14 commit 36ae320
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
3 changes: 2 additions & 1 deletion electron/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ nsis:

mac:
target:
target: default
target: dmg
arch:
- x64
- arm64
entitlementsInherit: build/entitlements.mac.plist
notarize: false
dmg:
artifactName: ${name}-${version}-${arch}.${ext}
sign: false

linux:
target:
Expand Down
5 changes: 3 additions & 2 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"publish": "npm run prepare-external-resoruces && electron-vite build && electron-builder --publish always",
"prepare-external-resoruces": "npm run jdk:download && npm run ui:build",
"jdk:download": "run-script-os",
"jdk:download:darwin:linux": "../jdktool/jdkutil.py clean:jdks download unzip",
"jdk:download:win32": "python ../jdktool/jdkutil.py clean:jdks download unzip",
"jdk:download:linux": "python ../jdktool/jdkutil.py clean download unzip -o linux -a x64",
"jdk:download:win32": "python ../jdktool/jdkutil.py clean download unzip -o win",
"jdk:download:darwin": "python ../jdktool/jdkutil.py clean download unzip -o mac -a x64 arm64",
"ui:start": "npm run start --prefix ../ui",
"ui:build": "npm run build --prefix ../ui -- --base-href=./"
},
Expand Down
1 change: 1 addition & 0 deletions jdktool/jdks.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
variant,version,os,arch,url,checksum
jre,21,mac,x64,https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jre21.0.2-macosx_x64.zip,ccf83016bf5bd261c4ab61ca8369e1297505afea1d737c6df49081e728ff3631
jre,21,mac,arm64,https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jre21.0.2-macosx_aarch64.zip,ea777b38eb629971aec8cbe29c98a8f0b4f3637813bfbd1e35031edc28a6d00a
jre,21,win,x64,https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jre21.0.2-win_x64.zip,0336647612be361db15a61489c3fcc99385cb7edfe8d75f00d92be56e6dd805f
jre,21,linux,x64,https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jre21.0.2-linux_x64.zip,a1b0f9b25effe706b5049b6c4c47bfc83871a3c9f82f62e1af8199a7c425501f
29 changes: 15 additions & 14 deletions jdktool/jdkutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,32 @@ def fix_permissions(self):

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("action", help="Action to perform", choices=["clean", "clean:jdks", "clean:zips", "download", "unzip"], nargs='+')
parser.add_argument("-t", "--variant", help="Variant to use", choices=["jre", "jdk"], default="jre")
parser.add_argument("action", help="Action to perform", choices=["clean", "download", "unzip"], nargs='+')
parser.add_argument("-o", "--os", help="OS", choices=["mac", "linux", "win"], nargs='+', required=True)
parser.add_argument("-a", "--arch", help="Architectures", choices=["x64", "arm64"], nargs='+', required=True)
args = parser.parse_args()

filtered_jdks = [jdk for jdk in jdks if jdk.arch in args.arch and jdk.os in args.os]

print("Running: {}".format(",".join(args.action)))
if "clean" in args.action or "clean:jdks" in args.action:
print("Cleaning jdks...")
if "clean" in args.action:
print("Cleaning jdks and zips...")
if not path.exists(path.join(path.dirname(__file__), "jdks")):
print("No jdks to clean")
else:
shutil.rmtree(path.join(path.dirname(__file__), "jdks"))

if "clean" in args.action or "clean:zips" in args.action:
print("Cleaning jdk zips...")
if not path.exists(path.join(path.dirname(__file__), "jdk_zips")):
print("No jdk zips to clean")
else:
shutil.rmtree(path.join(path.dirname(__file__), "jdk_zips"))

if "download" in args.action:
print("Downloading jdks...")
for jdk in jdks:
if jdk.variant == args.variant:
jdk.download()
for jdk in filtered_jdks:
jdk.download()

if "unzip" in args.action:
print("Unzipping jdks...")
for jdk in jdks:
if jdk.variant == args.variant:
jdk.unzip()
jdk.fix_permissions()
for jdk in filtered_jdks:
jdk.unzip()
jdk.fix_permissions()

0 comments on commit 36ae320

Please sign in to comment.