2021-11-07 13:50:48 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, ocamlPackages
|
|
|
|
, makeWrapper
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, freeglut
|
|
|
|
, mpfr
|
|
|
|
, gmp
|
2021-04-26 22:40:49 +00:00
|
|
|
, pkgsHostTarget
|
2017-06-26 17:24:33 +00:00
|
|
|
}:
|
2013-06-16 20:27:14 +00:00
|
|
|
|
2021-04-26 22:40:49 +00:00
|
|
|
let
|
|
|
|
inherit (pkgsHostTarget.targetPackages.stdenv) cc;
|
|
|
|
in
|
|
|
|
|
2021-11-07 13:50:48 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "glsurf";
|
|
|
|
version = "3.3.1";
|
2013-06-16 20:27:14 +00:00
|
|
|
|
2017-06-26 17:24:33 +00:00
|
|
|
src = fetchurl {
|
2021-11-07 13:50:48 +00:00
|
|
|
url = "https://raffalli.eu/~christophe/glsurf/glsurf-${version}.tar.gz";
|
2017-06-26 17:24:33 +00:00
|
|
|
sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
|
2013-06-16 20:27:14 +00:00
|
|
|
};
|
|
|
|
|
2021-04-26 22:40:49 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
] ++ (with ocamlPackages; [
|
2021-11-07 13:50:48 +00:00
|
|
|
ocaml
|
|
|
|
findlib
|
2021-04-26 22:40:49 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-11-07 13:50:48 +00:00
|
|
|
freeglut
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
mpfr
|
|
|
|
gmp
|
2021-04-26 22:40:49 +00:00
|
|
|
] ++ (with ocamlPackages; [
|
2021-11-07 13:50:48 +00:00
|
|
|
camlp4
|
|
|
|
lablgl
|
|
|
|
camlimages_4_2_4
|
2017-06-26 17:24:33 +00:00
|
|
|
]);
|
2013-06-16 20:27:14 +00:00
|
|
|
|
2021-04-26 22:40:49 +00:00
|
|
|
postPatch = ''
|
|
|
|
for f in callbacks*/Makefile src/Makefile; do
|
|
|
|
substituteInPlace "$f" --replace "+camlp4" \
|
|
|
|
"${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2013-06-16 20:27:14 +00:00
|
|
|
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
|
2021-04-26 22:40:49 +00:00
|
|
|
|
|
|
|
wrapProgram "$out/bin/glsurf" --set CC "${cc}/bin/${cc.targetPrefix}cc"
|
2013-06-16 20:27:14 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://raffalli.eu/~christophe/glsurf/";
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "A program to draw implicit surfaces and curves";
|
2021-02-12 23:04:18 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2013-06-16 20:27:14 +00:00
|
|
|
};
|
|
|
|
}
|