@@ -0,0 +1,40 @@
1+{stdenv, fetchFromGitHub, mono}:
2+stdenv.mkDerivation rec {
3+ name = "convchain-${version}";
4+ version = "0.0pre20160901";
5+ src = fetchFromGitHub {
6+ owner = "mxgmn";
7+ repo = "ConvChain";
8+ rev = "8abb1e88a496fcae4c0ae31acd4eea55957dab68";
9+ sha256 = "0lnscljgbw0s90sfcahwvnxakml0f4d8jxi5ikm4ak8qgnvw6rql";
10+ };
11+ buildPhase = ''
12+ mcs ConvChain.cs -out:convchain.exe -r:System.Drawing
13+ mcs ConvChainFast.cs -out:convchainfast.exe -r:System.Drawing
14+ grep -m1 -B999 '^[*][/]' ConvChainFast.cs > COPYING.MIT
15+ '';
16+ installPhase = ''
17+ mkdir -p "$out"/{bin,share/doc/convchain,share/convchain}
18+ cp README.md COPYING.MIT "$out"/share/doc/convchain
19+ cp convchain*.exe "$out"/bin
20+ cp -r [Ss]amples samples.xml "$out/share/convchain"
21+
22+ echo "#! ${stdenv.shell}" >> "$out/bin/convchain"
23+ echo "chmod u+w ." >> "$out/bin/convchain"
24+ echo "'${mono}/bin/mono' '$out/bin/convchain.exe' \"\$@\"" >> "$out/bin/convchain"
25+ chmod a+x "$out/bin/convchain"
26+
27+ echo "#! ${stdenv.shell}" >> "$out/bin/convchainfast"
28+ echo "chmod u+w ." >> "$out/bin/convchainfast"
29+ echo "'${mono}/bin/mono' '$out/bin/convchainfast.exe' \"\$@\"" >> "$out/bin/convchainfast"
30+ chmod a+x "$out/bin/convchainfast"
31+ '';
32+ buildInputs = [mono];
33+ meta = {
34+ inherit version;
35+ description = ''Bitmap generation from a single example with convolutions and MCMC'';
36+ license = stdenv.lib.licenses.mit;
37+ maintainers = [stdenv.lib.maintainers.raskin];
38+ platforms = stdenv.lib.platforms.linux;
39+ };
40+}