nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 gcc13Stdenv,
4 lib,
5 makeWrapper,
6 fetchzip,
7 ocaml,
8 findlib,
9 tcl,
10 tk,
11}:
12
13let
14 params = {
15 "4.09" = {
16 version = "8.06.7";
17 sha256 = "1cqnxjv2dvw9csiz4iqqyx6rck04jgylpglk8f69kgybf7k7xk2h";
18 stdenv = gcc13Stdenv;
19 };
20 "4.10" = {
21 version = "8.06.8";
22 sha256 = "0lfjc7lscq81ibqb3fcybdzs2r1i2xl7rsgi7linq46a0pcpkinw";
23 stdenv = gcc13Stdenv;
24 };
25 "4.11" = {
26 version = "8.06.9";
27 sha256 = "1k42k3bjkf22gk39lwwzqzfhgjyhxnclslldrzpg5qy1829pbnc0";
28 stdenv = gcc13Stdenv;
29 };
30 "4.12" = {
31 version = "8.06.10";
32 sha256 = "06cck7wijq4zdshzhxm6jyl8k3j0zglj2axsyfk6q1sq754zyf4a";
33 };
34 "4.13" = {
35 version = "8.06.11";
36 sha256 = "1zjpg9jvs6i9jvbgn6zgispwqiv8rxvaszxcx9ha9fax3wzhv9qy";
37 };
38 "4.14" = {
39 version = "8.06.12";
40 sha256 = "sha256:17fmb13l18isgwr38hg9r5a0nayf2hhw6acj5153cy1sygsdg3b5";
41 };
42 "5.0" = {
43 version = "8.06.13";
44 sha256 = "sha256-Vpf13g3DEWlUI5aypiowGp2fkQPK0cOGv2XiRUY/Ip4=";
45 };
46 "5.2" = {
47 version = "8.06.14";
48 sha256 = "sha256-eVSQetk+i3KObjHfsvnD615cIsq3aZ7IxycX42cuPIU=";
49 };
50 "5.3" = {
51 version = "8.06.15";
52 sha256 = "sha256-I/y5qr5sasCtlrwxL/Lex79rg0o4tzDMBmQY7MdpU2w=";
53 };
54 };
55 param = {
56 inherit stdenv;
57 # Dummy version to let the `meta` attribute set evaluate
58 version = "";
59 sha256 = lib.fakeSha256;
60 }
61 // (params."${lib.versions.majorMinor ocaml.version}" or {
62 }
63 );
64in
65
66param.stdenv.mkDerivation {
67 inherit (param) version;
68 pname = "ocaml${ocaml.version}-labltk";
69
70 src = fetchzip {
71 url = "https://github.com/garrigue/labltk/archive/${param.version}.tar.gz";
72 inherit (param) sha256;
73 };
74
75 strictDeps = true;
76
77 nativeBuildInputs = [
78 ocaml
79 findlib
80 makeWrapper
81 ];
82 buildInputs = [
83 tcl
84 tk
85 ];
86
87 configureFlags = [
88 "--use-findlib"
89 "--installbindir"
90 "$(out)/bin"
91 ];
92 dontAddPrefix = true;
93 dontAddStaticConfigureFlags = true;
94 configurePlatforms = [ ];
95
96 buildFlags = [
97 "all"
98 "opt"
99 ];
100
101 createFindlibDestdir = true;
102
103 postInstall = ''
104 mkdir -p $OCAMLFIND_DESTDIR/stublibs
105 mv $OCAMLFIND_DESTDIR/labltk/dlllabltk.so $OCAMLFIND_DESTDIR/stublibs/
106 for p in $out/bin/*
107 do
108 wrapProgram $p --set CAML_LD_LIBRARY_PATH $OCAMLFIND_DESTDIR/stublibs
109 done
110 '';
111
112 meta = {
113 description = "OCaml interface to Tcl/Tk, including OCaml library explorer OCamlBrowser";
114 homepage = "http://labltk.forge.ocamlcore.org/";
115 license = lib.licenses.lgpl21;
116 inherit (ocaml.meta) platforms;
117 maintainers = [ lib.maintainers.vbgl ];
118 broken = !(params ? ${lib.versions.majorMinor ocaml.version});
119 };
120}