tailscale: build derpprobe (#364918)
[NixPkgs.git] / pkgs / development / ocaml-modules / lablgl / default.nix
blob3736fc84a8d4db09d6b0269de1ff895750dc7bd2
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   ocaml,
6   findlib,
7   libGLU,
8   libglut,
9   camlp-streams,
12 if lib.versionOlder ocaml.version "4.06" then
13   throw "lablgl is not available for OCaml ${ocaml.version}"
14 else
16   stdenv.mkDerivation rec {
17     pname = "ocaml${ocaml.version}-lablgl";
18     version = "1.07";
20     src = fetchFromGitHub {
21       owner = "garrigue";
22       repo = "lablgl";
23       rev = "v${version}";
24       hash = "sha256-GiQKHMn5zHyvDrA2ve12X5YTm3/RZp8tukIqifgVaW4=";
25     };
27     strictDeps = true;
29     nativeBuildInputs = [
30       ocaml
31       findlib
32     ];
33     buildInputs = [
34       libglut
35       camlp-streams
36     ];
37     propagatedBuildInputs = [
38       libGLU
39     ];
41     patches = [ ./META.patch ];
43     preConfigure = ''
44       mkdir -p $out/bin
45       mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
46       cp \
47         Makefile.config.${if stdenv.hostPlatform.isDarwin then "osx" else "ex"} \
48         Makefile.config
49     '';
51     makeFlags = [
52       "BINDIR=${placeholder "out"}/bin/"
53       "INSTALLDIR=${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib/lablgl/"
54       "DLLDIR=${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib/stublibs/"
55       "XINCLUDES="
56       "TKINCLUDES="
57       "TKLIBS="
58     ];
60     buildFlags = [
61       "lib"
62       "libopt"
63       "glut"
64       "glutopt"
65     ];
67     postInstall = ''
68       cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
69     '';
71     meta = with lib; {
72       description = "OpenGL bindings for ocaml";
73       homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
74       license = licenses.gpl2;
75       maintainers = with maintainers; [
76         pSub
77         vbgl
78       ];
79       mainProgram = "lablglut";
80     };
81   }