From 00bbc3f18e95e69b579594a3f022cc0bce42d11e Mon Sep 17 00:00:00 2001 From: hqurve Date: Fri, 1 Apr 2022 07:13:52 -0400 Subject: [PATCH 1/2] Revert "space-cadet-pinball: fix darwin build" This reverts commit d066c1229893851c997d2b79b5747d09ff4c0b8e. --- pkgs/games/space-cadet-pinball/default.nix | 13 +++---------- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/games/space-cadet-pinball/default.nix b/pkgs/games/space-cadet-pinball/default.nix index 31df5377f1d..312b2e32823 100644 --- a/pkgs/games/space-cadet-pinball/default.nix +++ b/pkgs/games/space-cadet-pinball/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, fetchzip -, cmake, SDL2, SDL2_mixer, Cocoa +, cmake, SDL2, SDL2_mixer , unrar-wrapper, makeWrapper , fetchpatch }: @@ -38,21 +38,15 @@ stdenv.mkDerivation rec { SDL2_mixer cmake makeWrapper - Cocoa ]; - preBuild = '' + postInstall = '' mkdir -p $out/lib/SpaceCadetPinball - mkdir -p $out/bin - ''; - - installPhase = '' install ${assets}/*.{DAT,DOC,MID,BMP,INF} ${assets}/Sounds/*.WAV $out/lib/SpaceCadetPinball # Assets are loaded from the directory of the program is stored in # https://github.com/k4zmu2a/SpaceCadetPinball/blob/de13d4e326b2dfa8e6dfb59815c0a8b9657f942d/SpaceCadetPinball/winmain.cpp#L119 - cp ../bin/SpaceCadetPinball $out/bin - cp $out/bin/SpaceCadetPinball $out/lib/SpaceCadetPinball + mv $out/bin/SpaceCadetPinball $out/lib/SpaceCadetPinball makeWrapper $out/lib/SpaceCadetPinball/SpaceCadetPinball $out/bin/SpaceCadetPinball ''; @@ -63,6 +57,5 @@ stdenv.mkDerivation rec { license = with licenses; [ unfree mit ]; maintainers = [ maintainers.hqurve ]; platforms = platforms.all; - mainProgram = "SpaceCadetPinball"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7f0d13a25e9..7fa2d5eb471 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31682,9 +31682,7 @@ with pkgs; rrootage = callPackage ../games/rrootage { }; - space-cadet-pinball = callPackage ../games/space-cadet-pinball { - inherit (darwin.apple_sdk.frameworks) Cocoa; - }; + space-cadet-pinball = callPackage ../games/space-cadet-pinball { }; starsector = callPackage ../games/starsector { openjdk = openjdk8; From 7683eadc8768cada0c4e427a56f58f1a85459de7 Mon Sep 17 00:00:00 2001 From: hqurve Date: Fri, 1 Apr 2022 07:40:09 -0400 Subject: [PATCH 2/2] 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 --- pkgs/games/space-cadet-pinball/default.nix | 14 ++++++++++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/games/space-cadet-pinball/default.nix b/pkgs/games/space-cadet-pinball/default.nix index 312b2e32823..307fc2043a6 100644 --- a/pkgs/games/space-cadet-pinball/default.nix +++ b/pkgs/games/space-cadet-pinball/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, fetchzip -, cmake, SDL2, SDL2_mixer +, cmake, SDL2, SDL2_mixer, Cocoa , unrar-wrapper, makeWrapper , fetchpatch }: @@ -38,7 +38,16 @@ stdenv.mkDerivation rec { SDL2_mixer cmake makeWrapper - ]; + ] ++ lib.optional stdenv.isDarwin Cocoa; + + # Darwin needs a custom installphase since it is excluded from the cmake install + # https://github.com/k4zmu2a/SpaceCadetPinball/blob/0f88e43ba261bc21fa5c3ef9d44969a2a079d0de/CMakeLists.txt#L221 + installPhase = lib.optionalString stdenv.isDarwin '' + runHook preInstall + mkdir -p $out/bin + install ../bin/SpaceCadetPinball $out/bin + runHook postInstall + ''; postInstall = '' mkdir -p $out/lib/SpaceCadetPinball @@ -57,5 +66,6 @@ stdenv.mkDerivation rec { license = with licenses; [ unfree mit ]; maintainers = [ maintainers.hqurve ]; platforms = platforms.all; + mainProgram = "SpaceCadetPinball"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7fa2d5eb471..7f0d13a25e9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31682,7 +31682,9 @@ with pkgs; rrootage = callPackage ../games/rrootage { }; - space-cadet-pinball = callPackage ../games/space-cadet-pinball { }; + space-cadet-pinball = callPackage ../games/space-cadet-pinball { + inherit (darwin.apple_sdk.frameworks) Cocoa; + }; starsector = callPackage ../games/starsector { openjdk = openjdk8;