2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, libglade, gtksourceview }:
|
2010-12-31 17:48:55 +00:00
|
|
|
|
2017-10-31 00:18:41 +00:00
|
|
|
let param =
|
2021-01-11 12:49:15 +00:00
|
|
|
let check = lib.versionAtLeast ocaml.version; in
|
2020-05-08 06:25:16 +00:00
|
|
|
if check "4.06" then rec {
|
|
|
|
version = "2.18.10";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "garrigue";
|
|
|
|
repo = "lablgtk";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0w8cdfcv2wc19sd3qzj3qq77qc6rbnbynsz02gzbl15kgrvgrfxi";
|
|
|
|
};
|
2017-10-31 00:18:41 +00:00
|
|
|
} else if check "3.12" then {
|
|
|
|
version = "2.18.5";
|
2020-05-08 06:25:16 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/1627/lablgtk-2.18.5.tar.gz";
|
|
|
|
sha256 = "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib";
|
|
|
|
};
|
2017-10-31 00:18:41 +00:00
|
|
|
} else throw "lablgtk is not available for OCaml ${ocaml.version}";
|
2010-12-31 17:48:55 +00:00
|
|
|
in
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "lablgtk";
|
2020-05-08 06:25:16 +00:00
|
|
|
inherit (param) version src;
|
2010-12-31 17:48:55 +00:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-10-18 05:50:06 +00:00
|
|
|
buildInputs = [ ocaml findlib gtk2 libgnomecanvas libglade gtksourceview ];
|
2010-12-31 17:48:55 +00:00
|
|
|
|
2018-07-25 21:44:21 +00:00
|
|
|
configureFlags = [ "--with-libdir=$(out)/lib/ocaml/${ocaml.version}/site-lib" ];
|
2019-10-27 13:03:25 +00:00
|
|
|
buildFlags = [ "world" ];
|
2010-12-31 17:48:55 +00:00
|
|
|
|
2013-06-04 18:30:50 +00:00
|
|
|
preInstall = ''
|
2016-10-05 07:32:30 +00:00
|
|
|
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib
|
|
|
|
export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH
|
2010-12-31 17:48:55 +00:00
|
|
|
'';
|
|
|
|
|
2017-06-26 06:27:03 +00:00
|
|
|
dontStrip = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-10-03 23:49:05 +00:00
|
|
|
maintainers = with maintainers; [
|
2019-10-07 14:44:58 +00:00
|
|
|
maggesi roconnor vbgl
|
2010-12-31 17:48:55 +00:00
|
|
|
];
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://lablgtk.forge.ocamlcore.org/";
|
2019-09-03 22:49:40 +00:00
|
|
|
description = "An OCaml interface to GTK";
|
2014-10-03 23:49:05 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2010-12-31 17:48:55 +00:00
|
|
|
};
|
2014-10-03 23:49:05 +00:00
|
|
|
}
|