2022-01-25 03:21:06 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, gtksourceview }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let param =
|
2021-01-15 22:18:51 +00:00
|
|
|
let check = lib.versionAtLeast ocaml.version; in
|
2020-05-15 21:57:56 +00:00
|
|
|
if check "4.06" then rec {
|
2022-01-25 03:21:06 +00:00
|
|
|
version = "2.18.12";
|
2020-05-15 21:57:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "garrigue";
|
|
|
|
repo = "lablgtk";
|
|
|
|
rev = version;
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "sha256:0asib87c42apwf1ln8541x6i3mvyajqbarifvz11in0mqn5k7g7h";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
} else if check "3.12" then {
|
|
|
|
version = "2.18.5";
|
2020-05-15 21:57:56 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/1627/lablgtk-2.18.5.tar.gz";
|
|
|
|
sha256 = "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
} else throw "lablgtk is not available for OCaml ${ocaml.version}";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "lablgtk";
|
2020-05-15 21:57:56 +00:00
|
|
|
inherit (param) version src;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ocaml findlib ];
|
|
|
|
buildInputs = [ gtk2 libgnomecanvas gtksourceview ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--with-libdir=$(out)/lib/ocaml/${ocaml.version}/site-lib" ];
|
|
|
|
buildFlags = [ "world" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib
|
|
|
|
export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
maggesi roconnor vbgl
|
|
|
|
];
|
|
|
|
homepage = "http://lablgtk.forge.ocamlcore.org/";
|
|
|
|
description = "An OCaml interface to GTK";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
};
|
|
|
|
}
|