From 6a45d871c71b3b6334bb17d8caee7bc2b1ce57da Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 20 Mar 2019 10:39:25 +0000 Subject: [PATCH] ocamlPackages.lablgtk3: use buildDunePackage --- .../ocaml-modules/lablgtk3/default.nix | 22 +++++-------------- .../ocaml-modules/lablgtk3/sourceview3.nix | 9 ++++---- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/pkgs/development/ocaml-modules/lablgtk3/default.nix b/pkgs/development/ocaml-modules/lablgtk3/default.nix index 26131d0a98c8..7c6198add622 100644 --- a/pkgs/development/ocaml-modules/lablgtk3/default.nix +++ b/pkgs/development/ocaml-modules/lablgtk3/default.nix @@ -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; }; } diff --git a/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix b/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix index 7e8807576eeb..a266e57dd859 100644 --- a/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix +++ b/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix @@ -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; }