1 { lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut } :
3 if lib.versionOlder ocaml.version "4.03"
4 then throw "lablgl is not available for OCaml ${ocaml.version}"
7 stdenv.mkDerivation rec {
8 pname = "ocaml${ocaml.version}-lablgl";
11 src = fetchFromGitHub {
15 sha256 = "sha256:141kc816iv59z96738i3vn9m9iw9g2zhi45hk4cchpwd99ar5l6k";
18 nativeBuildInputs = [ ocaml findlib ];
19 buildInputs = [ freeglut ];
20 propagatedBuildInputs = [ libGLU libGL ];
22 patches = [ ./Makefile.config.patch ./META.patch ];
26 mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
27 substituteInPlace Makefile.config \
28 --subst-var-by BINDIR $out/bin/ \
29 --subst-var-by INSTALLDIR $out/lib/ocaml/${ocaml.version}/site-lib/lablgl/ \
30 --subst-var-by DLLDIR $out/lib/ocaml/${ocaml.version}/site-lib/stublibs/ \
31 --subst-var-by TKINCLUDES "" \
32 --subst-var-by XINCLUDES ""
35 buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
38 cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
42 description = "OpenGL bindings for ocaml";
43 homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
44 license = licenses.gpl2;
45 maintainers = with maintainers; [ pSub vbgl ];
46 mainProgram = "lablglut";
47 broken = stdenv.isDarwin;