summary refs log tree commit diff
path: root/pkgs/games/the-powder-toy/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/the-powder-toy/default.nix')
-rw-r--r--pkgs/games/the-powder-toy/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/games/the-powder-toy/default.nix b/pkgs/games/the-powder-toy/default.nix
new file mode 100644
index 00000000000..43d453f71d7
--- /dev/null
+++ b/pkgs/games/the-powder-toy/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, scons, pkgconfig, SDL, lua, fftwFloat }:
+
+let version = "90.2.322";
+in
+stdenv.mkDerivation rec {
+  name = "the-powder-toy-${version}";
+  src = fetchFromGitHub {
+    owner = "simtr";
+    repo = "The-Powder-Toy";
+    rev = "v${version}";
+    sha256 = "1rlxnk8icymalnr3j4bgpklq1dhhs0rpsyjx97isqqcwm2ys03q3";
+  };
+
+  patches = [ ./fix-env.patch ];
+
+  nativeBuildInputs = [ scons pkgconfig ];
+
+  buildInputs = [ SDL lua fftwFloat ];
+
+  buildPhase = "scons DESTDIR=$out/bin --tool='' -j$NIX_BUILD_CORES";
+
+  installPhase = ''
+    install -Dm 755 build/powder* "$out/bin/powder"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A free 2D physics sandbox game";
+    platforms = platforms.unix;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}