Files
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

82 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
ocaml,
findlib,
libGLU,
libglut,
camlp-streams,
}:
if lib.versionOlder ocaml.version "4.06" then
throw "lablgl is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-lablgl";
version = "1.07";
src = fetchFromGitHub {
owner = "garrigue";
repo = "lablgl";
rev = "v${version}";
hash = "sha256-GiQKHMn5zHyvDrA2ve12X5YTm3/RZp8tukIqifgVaW4=";
};
strictDeps = true;
nativeBuildInputs = [
ocaml
findlib
];
buildInputs = [
libglut
camlp-streams
];
propagatedBuildInputs = [
libGLU
];
patches = [ ./META.patch ];
preConfigure = ''
mkdir -p $out/bin
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
cp \
Makefile.config.${if stdenv.hostPlatform.isDarwin then "osx" else "ex"} \
Makefile.config
'';
makeFlags = [
"BINDIR=${placeholder "out"}/bin/"
"INSTALLDIR=${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib/lablgl/"
"DLLDIR=${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib/stublibs/"
"XINCLUDES="
"TKINCLUDES="
"TKLIBS="
];
buildFlags = [
"lib"
"libopt"
"glut"
"glutopt"
];
postInstall = ''
cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
'';
meta = with lib; {
description = "OpenGL bindings for ocaml";
homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
license = licenses.gpl2;
maintainers = with maintainers; [
pSub
vbgl
];
mainProgram = "lablglut";
};
}