about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/re/default.nix
diff options
context:
space:
mode:
authorThéo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2018-11-05 11:21:46 +0100
committerThéo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2018-11-07 10:08:03 +0100
commit794158fcd54b862f3775bc8b54495a842a250b7b (patch)
tree333ef218a45bf9ca5d20186dc67bb9bd5209aca3 /pkgs/development/ocaml-modules/re/default.nix
parent5fc73fd52e7e9aa56911d152e3a5c49de8a18f61 (diff)
buildDunePackage: new support function; use it to refactor some OCaml derivations
Diffstat (limited to 'pkgs/development/ocaml-modules/re/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/re/default.nix19
1 files changed, 6 insertions, 13 deletions
diff --git a/pkgs/development/ocaml-modules/re/default.nix b/pkgs/development/ocaml-modules/re/default.nix
index c4215b98a50fe..b2413b7dddd63 100644
--- a/pkgs/development/ocaml-modules/re/default.nix
+++ b/pkgs/development/ocaml-modules/re/default.nix
@@ -1,29 +1,22 @@
-{ stdenv, fetchzip, ocaml, findlib, dune, ounit, seq }:
+{ stdenv, fetchzip, buildDunePackage, ounit, seq }:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4.02"
-then throw "re is not available for OCaml ${ocaml.version}"
-else
-
-stdenv.mkDerivation rec {
-  name = "ocaml${ocaml.version}-re-${version}";
+buildDunePackage rec {
+  pname = "re";
   version = "1.8.0";
 
+  minimumOCamlVersion = "4.02";
+
   src = fetchzip {
     url = "https://github.com/ocaml/ocaml-re/archive/${version}.tar.gz";
     sha256 = "0ch6hvmm4ym3w2vghjxf3ka5j1023a37980fqi4zcb7sx756z20i";
   };
 
-  buildInputs = [ ocaml findlib dune ounit ];
+  buildInputs = [ ounit ];
   propagatedBuildInputs = [ seq ];
-
   doCheck = true;
-  checkPhase = "jbuilder runtest";
-
-  inherit (dune) installPhase;
 
   meta = {
     homepage = https://github.com/ocaml/ocaml-re;
-    platforms = ocaml.meta.platforms or [];
     description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings";
     license = stdenv.lib.licenses.lgpl2;
     maintainers = with stdenv.lib.maintainers; [ vbgl ];