@@ -0,0 +1,34 @@
1+{ stdenv, fetchFromGitHub, scons, pkgconfig, SDL, lua, fftwFloat }:
2+
3+let version = "90.2.322";
4+in
5+stdenv.mkDerivation rec {
6+ name = "the-powder-toy-${version}";
7+ src = fetchFromGitHub {
8+ owner = "simtr";
9+ repo = "The-Powder-Toy";
10+ rev = "v${version}";
11+ sha256 = "1rlxnk8icymalnr3j4bgpklq1dhhs0rpsyjx97isqqcwm2ys03q3";
12+ };
13+
14+ patches = [ ./fix-env.patch ];
15+
16+ nativeBuildInputs = [ scons pkgconfig ];
17+
18+ buildInputs = [ SDL lua fftwFloat ];
19+
20+ buildPhase = "scons DESTDIR=$out/bin --tool='' -j$NIX_BUILD_CORES";
21+
22+ installPhase = ''
23+ install -Dm 755 build/powder* "$out/bin/powder"
24+ '';
25+
26+ enableParallelBuilding = true;
27+
28+ meta = with stdenv.lib; {
29+ description = "A free 2D physics sandbox game";
30+ platforms = platforms.unix;
31+ license = licenses.gpl3;
32+ maintainers = with maintainers; [ abbradar ];
33+ };
34+}