nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, pkgconfig, gtk2, libgnomecanvas, libglade, gtksourceview }:
let param =
let check = stdenv.lib.versionAtLeast ocaml.version; in
if check "4.06" then rec {
version = "2.18.10";
src = fetchFromGitHub {
owner = "garrigue";
repo = "lablgtk";
rev = version;
sha256 = "0w8cdfcv2wc19sd3qzj3qq77qc6rbnbynsz02gzbl15kgrvgrfxi";
};
} else if check "3.12" then {
version = "2.18.5";
src = fetchurl {
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}";
in
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
pname = "lablgtk";
inherit (param) version src;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ocaml findlib gtk2 libgnomecanvas libglade gtksourceview ];
2018-07-25 22:44:21 +01:00
configureFlags = [ "--with-libdir=$(out)/lib/ocaml/${ocaml.version}/site-lib" ];
buildFlags = [ "world" ];
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
'';
2017-06-26 07:27:03 +01:00
dontStrip = true;
2014-10-04 00:49:05 +01:00
meta = with stdenv.lib; {
platforms = ocaml.meta.platforms or [];
2014-10-04 00:49:05 +01:00
maintainers = with maintainers; [
maggesi roconnor vbgl
];
homepage = "http://lablgtk.forge.ocamlcore.org/";
description = "An OCaml interface to GTK";
2014-10-04 00:49:05 +01:00
license = licenses.lgpl21Plus;
};
2014-10-04 00:49:05 +01:00
}