2021-04-22 02:08:21 +00:00
|
|
|
{ stdenv, lib, makeWrapper, fetchzip, ocaml, findlib, tcl, tk }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
let
|
|
|
|
params =
|
|
|
|
let mkNewParam = { version, sha256, rev ? version }: {
|
2020-05-29 06:06:01 +00:00
|
|
|
inherit version;
|
|
|
|
src = fetchzip {
|
2021-04-22 02:08:21 +00:00
|
|
|
url = "https://github.com/garrigue/labltk/archive/${rev}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
}; in
|
2020-05-29 06:06:01 +00:00
|
|
|
rec {
|
2021-04-22 02:08:21 +00:00
|
|
|
"4.06" = mkNewParam {
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "8.06.4";
|
2021-04-22 02:08:21 +00:00
|
|
|
rev = "labltk-8.06.4";
|
|
|
|
sha256 = "03xwnnnahb2rf4siymzqyqy8zgrx3h26qxjgbp5dh1wdl7n02c7g";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-04-22 02:08:21 +00:00
|
|
|
"4.07" = mkNewParam {
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "8.06.5";
|
2021-04-22 02:08:21 +00:00
|
|
|
rev = "1b71e2c6f3ae6847d3d5e79bf099deb7330fb419";
|
|
|
|
sha256 = "02vchmrm3izrk7daldd22harhgrjhmbw6i1pqw6hmfmrmrypypg2";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
_8_06_7 = mkNewParam {
|
|
|
|
version = "8.06.7";
|
|
|
|
sha256 = "1cqnxjv2dvw9csiz4iqqyx6rck04jgylpglk8f69kgybf7k7xk2h";
|
|
|
|
};
|
|
|
|
"4.08" = _8_06_7;
|
|
|
|
"4.09" = _8_06_7;
|
|
|
|
"4.10" = mkNewParam {
|
|
|
|
version = "8.06.8";
|
|
|
|
sha256 = "0lfjc7lscq81ibqb3fcybdzs2r1i2xl7rsgi7linq46a0pcpkinw";
|
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
"4.11" = mkNewParam {
|
|
|
|
version = "8.06.9";
|
|
|
|
sha256 = "1k42k3bjkf22gk39lwwzqzfhgjyhxnclslldrzpg5qy1829pbnc0";
|
|
|
|
};
|
2021-03-19 17:17:44 +00:00
|
|
|
"4.12" = mkNewParam {
|
|
|
|
version = "8.06.10";
|
|
|
|
sha256 = "06cck7wijq4zdshzhxm6jyl8k3j0zglj2axsyfk6q1sq754zyf4a";
|
|
|
|
};
|
2021-09-26 12:46:18 +00:00
|
|
|
"4.13" = mkNewParam {
|
|
|
|
version = "8.06.11";
|
|
|
|
sha256 = "1zjpg9jvs6i9jvbgn6zgispwqiv8rxvaszxcx9ha9fax3wzhv9qy";
|
|
|
|
};
|
2021-04-22 02:08:21 +00:00
|
|
|
};
|
|
|
|
param = params . ${lib.versions.majorMinor ocaml.version}
|
|
|
|
or (throw "labltk is not available for OCaml ${ocaml.version}");
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit (param) version src;
|
|
|
|
name = "ocaml${ocaml.version}-labltk-${version}";
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
buildInputs = [ ocaml findlib tcl tk makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ];
|
|
|
|
dontAddPrefix = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildFlags = [ "all" "opt" ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR/stublibs
|
|
|
|
mv $OCAMLFIND_DESTDIR/labltk/dlllabltk.so $OCAMLFIND_DESTDIR/stublibs/
|
2021-04-22 02:08:21 +00:00
|
|
|
for p in $out/bin/*
|
|
|
|
do
|
|
|
|
wrapProgram $p --set CAML_LD_LIBRARY_PATH $OCAMLFIND_DESTDIR/stublibs
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "OCaml interface to Tcl/Tk, including OCaml library explorer OCamlBrowser";
|
|
|
|
homepage = "http://labltk.forge.ocamlcore.org/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.lgpl21;
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|