tic-80: add support for darwin

Already built 'successfully' with `NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1`,
but the default CMake `installPhase` didn't do anything on macOS, so it
just resulted in an empty directory.

Bundle creation commands are based on [the ones in the README][], but
without the wrapper script since the extra args don't seem to be needed.

[the ones in the README]: https://github.com/nesbox/TIC-80#mac
This commit is contained in:
Rhys-T
2025-07-26 14:56:18 -04:00
parent e75ca8f04c
commit e9e5d9c6c5
+10 -1
View File
@@ -73,6 +73,15 @@ stdenv.mkDerivation {
"BUILD_WITH_ALL"
]);
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out"/Applications/TIC-80.app/Contents/{MacOS,Resources}
cp bin/tic80 "$out"/Applications/TIC-80.app/Contents/MacOS/tic80
cp macosx/tic80.plist "$out"/Applications/TIC-80.app/Contents/Info.plist
cp macosx/tic80.icns "$out"/Applications/TIC-80.app/Contents/Resources/tic80.icns
mkdir -p "$out"/bin
ln -s "$out"/Applications/TIC-80.app/Contents/MacOS/tic80 "$out"/bin/tic80
'';
nativeBuildInputs = [
cmake
curl
@@ -109,7 +118,7 @@ stdenv.mkDerivation {
'';
homepage = "https://github.com/nesbox/TIC-80";
license = licenses.mit;
platforms = platforms.linux;
platforms = with platforms; linux ++ darwin;
mainProgram = "tic80";
maintainers = with maintainers; [ blinry ];
};