1{lib, stdenv, fetchurl, ocaml, lablgtk, findlib, libGLU, libGL, freeglut, camlp4 } :
2
3let
4 pname = "lablgl";
5in
6
7stdenv.mkDerivation rec {
8 name = "${pname}-${version}";
9 version = "1.05";
10
11 src = fetchurl {
12 url = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgl-${version}.tar.gz";
13 sha256 = "0qabydd219i4ak7hxgc67496qnnscpnydya2m4ijn3cpbgih7zyq";
14 };
15
16 buildInputs = [ocaml findlib lablgtk freeglut camlp4];
17 propagatedBuildInputs = [ libGLU libGL ];
18
19 patches = [ ./Makefile.config.patch ./META.patch ];
20
21 preConfigure = ''
22 substituteInPlace Makefile.config \
23 --subst-var-by BINDIR $out/bin \
24 --subst-var-by INSTALLDIR $out/lib/ocaml/${ocaml.version}/site-lib/lablgl \
25 --subst-var-by DLLDIR $out/lib/ocaml/${ocaml.version}/site-lib/lablgl \
26 --subst-var-by TKINCLUDES "" \
27 --subst-var-by XINCLUDES ""
28 '';
29
30 createFindlibDestdir = true;
31
32 buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
33
34 postInstall = ''
35 cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
36 '';
37
38 meta = with lib; {
39 homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
40 description = "OpenGL bindings for ocaml";
41 license = licenses.gpl2;
42 maintainers = with maintainers; [ pSub vbgl ];
43 broken = stdenv.isDarwin;
44 };
45}