blob: 808d89ef963617ce7ea1bfeae320e1efbfe3012f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
{ lib
, stdenv
, fetchurl
, ocamlPackages
, makeWrapper
, libGLU
, libGL
, freeglut
, mpfr
, gmp
, pkgsHostTarget
}:
let
inherit (pkgsHostTarget.targetPackages.stdenv) cc;
in
stdenv.mkDerivation rec {
pname = "glsurf";
version = "3.3.1";
src = fetchurl {
url = "https://raffalli.eu/~christophe/glsurf/glsurf-${version}.tar.gz";
sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
};
nativeBuildInputs = [
makeWrapper
] ++ (with ocamlPackages; [
ocaml
findlib
]);
buildInputs = [
freeglut
libGL
libGLU
mpfr
gmp
] ++ (with ocamlPackages; [
camlp4
lablgl
camlimages_4_2_4
]);
postPatch = ''
for f in callbacks*/Makefile src/Makefile; do
substituteInPlace "$f" --replace "+camlp4" \
"${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4"
done
'';
installPhase = ''
mkdir -p $out/bin $out/share/doc/glsurf
cp ./src/glsurf.opt $out/bin/glsurf
cp ./doc/doc.pdf $out/share/doc/glsurf
cp -r ./examples $out/share/doc/glsurf
wrapProgram "$out/bin/glsurf" --set CC "${cc}/bin/${cc.targetPrefix}cc"
'';
meta = {
homepage = "https://raffalli.eu/~christophe/glsurf/";
description = "A program to draw implicit surfaces and curves";
license = lib.licenses.gpl2Plus;
};
}
|