buildDunePackage: new support function; use it to refactor some OCaml derivations

This commit is contained in:
Théo Zimmermann
2018-11-07 10:08:03 +01:00
parent 5fc73fd52e
commit 794158fcd5
64 changed files with 506 additions and 828 deletions
+6 -13
View File
@@ -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 ];