Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
80 lines
1.6 KiB
Nix
80 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
ocamlPackages,
|
|
makeWrapper,
|
|
libGLU,
|
|
libGL,
|
|
libglut,
|
|
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 = [
|
|
libglut
|
|
libGL
|
|
libGLU
|
|
mpfr
|
|
gmp
|
|
]
|
|
++ (with ocamlPackages; [
|
|
camlp4
|
|
lablgl
|
|
camlimages
|
|
num
|
|
]);
|
|
|
|
postPatch = ''
|
|
for f in callbacks*/Makefile; do
|
|
substituteInPlace "$f" --replace-warn "+camlp4" \
|
|
"${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4"
|
|
done
|
|
|
|
# Fatal error: exception Sys_error("Mutex.unlock: Operation not permitted")
|
|
sed -i "/gl_started/d" src/draw.ml* src/main.ml
|
|
|
|
# Compatibility with camlimages ≥ 5.0.5
|
|
substituteInPlace src/Makefile --replace-warn camlimages.all_formats camlimages.core
|
|
'';
|
|
|
|
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 = "Program to draw implicit surfaces and curves";
|
|
mainProgram = "glsurf";
|
|
license = lib.licenses.gpl2Plus;
|
|
platforms = lib.platforms.all;
|
|
};
|
|
}
|