macOS: package the game as a proper SpaghettiKart.app bundle (#724)

* macOS: package the game as a proper SpaghettiKart.app bundle

Turns the bare Spaghettify executable into a self-contained SpaghettiKart.app:

- cmake/macos/apple_bundle.cmake: bundle metadata (using the existing
  Info.plist, which already described a bundle), app icon, runtime resources
  (config.yml, yamls, meta, spaghetti.o2r) into Contents/Resources, dylib
  relinking for local Homebrew builds (no-op with static vcpkg deps), and
  ad-hoc codesigning so the app launches without 'damaged app' warnings
- App icon: on Xcode 26+ the Icon Composer package (SpaghettiKartIcon.icon,
  drawn from the existing HM ship-kart icon.png art) compiles with actool
  into an Assets.car, giving the native Liquid Glass look on macOS 26+, plus
  a flattened icns for older systems; older Xcode falls back to the previous
  sips/iconutil flat icon. Supersedes the CreateOSXIcons target.
- Game.cpp: default SHIP_HOME to ~/Library/Application Support/SpaghettiKart
  on macOS so first-run extraction, saves, config, and mods land there
  instead of scattering into the user's home folder; a user-set SHIP_HOME
  still wins
- Info.plist: NSHighResolutionCapable for proper Retina rendering
- CI: mac jobs now ship the .app (ditto zip so the executable bit survives
  artifact upload)
- the yamls-next-to-exe copy is scoped to non-Darwin; on macOS those files
  live in Contents/Resources instead

* macOS: ship prebuilt icon artifacts instead of compiling them at build time

Commits the compiled Assets.car (Liquid Glass icon for macOS 26+) and the
flattened SpaghettiKart.icns, both built from the in-repo Icon Composer
package. The build now just copies them into the bundle, which removes the
actool machinery and the Xcode 26 requirement entirely: every build on any
machine, including CI, gets the real icon.

Also adds a staleness guard: the artifacts carry a hash stamp of the
icon.png they were made from, and if icon.png ever changes without them
being regenerated, the build automatically generates a flat icns from the
current icon.png instead, so updating the logo never requires any macOS
work and an outdated icon can never ship. Regeneration steps are documented
in apple_bundle.cmake.

* Rename the icon layer to ship-kart-layer.png

Group 2.png was the design tool's default layer name; name it for what it
is. Verified the Icon Composer package still compiles with actool after the
rename; the committed Assets.car is unaffected (compiled, self-contained).

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
quarrel07
2026-08-01 18:35:51 -07:00
committed by GitHub
parent 08dca164d4
commit aa6c9c10ca
13 changed files with 330 additions and 21 deletions
+3 -1
View File
@@ -25,7 +25,9 @@ jobs:
- name: Create Package
run: |
mkdir spaghetti-${{ matrix.config }}
mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/
# The mac build now produces SpaghettiKart.app; zip with ditto so the
# executable bit survives artifact upload.
ditto -c -k --keepParent build-cmake/SpaghettiKart.app spaghetti-${{ matrix.config }}/SpaghettiKart.app.zip
- name: Publish packaged artifacts
uses: actions/upload-artifact@v4
with:
+16 -12
View File
@@ -107,13 +107,15 @@ jobs:
path: ./build-cmake
- name: Create Package
run: |
APP=build-cmake/SpaghettiKart.app
# Insert the canonical spaghetti.o2r from the generate-port-o2r job and
# the controller database, then re-sign since the bundle contents changed.
cp build-cmake/spaghetti.o2r $APP/Contents/Resources/spaghetti.o2r
wget -O $APP/Contents/Resources/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
codesign --force --deep --sign - --options runtime --entitlements cmake/macos/entitlements.plist $APP
mkdir spaghetti-${{ matrix.config }}
mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/
mv build-cmake/spaghetti.o2r spaghetti-${{ matrix.config }}/
mv config.yml spaghetti-${{ matrix.config }}/
mv yamls spaghetti-${{ matrix.config }}/
mv meta spaghetti-${{ matrix.config }}/
wget -O spaghetti-${{ matrix.config }}/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
# Zip with ditto so the executable bit survives artifact upload.
ditto -c -k --keepParent $APP spaghetti-${{ matrix.config }}/SpaghettiKart.app.zip
- name: Publish packaged artifacts
if: matrix.config == 'Release'
uses: actions/upload-artifact@v4
@@ -146,13 +148,15 @@ jobs:
path: ./build-cmake
- name: Create Package
run: |
APP=build-cmake/SpaghettiKart.app
# Insert the canonical spaghetti.o2r from the generate-port-o2r job and
# the controller database, then re-sign since the bundle contents changed.
cp build-cmake/spaghetti.o2r $APP/Contents/Resources/spaghetti.o2r
wget -O $APP/Contents/Resources/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
codesign --force --deep --sign - --options runtime --entitlements cmake/macos/entitlements.plist $APP
mkdir spaghetti-${{ matrix.config }}
mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/
mv build-cmake/spaghetti.o2r spaghetti-${{ matrix.config }}/
mv config.yml spaghetti-${{ matrix.config }}/
mv yamls spaghetti-${{ matrix.config }}/
mv meta spaghetti-${{ matrix.config }}/
wget -O spaghetti-${{ matrix.config }}/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
# Zip with ditto so the executable bit survives artifact upload.
ditto -c -k --keepParent $APP spaghetti-${{ matrix.config }}/SpaghettiKart.app.zip
- name: Publish packaged artifacts
if: matrix.config == 'Release'
uses: actions/upload-artifact@v4