Commit e9e5d9c6 authored by Rhys-T's avatar Rhys-T
Browse files

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
parent e75ca8f0
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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 ];
  };