2019-02-13 21:26:50 +00:00
|
|
|
{ stdenv,lib, fetchFromGitHub, pkgconfig, ocaml, findlib, dune, gtk3, cairo2 }:
|
2018-12-03 12:10:15 +00:00
|
|
|
|
2019-02-13 21:26:50 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.05"
|
2018-12-03 12:10:15 +00:00
|
|
|
then throw "lablgtk3 is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2019-02-13 21:26:50 +00:00
|
|
|
# This package uses the dune.configurator library
|
|
|
|
# It thus needs said library to be compiled with this OCaml compiler
|
|
|
|
let __dune = dune; in
|
|
|
|
let dune = __dune.override { ocamlPackages = { inherit ocaml findlib; }; }; in
|
|
|
|
|
2018-12-03 12:10:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-02-13 21:26:50 +00:00
|
|
|
version = "3.0.beta4";
|
|
|
|
pname = "lablgtk3";
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "garrigue";
|
|
|
|
repo = "lablgtk";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1lppb7k4xb1a35i7klm9mz98hw8l2f8s7rivgzysi1sviqy1ds5d";
|
2018-12-03 12:10:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2019-02-13 21:26:50 +00:00
|
|
|
buildInputs = [ ocaml findlib dune gtk3 ];
|
|
|
|
propagatedBuildInputs = [ cairo2 ];
|
2018-12-03 12:10:15 +00:00
|
|
|
|
2019-02-13 21:26:50 +00:00
|
|
|
buildPhase = "dune build -p ${pname}";
|
|
|
|
inherit (dune) installPhase;
|
2018-12-03 12:10:15 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "OCaml interface to gtk+-3";
|
|
|
|
homepage = "http://lablgtk.forge.ocamlcore.org/";
|
2019-02-13 21:26:50 +00:00
|
|
|
license = lib.licenses.lgpl21;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2018-12-03 12:10:15 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|