about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/lablgtk3
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2019-03-20 10:39:25 +0000
committerVincent Laporte <vbgl@users.noreply.github.com>2019-03-26 14:17:50 +0100
commit6a45d871c71b3b6334bb17d8caee7bc2b1ce57da (patch)
tree834e1ebb68dc567d1386fb7ea7aeb3f8dd15199c /pkgs/development/ocaml-modules/lablgtk3
parentf56d52bbc3d08e7b386f1fa93a8c4f7f50d2c2fb (diff)
downloadnixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.tar
nixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.tar.gz
nixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.tar.bz2
nixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.tar.lz
nixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.tar.xz
nixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.tar.zst
nixlib-6a45d871c71b3b6334bb17d8caee7bc2b1ce57da.zip
ocamlPackages.lablgtk3: use buildDunePackage
Diffstat (limited to 'pkgs/development/ocaml-modules/lablgtk3')
-rw-r--r--pkgs/development/ocaml-modules/lablgtk3/default.nix22
-rw-r--r--pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix9
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;
 }