1{ lib
2, stdenv
3, fetchurl
4}:
5
6stdenv.mkDerivation rec {
7 pname = "fairymax";
8 version = "4.8";
9
10 src = fetchurl {
11 url = "http://home.hccnet.nl/h.g.muller/fmax4_8w.c";
12 hash = "sha256-ikn+CA5lxtDYSDT+Nsv1tfORhKW6/vlmHcGAT9SFfQc=";
13 };
14
15 ini = fetchurl {
16 url = "http://home.hccnet.nl/h.g.muller/fmax.ini";
17 hash = "sha256-lh2ivXx4jNdWn3pT1WKKNEvkVQ31JfdDx+vqNx44nf8=";
18 };
19
20 unpackPhase = ''
21 cp ${src} fairymax.c
22 cp ${ini} fmax.ini
23 '';
24
25 buildPhase = ''
26 cc *.c -Wno-return-type \
27 -o fairymax \
28 -DINI_FILE='"'"$out/share/fairymax/fmax.ini"'"'
29 '';
30
31 installPhase = ''
32 mkdir -p "$out"/{bin,share/fairymax}
33 cp fairymax "$out/bin"
34 cp fmax.ini "$out/share/fairymax"
35 '';
36
37 meta = with lib; {
38 homepage = "http://home.hccnet.nl/h.g.muller/dwnldpage.html";
39 description = "A small chess engine supporting fairy pieces";
40 longDescription = ''
41 A version of micro-Max that reads the piece description from a file
42 fmax.ini, so that arbitrary fairy pieces can be implemented. This version
43 (4.8J) supports up to 15 piece types, and board sizes up to 12x8.
44 '';
45 license = licenses.free;
46 maintainers = [ maintainers.raskin ];
47 platforms = platforms.all;
48 };
49}