Build a native Apple Silicon (arm64) macOS app - #531
Conversation
Pixel Wheels could not run natively on Apple Silicon Macs. Two independent things kept it on x86_64: 1. The engine was pinned to libGDX 1.9.14, whose LWJGL 3.2.x backend ships only x86_64 macOS natives. A native arm64 JVM cannot load them, so the game required Rosetta 2 (and failed outright without it). 2. The macOS .app was cross-built on a Linux runner with packr, which only emits Intel binaries (libgdx/packr#198), bundling an x86_64 JRE 8. Changes: - Bump libGDX 1.9.14 -> 1.13.0 (LWJGL 3.3.x, arm64 macOS natives) and gdx-controllers 2.2.2 -> 2.2.4 (newer Jamepad with arm64 macOS natives). - Pass -XstartOnFirstThread on macOS in every launch path (Makefile run/ install targets and the gradle :desktop:run task); LWJGL3 hangs without it. - Package the macOS app with jpackage instead of packr. jpackage builds a real native .app bundling a runtime image of the running JDK, so it must run on macOS. Added tools/packaging/create-macos-archive, a smoke-test-macos check, Makefile targets, and a build-macos CI job on macos-14 that reuses the desktop jar from the Linux job. - Code signing + notarization are wired as optional, secret-gated steps (unsigned build still works); see tools/packaging/macos/SIGNING.md. Verified on an Apple Silicon Mac: a native aarch64 JVM drives LWJGL3's GLFW window and OpenGL context into PwGame.create(), and the jpackage .app launcher is a native arm64 Mach-O. The asset pipeline is unchanged. NOTE FOR MAINTAINER: the libGDX bump was originally avoided because 1.10.0 "causes random freeze on my test tablet". That Android regression must be re-verified on-device against 1.13.0 before release. Signing/notarization needs your Apple Developer ID secrets. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Verified on Apple SiliconBuilt and run on an M-series Mac (macOS 26.5, 1. Engine bring-up — a native On 1.9.14 this path throws 2. jpackage bundle — and 3. Full render — with the asset pipeline built, the game runs and renders its main menu natively on arm64, no exceptions. (Screenshot to follow.) Not covered here (needs the maintainer)
Linux/Windows packaging is unchanged (still packr). |

Summary
Pixel Wheels does not run natively on Apple Silicon Macs — it requires Rosetta 2, and fails outright on a Mac without it. This PR makes the macOS build native arm64.
Two independent things kept the game on x86_64:
.appis cross-built on a Linux runner with packr, which only emits Intel binaries (libgdx/packr#198) and bundles an x86_64 JRE 8.Changes
1.9.14→1.13.0(LWJGL 3.3.x, which bundles native macOS arm64 libraries) and gdx-controllers2.2.2→2.2.4(newer Jamepad with arm64 macOS natives).-XstartOnFirstThreadon macOS in every launch path — therun/installMakefile targets and the gradle:desktop:runtask. LWJGL3/GLFW hangs at startup on macOS without it..appbundling a runtime image of the running JDK, so it must run on macOS. Adds:tools/packaging/create-macos-archive(the jpackage build)tools/packaging/smoke-test-macos(asserts native libraries load on the host arch)macos-archive/macos-dist/smoke-tests-macosMakefile targetsbuild-macosCI job onmacos-14that reuses the desktop jar from the Linux job, so the asset toolchain only runs oncetools/packaging/create-archives.app; with a Developer ID it signs and notarizes. Fully documented intools/packaging/macos/SIGNING.md.Linux and Windows packaging are unchanged (still packr).
Verification
Built and run on an Apple Silicon Mac (M-series, macOS 26.5, Temurin/Homebrew JDK 17):
aarch64JVM drives LWJGL3's GLFW window and OpenGL context all the way intoPwGame.create(). On 1.9.14 this path threwUnsatisfiedLinkErroratnew Lwjgl3Application()and never reachedcreate()..applauncher is a nativeMach-O 64-bit executable arm64, with the correct bundle id and version.make macos-archive+make smoke-tests-macos→ PASS (native macOS app started on arm64).:desktop:distbuilds cleanly under JDK 17.tools/packaging/macos/SIGNING.md. Without them the build is simply unsigned (users runxattr -cr), same as today.Open questions for you
macos-13matrix leg.)