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