1a @ { mesa, lesstif, libX11, libXaw, xproto, libXt, libSM, libICE, libXmu, libXext, libXcursor, ... } :
2let
3 fetchurl = a.fetchurl;
4
5 version = "1.5";
6 buildInputs = with a; [
7 mesa lesstif libX11 libXaw xproto libXt libSM libICE
8 libXmu libXext libXcursor
9 ];
10in
11rec {
12 srcNcbiStdH = fetchurl {
13 url = "http://www.math.uu.nl/people/kuznet/CONTENT/src/unix/ncbistd.h";
14 sha256 = "1zi3l53b0a7d3620rhxvh1jn7pz3ihl1mxl9qqw86xkmhm4q7xf3";
15 };
16
17 srcVibrant = fetchurl {
18 url = "http://www.math.uu.nl/people/kuznet/CONTENT/src/unix/vibrant.tar.gz";
19 sha256 = "1s0vsa0np3sm7jh3ps3f1sf4j64v0kw4hqasllpxx5hdgxwd8y25";
20 };
21
22 srcContent = fetchurl {
23 url = "http://www.math.uu.nl/people/kuznet/CONTENT/src/unix/content_${version}.tar.gz";
24 sha256 = "0y0dzr1d3jgbd53729jk6s2wpb5hv54xwbdird4r0s15bznpm6fs";
25 };
26
27 inherit buildInputs;
28 configureFlags = [];
29
30 /* doConfigure should be removed if not needed */
31 phaseNames = ["unpackTarballs"
32 "setPlatform" "extraVars"
33 "buildVibrant" "buildContent"
34 "install"];
35
36 unpackTarballs = a.fullDepEntry (''
37 mkdir content
38 cd content
39 mkdir vibrant
40 tar -xvf ${srcVibrant} -C vibrant
41 tar -xvf ${srcContent} -C .
42 sed -e s/SGI=/SGI=no/ -i content/makefile_v
43 '') ["minInit"];
44
45 platformTLAContent = if a.stdenv.isLinux then "LIN" else
46 throw "Three-letter code for the platform is not known";
47
48 platformTLAVibrant = if a.stdenv.isLinux then "lnx" else
49 throw "Three-letter code for the platform is not known";
50
51 setPlatform = a.fullDepEntry (''
52 sed -e 's/${platformTLAContent}=no/${platformTLAContent}=/' -i content/makefile_v
53 '') ["minInit" "unpackTarballs"];
54
55 extraVars = a.noDepEntry ''
56 export NIX_LDFLAGS="$NIX_LDFLAGS -lXcursor"
57 '';
58
59 buildVibrant = a.fullDepEntry (''
60 cd vibrant/build
61
62 export LCL=${platformTLAVibrant}
63 make copy
64 for i in *.c; do gcc $i -c -DWIN_MOTIF -I. -I../include; done
65 sh ../make/viball.${platformTLAVibrant}
66
67 cd ../..
68 '') ["addInputs" "unpackTarballs"];
69
70 buildContent = a.fullDepEntry (''
71 cd content
72
73 export PATH=$PATH:$PWD/victor:$PWD/yuri
74 make -f makefile_v unix
75
76 cd ..
77 '') ["addInputs" "buildVibrant" "setPlatform"];
78
79 install = a.fullDepEntry (''
80 mkdir -p $out/share/${name}/build-snapshot $out/bin $out/lib $out/share/${name}/doc
81 find . -name '*.o' -exec cp '{}' $out/lib ';'
82 find . -name '*.so' -exec cp '{}' $out/lib ';'
83 find . -name '*.txt' -exec cp '{}' $out/share/${name}/doc ';'
84 find . -name '*.hlp' -exec cp '{}' $out/share/${name}/doc ';'
85 find . -perm -0100 -a ! -name '*.*' -exec cp '{}' $out/bin ';'
86 cp -r . $out/share/${name}/build-snapshot
87 '') ["buildContent" "defEnsureDir" "minInit"];
88
89 name = "content-" + version;
90 meta = {
91 description = "A tool for analysis of dynamical systems";
92 maintainers = [
93 a.lib.maintainers.raskin
94 ];
95 platforms = a.lib.platforms.linux;
96 broken = true;
97 };
98}