From 30fa220f2edfd9389afe398c7cedf6fd8d3390cd Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:39:49 -0400 Subject: [PATCH] xgalagapp: fix darwin and cross-compiled builds Forces `$CXX` back to the correct value so it doesn't just assume `g++`. Also rewrites the derivation to use the standard `buildPhase`, and properly call the `preInstall` and `postInstall` hooks. --- pkgs/by-name/xg/xgalagapp/package.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/xg/xgalagapp/package.nix b/pkgs/by-name/xg/xgalagapp/package.nix index 8afd7f29f069..0611ba0ae8fc 100644 --- a/pkgs/by-name/xg/xgalagapp/package.nix +++ b/pkgs/by-name/xg/xgalagapp/package.nix @@ -19,14 +19,20 @@ stdenv.mkDerivation rec { libXpm ]; - buildPhase = '' - make all HIGH_SCORES_FILE=.xgalaga++.scores - ''; + buildFlags = [ + "all" + "HIGH_SCORES_FILE=.xgalaga++.scores" + "CXX=${stdenv.cc.targetPrefix}c++" # fix darwin and cross-compiled builds + ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man mv xgalaga++ $out/bin mv xgalaga++.6x $out/share/man + + runHook postInstall ''; meta = with lib; { @@ -34,6 +40,6 @@ stdenv.mkDerivation rec { description = "XGalaga++ is a classic single screen vertical shoot ’em up. It is inspired by XGalaga and reuses most of its sprites"; mainProgram = "xgalaga++"; license = licenses.gpl2Plus; - platforms = platforms.linux; + platforms = platforms.unix; }; }