diff --git a/pkgs/by-name/ic/icbm3d/package.nix b/pkgs/by-name/ic/icbm3d/package.nix index 22a2fc0cc044..270e57c3045d 100644 --- a/pkgs/by-name/ic/icbm3d/package.nix +++ b/pkgs/by-name/ic/icbm3d/package.nix @@ -16,11 +16,22 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libX11 ]; + buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; # fix darwin and cross-compiled builds + # Function are declared after they are used in the file, this is error since gcc-14. # randnum.c:25:3: warning: implicit declaration of function 'srand' [-Wimplicit-function-declaration] # randnum.c:33:7: warning: implicit declaration of function 'rand'; did you mean 'randnum'? [-Wimplicit-function-declaration] # text.c:34:50: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] - env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; + postPatch = '' + substituteInPlace randnum.c --replace-fail 'stdio.h' 'stdlib.h' + sed -i '1i\ + #include ' text.c + + # The Makefile tries to install icbm3d immediately after building it, and + # ends up trying to copy it to /icbm3d. Normally this just gets an error + # and moves on, but it's probably better to not try it in the first place. + sed -i '/INSTALLROOT/d' makefile + ''; installPhase = '' runHook preInstall @@ -35,6 +46,6 @@ stdenv.mkDerivation (finalAttrs: { description = "3D vector-based clone of the atari game Missile Command"; mainProgram = "icbm3d"; license = lib.licenses.gpl2Plus; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; }; }) 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; }; }