2024-07-27 06:49:29 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libglut, camlp-streams } :
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
if lib.versionOlder ocaml.version "4.06"
|
2021-12-19 01:06:50 +00:00
|
|
|
then throw "lablgl is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-19 01:06:50 +00:00
|
|
|
pname = "ocaml${ocaml.version}-lablgl";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.07";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "garrigue";
|
|
|
|
repo = "lablgl";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-GiQKHMn5zHyvDrA2ve12X5YTm3/RZp8tukIqifgVaW4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
2024-07-27 06:49:29 +00:00
|
|
|
buildInputs = [ libglut camlp-streams ];
|
2023-04-29 16:46:19 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
libGLU
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
patches = [ ./META.patch ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2021-12-19 01:06:50 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
|
2024-07-27 06:49:29 +00:00
|
|
|
cp \
|
|
|
|
Makefile.config.${if stdenv.hostPlatform.isDarwin then "osx" else "ex"} \
|
|
|
|
Makefile.config
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
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="
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "OpenGL bindings for ocaml";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ pSub vbgl ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "lablglut";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|