libgdx / packr

Packages your JAR, assets and a JVM for distribution on Windows, Linux and Mac OS X
Apache License 2.0
2.56k stars 171 forks source link

Support for macOS ARM binaries #198

Open kurisubrooks opened 3 years ago

kurisubrooks commented 3 years ago

Currently, packr builds all .app binaries as Application (Intel) binaries, even from an M1 mac. Though the Intel build runs on ARM under Rosetta 2, the CPU and GPU usage on Idle are much much higher than running a native ARM binary.

image (built on an M1 mac)

Even when building with a zulu arm64 JDK build, we get errors saying "Wrong Architecture", as it's trying to run the binary as Intel, through Rosetta 2.

image

Is there any possibility of supporting M1 and Apple Silicon platforms going forward? We'd greatly appreciate your consideration.

karlsabo commented 3 years ago

I'm sure someone will get Packr building for Apple aarch64 but I don't have the infrastructure or spare time to try and get it building and tested.

PRs a welcome.

karlsabo commented 3 years ago

With Java 16 around the corner and jpackage entering production, that might be the better option for you.

kurisubrooks commented 3 years ago

I'll definitely let our dev know but we're currently on Java 8 if I remember correctly, so this might be a bit of a bigger undertaking.

For the people who stumble upon the thread looking to add support without an M1 mac themselves, I believe you're able to build ARM binaries from Intel/x64 on Xcode 12.2 or newer.

fourlastor commented 10 months ago

Not a PR per se, but I built a launcher in Rust which follows a similar api as packr's, I followed part of the packr launcher native code to write mine, and it builds on several platforms (including linux/macos aarm), maybe packr could use it and not have to deal with the native stuff anymore?