Commit 30fa220f authored by Rhys-T's avatar Rhys-T
Browse files

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.
parent 24767277
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -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;
  };
}