ocamlPackages.lablgtk3: use buildDunePackage

This commit is contained in:
Vincent Laporte 2019-03-20 10:39:25 +00:00 committed by Vincent Laporte
parent f56d52bbc3
commit 6a45d871c7
2 changed files with 9 additions and 22 deletions

View file

@ -1,18 +1,10 @@
{ stdenv,lib, fetchFromGitHub, pkgconfig, ocaml, findlib, dune, gtk3, cairo2 }:
{ lib, fetchFromGitHub, pkgconfig, buildDunePackage, gtk3, cairo2 }:
if !lib.versionAtLeast ocaml.version "4.05"
then throw "lablgtk3 is not available for OCaml ${ocaml.version}"
else
# 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
stdenv.mkDerivation rec {
buildDunePackage rec {
version = "3.0.beta5";
pname = "lablgtk3";
name = "ocaml${ocaml.version}-${pname}-${version}";
minimumOCamlVersion = "4.05";
src = fetchFromGitHub {
owner = "garrigue";
@ -22,17 +14,13 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ocaml findlib dune gtk3 ];
buildInputs = [ gtk3 ];
propagatedBuildInputs = [ cairo2 ];
buildPhase = "dune build -p ${pname}";
inherit (dune) installPhase;
meta = {
description = "OCaml interface to gtk+-3";
homepage = "http://lablgtk.forge.ocamlcore.org/";
license = lib.licenses.lgpl21;
maintainers = [ lib.maintainers.vbgl ];
inherit (ocaml.meta) platforms;
};
}

View file

@ -1,9 +1,8 @@
{ stdenv, ocaml, gtksourceview, lablgtk3 }:
{ buildDunePackage, gtksourceview, lablgtk3 }:
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-lablgtk3-sourceview3-${version}";
buildPhase = "dune build -p lablgtk3-sourceview3";
buildDunePackage rec {
pname = "lablgtk3-sourceview3";
buildInputs = lablgtk3.buildInputs ++ [ gtksourceview ];
propagatedBuildInputs = [ lablgtk3 ];
inherit (lablgtk3) src version meta nativeBuildInputs installPhase;
inherit (lablgtk3) src version meta nativeBuildInputs;
}