2019-02-13 22:26:50 +01:00
|
|
|
{ stdenv,lib, fetchFromGitHub, pkgconfig, ocaml, findlib, dune, gtk3, cairo2 }:
|
2018-12-03 13:10:15 +01:00
|
|
|
|
2019-02-13 22:26:50 +01:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.05"
|
2018-12-03 13:10:15 +01:00
|
|
|
then throw "lablgtk3 is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2019-02-13 22:26:50 +01: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 13:10:15 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-02-26 12:01:09 +01:00
|
|
|
version = "3.0.beta5";
|
2019-02-13 22:26:50 +01:00
|
|
|
pname = "lablgtk3";
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "garrigue";
|
|
|
|
repo = "lablgtk";
|
|
|
|
rev = version;
|
2019-02-26 12:01:09 +01:00
|
|
|
sha256 = "05n3pjy4496gbgxwbypfm2462njv6dgmvkcv26az53ianpwa4vzz";
|
2018-12-03 13:10:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2019-02-13 22:26:50 +01:00
|
|
|
buildInputs = [ ocaml findlib dune gtk3 ];
|
|
|
|
propagatedBuildInputs = [ cairo2 ];
|
2018-12-03 13:10:15 +01:00
|
|
|
|
2019-02-13 22:26:50 +01:00
|
|
|
buildPhase = "dune build -p ${pname}";
|
|
|
|
inherit (dune) installPhase;
|
2018-12-03 13:10:15 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "OCaml interface to gtk+-3";
|
|
|
|
homepage = "http://lablgtk.forge.ocamlcore.org/";
|
2019-02-13 22:26:50 +01:00
|
|
|
license = lib.licenses.lgpl21;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2018-12-03 13:10:15 +01:00
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|