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
@@ -1,12 +1,11 @@
{ stdenv, fetchurl, ocaml, findlib, dune }:
{ stdenv, fetchurl, buildDunePackage }:
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
stdenv.mkDerivation rec {
buildDunePackage rec {
pname = "wtf8";
name = "ocaml-${pname}-${version}";
version = "1.0.1";
minimumOCamlVersion = "4.01";
src = fetchurl {
url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
sha256 = "1msg3vycd3k8qqj61sc23qks541cxpb97vrnrvrhjnqxsqnh6ygq";
@@ -14,17 +13,10 @@ stdenv.mkDerivation rec {
unpackCmd = "tar xjf $src";
buildInputs = [ ocaml findlib dune ];
buildPhase = "dune build -p wtf8";
inherit (dune) installPhase;
meta = with stdenv.lib; {
homepage = https://github.com/flowtype/ocaml-wtf8;
description = "WTF-8 is a superset of UTF-8 that allows unpaired surrogates.";
license = licenses.mit;
platforms = ocaml.meta.platforms or [];
maintainers = [ maintainers.eqyiel ];
};
}