lol
1{ lib, stdenv, fetchurl, gtk2, glib, pkg-config, libGLU, libGL, wxGTK32, libX11, xorgproto, runtimeShell }:
2
3stdenv.mkDerivation rec {
4 pname = "fsg";
5 version = "4.4";
6
7 src = fetchurl {
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";
11 };
12
13 patches = [ ./wxgtk-3.2.patch ];
14
15 hardeningDisable = [ "format" ];
16
17 nativeBuildInputs = [ pkg-config ];
18
19 buildInputs = [ glib libGLU libGL wxGTK32 libX11 xorgproto ];
20
21 preBuild = ''
22 sed -e '
23 s@currentProbIndex != 100@0@;
24 ' -i MainFrame.cpp
25 sed -re '/ctrans_prob/s/energy\[center][+]energy\[other]/(int)(fmin(energy[center]+energy[other],99))/g' -i Canvas.cpp
26 '';
27
28 installPhase = ''
29 mkdir -p $out/bin $out/libexec
30 cp sand $out/libexec
31 echo -e '#!${runtimeShell}\nLC_ALL=C '$out'/libexec/sand "$@"' >$out/bin/fsg
32 chmod a+x $out/bin/fsg
33 '';
34
35 meta = {
36 description = "Cellular automata engine tuned towards the likes of Falling Sand";
37 maintainers = [ lib.maintainers.raskin ];
38 platforms = lib.platforms.linux;
39 };
40}