From e9e5d9c6c5f71e3fb55f561cc35752c981abbf92 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Sat, 26 Jul 2025 14:39:00 -0400 Subject: [PATCH] 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 --- pkgs/by-name/ti/tic-80/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ti/tic-80/package.nix b/pkgs/by-name/ti/tic-80/package.nix index c42152b9f97b..a23466fe9ce3 100644 --- a/pkgs/by-name/ti/tic-80/package.nix +++ b/pkgs/by-name/ti/tic-80/package.nix @@ -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 ]; };