xcursor-pro: init at 2.0.2 (#335188)
[NixPkgs.git] / pkgs / development / ocaml-modules / labltk / default.nix
blob2bd7444fb8aeed137c119898feb4e6f5f87b343a
2   stdenv,
3   lib,
4   makeWrapper,
5   fetchzip,
6   Cocoa,
7   ocaml,
8   findlib,
9   tcl,
10   tk,
13 let
14   params =
15     let
16       mkNewParam =
17         {
18           version,
19           sha256,
20           rev ? version,
21         }:
22         {
23           inherit version;
24           src = fetchzip {
25             url = "https://github.com/garrigue/labltk/archive/${rev}.tar.gz";
26             inherit sha256;
27           };
28         };
29     in
30     rec {
31       "4.06" = mkNewParam {
32         version = "8.06.4";
33         rev = "labltk-8.06.4";
34         sha256 = "03xwnnnahb2rf4siymzqyqy8zgrx3h26qxjgbp5dh1wdl7n02c7g";
35       };
36       "4.07" = mkNewParam {
37         version = "8.06.5";
38         rev = "1b71e2c6f3ae6847d3d5e79bf099deb7330fb419";
39         sha256 = "02vchmrm3izrk7daldd22harhgrjhmbw6i1pqw6hmfmrmrypypg2";
40       };
41       _8_06_7 = mkNewParam {
42         version = "8.06.7";
43         sha256 = "1cqnxjv2dvw9csiz4iqqyx6rck04jgylpglk8f69kgybf7k7xk2h";
44       };
45       "4.08" = _8_06_7;
46       "4.09" = _8_06_7;
47       "4.10" = mkNewParam {
48         version = "8.06.8";
49         sha256 = "0lfjc7lscq81ibqb3fcybdzs2r1i2xl7rsgi7linq46a0pcpkinw";
50       };
51       "4.11" = mkNewParam {
52         version = "8.06.9";
53         sha256 = "1k42k3bjkf22gk39lwwzqzfhgjyhxnclslldrzpg5qy1829pbnc0";
54       };
55       "4.12" = mkNewParam {
56         version = "8.06.10";
57         sha256 = "06cck7wijq4zdshzhxm6jyl8k3j0zglj2axsyfk6q1sq754zyf4a";
58       };
59       "4.13" = mkNewParam {
60         version = "8.06.11";
61         sha256 = "1zjpg9jvs6i9jvbgn6zgispwqiv8rxvaszxcx9ha9fax3wzhv9qy";
62       };
63       "4.14" = mkNewParam {
64         version = "8.06.12";
65         sha256 = "sha256:17fmb13l18isgwr38hg9r5a0nayf2hhw6acj5153cy1sygsdg3b5";
66       };
67       "5.0" = mkNewParam {
68         version = "8.06.13";
69         sha256 = "sha256-Vpf13g3DEWlUI5aypiowGp2fkQPK0cOGv2XiRUY/Ip4=";
70       };
71       "5.2" = mkNewParam {
72         version = "8.06.14";
73         sha256 = "sha256-eVSQetk+i3KObjHfsvnD615cIsq3aZ7IxycX42cuPIU=";
74       };
75     };
76   param =
77     params.${lib.versions.majorMinor ocaml.version}
78     or (throw "labltk is not available for OCaml ${ocaml.version}");
81 stdenv.mkDerivation rec {
82   inherit (param) version src;
83   pname = "ocaml${ocaml.version}-labltk";
85   strictDeps = true;
87   nativeBuildInputs = [
88     ocaml
89     findlib
90     makeWrapper
91   ];
92   buildInputs = [
93     tcl
94     tk
95   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ];
97   configureFlags = [
98     "--use-findlib"
99     "--installbindir"
100     "$(out)/bin"
101   ];
102   dontAddPrefix = true;
103   dontAddStaticConfigureFlags = true;
104   configurePlatforms = [ ];
106   buildFlags = [
107     "all"
108     "opt"
109   ];
111   createFindlibDestdir = true;
113   postInstall = ''
114     mkdir -p $OCAMLFIND_DESTDIR/stublibs
115     mv $OCAMLFIND_DESTDIR/labltk/dlllabltk.so $OCAMLFIND_DESTDIR/stublibs/
116     for p in $out/bin/*
117     do
118       wrapProgram $p --set CAML_LD_LIBRARY_PATH $OCAMLFIND_DESTDIR/stublibs
119     done
120   '';
122   meta = {
123     description = "OCaml interface to Tcl/Tk, including OCaml library explorer OCamlBrowser";
124     homepage = "http://labltk.forge.ocamlcore.org/";
125     license = lib.licenses.lgpl21;
126     inherit (ocaml.meta) platforms;
127     maintainers = [ lib.maintainers.vbgl ];
128   };