@@ -1,5 +1,5 @@
11{ lib, stdenv, fetchFromGitHub, fetchzip
2−, cmake, SDL2, SDL2_mixer
2+, cmake, SDL2, SDL2_mixer, Cocoa
33, unrar-wrapper, makeWrapper
44, fetchpatch
55}:
@@ -38,7 +38,16 @@ stdenv.mkDerivation rec {
3838 SDL2_mixer
3939 cmake
4040 makeWrapper
41− ];
41+ ] ++ lib.optional stdenv.isDarwin Cocoa;
42+
43+ # Darwin needs a custom installphase since it is excluded from the cmake install
44+ # https://github.com/k4zmu2a/SpaceCadetPinball/blob/0f88e43ba261bc21fa5c3ef9d44969a2a079d0de/CMakeLists.txt#L221
45+ installPhase = lib.optionalString stdenv.isDarwin ''
46+ runHook preInstall
47+ mkdir -p $out/bin
48+ install ../bin/SpaceCadetPinball $out/bin
49+ runHook postInstall
50+ '';
4251
4352 postInstall = ''
4453 mkdir -p $out/lib/SpaceCadetPinball
@@ -57,5 +66,6 @@ stdenv.mkDerivation rec {
5766 license = with licenses; [ unfree mit ];
5867 maintainers = [ maintainers.hqurve ];
5968 platforms = platforms.all;
69+ mainProgram = "SpaceCadetPinball";
6070 };
6171}