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,33 +1,24 @@
{ stdenv, fetchFromGitHub, ocaml, findlib, dune, lwt }:
{ stdenv, fetchFromGitHub, buildDunePackage, lwt }:
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "lwt_log is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
buildDunePackage rec {
pname = "lwt_log";
version = "1.1.0";
name = "ocaml${ocaml.version}-lwt_log-${version}";
minimumOCamlVersion = "4.02";
src = fetchFromGitHub {
owner = "aantron";
repo = "lwt_log";
repo = pname;
rev = version;
sha256 = "1c58gkqfvyf2j11jwj2nh4iq999wj9xpnmr80hz9d0nk9fv333pi";
};
buildInputs = [ ocaml findlib dune ];
propagatedBuildInputs = [ lwt ];
buildPhase = "dune build -p lwt_log";
inherit (dune) installPhase;
meta = {
description = "Lwt logging library (deprecated)";
homepage = "https://github.com/aantron/lwt_log";
license = stdenv.lib.licenses.lgpl21;
inherit (ocaml.meta) platforms;
maintainers = [ stdenv.lib.maintainers.vbgl ];
};
}