1 { lib, stdenv, fetchurl, gtk2, glib, pkg-config, libGLU, libGL, wxGTK32, libX11, xorgproto, runtimeShell }:
3 stdenv.mkDerivation rec {
8 name = "fsg-src-${version}.tar.gz";
9 url = "https://github.com/ctrlcctrlv/wxsand/blob/master/fsg-src-${version}-ORIGINAL.tar.gz?raw=true";
10 sha256 = "1756y01rkvd3f1pkj88jqh83fqcfl2fy0c48mcq53pjzln9ycv8c";
13 patches = [ ./wxgtk-3.2.patch ];
15 hardeningDisable = [ "format" ];
17 nativeBuildInputs = [ pkg-config ];
19 buildInputs = [ glib libGLU libGL wxGTK32 libX11 xorgproto ];
23 s@currentProbIndex != 100@0@;
25 sed -re '/ctrans_prob/s/energy\[center][+]energy\[other]/(int)(fmin(energy[center]+energy[other],99))/g' -i Canvas.cpp
29 mkdir -p $out/bin $out/libexec
31 echo -e '#!${runtimeShell}\nLC_ALL=C '$out'/libexec/sand "$@"' >$out/bin/fsg
32 chmod a+x $out/bin/fsg
36 description = "Cellular automata engine tuned towards the likes of Falling Sand";
38 maintainers = [ lib.maintainers.raskin ];
39 platforms = lib.platforms.linux;