nixpkgs/pkgs/applications/science/math/glsurf/default.nix

68 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, ocamlPackages
, makeWrapper
, libGLU
, libGL
, freeglut
, mpfr
, gmp
, pkgsHostTarget
2017-06-26 17:24:33 +00:00
}:
2013-06-16 20:27:14 +00:00
let
inherit (pkgsHostTarget.targetPackages.stdenv) cc;
in
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 {
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
};
nativeBuildInputs = [
makeWrapper
] ++ (with ocamlPackages; [
ocaml
findlib
]);
buildInputs = [
freeglut
libGL
libGLU
mpfr
gmp
] ++ (with ocamlPackages; [
camlp4
lablgl
camlimages_4_2_4
2017-06-26 17:24:33 +00:00
]);
2013-06-16 20:27:14 +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
wrapProgram "$out/bin/glsurf" --set CC "${cc}/bin/${cc.targetPrefix}cc"
2013-06-16 20:27:14 +00:00
'';
meta = {
homepage = "https://raffalli.eu/~christophe/glsurf/";
description = "A program to draw implicit surfaces and curves";
license = lib.licenses.gpl2Plus;
2013-06-16 20:27:14 +00:00
};
}