1{stdenv, fetchFromGitHub, mono}:
2stdenv.mkDerivation rec {
3 name = "wavefunctioncollapse-${version}";
4 version = "0.0pre20170130";
5 src = fetchFromGitHub {
6 owner = "mxgmn";
7 repo = "WaveFunctionCollapse";
8 rev = "ef660c037b1d7c4ebce66efc625af2bb2f2111c0";
9 sha256 = "1dr5fvdgn1jqqacby6rrqm951adx3jw0j70r5i8pmrqnnw482l8m";
10 };
11 buildPhase = ''
12 mcs *.cs -out:wavefunctioncollapse.exe -r:System.Drawing
13 grep -m1 -B999 '^[*][/]' Main.cs > COPYING.MIT
14 '';
15 installPhase = ''
16 mkdir -p "$out"/{bin,share/doc/wavefunctioncollapse,share/wavefunctioncollapse}
17 cp README.md COPYING.MIT "$out"/share/doc/wavefunctioncollapse
18 cp wavefunctioncollapse.exe "$out"/bin
19 cp -r [Ss]amples samples.xml "$out/share/wavefunctioncollapse"
20
21 echo "#! ${stdenv.shell}" >> "$out/bin/wavefunctioncollapse"
22 echo "chmod u+w ." >> "$out/bin/wavefunctioncollapse"
23 echo "'${mono}/bin/mono' '$out/bin/wavefunctioncollapse.exe' \"\$@\"" >> "$out/bin/wavefunctioncollapse"
24 chmod a+x "$out/bin/wavefunctioncollapse"
25 '';
26 buildInputs = [mono];
27 meta = {
28 inherit version;
29 description = ''A generator of bitmaps that are locally similar to the input bitmap'';
30 license = stdenv.lib.licenses.mit;
31 maintainers = [stdenv.lib.maintainers.raskin];
32 platforms = stdenv.lib.platforms.linux;
33 };
34}