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 07:25:16 +01: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 07:25:16 +01: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 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "lablgtk";
|
2020-05-08 07:25:16 +01: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 06:50:06 +01:00
|
|
|
buildInputs = [ ocaml findlib gtk2 libgnomecanvas libglade gtksourceview ];
|
2010-12-31 17:48:55 +00:00
|
|
|
|
2018-07-25 22:44:21 +01: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 19:30:50 +01:00
|
|
|
preInstall = ''
|
2016-10-05 08:32:30 +01: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 07:27:03 +01: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-04 00:49:05 +01:00
|
|
|
maintainers = with maintainers; [
|
2019-10-07 15:44:58 +01:00
|
|
|
maggesi roconnor vbgl
|
2010-12-31 17:48:55 +00:00
|
|
|
];
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://lablgtk.forge.ocamlcore.org/";
|
2019-09-03 23:49:40 +01:00
|
|
|
description = "An OCaml interface to GTK";
|
2014-10-04 00:49:05 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
2010-12-31 17:48:55 +00:00
|
|
|
};
|
2014-10-04 00:49:05 +01:00
|
|
|
}
|