1 { stdenv, lib, makeWrapper, fetchzip, Cocoa, ocaml, findlib, tcl, tk }:
5 let mkNewParam = { version, sha256, rev ? version }: {
8 url = "https://github.com/garrigue/labltk/archive/${rev}.tar.gz";
15 rev = "labltk-8.06.4";
16 sha256 = "03xwnnnahb2rf4siymzqyqy8zgrx3h26qxjgbp5dh1wdl7n02c7g";
20 rev = "1b71e2c6f3ae6847d3d5e79bf099deb7330fb419";
21 sha256 = "02vchmrm3izrk7daldd22harhgrjhmbw6i1pqw6hmfmrmrypypg2";
23 _8_06_7 = mkNewParam {
25 sha256 = "1cqnxjv2dvw9csiz4iqqyx6rck04jgylpglk8f69kgybf7k7xk2h";
31 sha256 = "0lfjc7lscq81ibqb3fcybdzs2r1i2xl7rsgi7linq46a0pcpkinw";
35 sha256 = "1k42k3bjkf22gk39lwwzqzfhgjyhxnclslldrzpg5qy1829pbnc0";
39 sha256 = "06cck7wijq4zdshzhxm6jyl8k3j0zglj2axsyfk6q1sq754zyf4a";
43 sha256 = "1zjpg9jvs6i9jvbgn6zgispwqiv8rxvaszxcx9ha9fax3wzhv9qy";
47 sha256 = "sha256:17fmb13l18isgwr38hg9r5a0nayf2hhw6acj5153cy1sygsdg3b5";
51 sha256 = "sha256-Vpf13g3DEWlUI5aypiowGp2fkQPK0cOGv2XiRUY/Ip4=";
54 param = params . ${lib.versions.majorMinor ocaml.version}
55 or (throw "labltk is not available for OCaml ${ocaml.version}");
58 stdenv.mkDerivation rec {
59 inherit (param) version src;
60 pname = "ocaml${ocaml.version}-labltk";
64 nativeBuildInputs = [ ocaml findlib makeWrapper ];
65 buildInputs = [ tcl tk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
67 configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ];
69 dontAddStaticConfigureFlags = true;
70 configurePlatforms = [];
72 buildFlags = [ "all" "opt" ];
74 createFindlibDestdir = true;
77 mkdir -p $OCAMLFIND_DESTDIR/stublibs
78 mv $OCAMLFIND_DESTDIR/labltk/dlllabltk.so $OCAMLFIND_DESTDIR/stublibs/
81 wrapProgram $p --set CAML_LD_LIBRARY_PATH $OCAMLFIND_DESTDIR/stublibs
86 description = "OCaml interface to Tcl/Tk, including OCaml library explorer OCamlBrowser";
87 homepage = "http://labltk.forge.ocamlcore.org/";
88 license = lib.licenses.lgpl21;
89 inherit (ocaml.meta) platforms;
90 maintainers = [ lib.maintainers.vbgl ];