git.iko.soy/typeable/nixpkgs
on master help sign in
space-cadet-pinball: reimplement fix darwin build

Darwin builds need a custom installPhase since it is excluded from the cmake install https://github.com/k4zmu2a/SpaceCadetPinball/blob/0f88e43ba261bc21fa5c3ef9d44969a2a079d0de/CMakeLists.txt#L221

commit7683eadc8768cada0c4e427a56f58f1a85459de7 authorhqurve <hqurve@outlook.com> dateFri 1 Apr 2022, 07:40 (5 years ago) parent00bbc3f
2 files changed+15−3
pkgs/games/space-cadet-pinball/default.nix+12−2 pkgs/top-level/all-packages.nix+3−1
pkgs/games/space-cadet-pinball/default.nix+12−2
@@ -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}
pkgs/top-level/all-packages.nix+3−1
@@ -31682,7 +31682,9 @@ with pkgs;
3168231682
3168331683 rrootage = callPackage ../games/rrootage { };
3168431684
31685− space-cadet-pinball = callPackage ../games/space-cadet-pinball { };
31685+ space-cadet-pinball = callPackage ../games/space-cadet-pinball {
31686+ inherit (darwin.apple_sdk.frameworks) Cocoa;
31687+ };
3168631688
3168731689 starsector = callPackage ../games/starsector {
3168831690 openjdk = openjdk8;