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
, angstrom, faraday, alcotest
}:
{ stdenv, fetchFromGitHub, buildDunePackage, angstrom, faraday, alcotest }:
stdenv.mkDerivation rec {
buildDunePackage rec {
pname = "httpaf";
version = "0.4.1";
name = "ocaml${ocaml.version}-httpaf-${version}";
src = fetchFromGitHub {
owner = "inhabitedtype";
repo = "httpaf";
repo = pname;
rev = version;
sha256 = "0i2r004ihj00hd97475y8nhjqjln58xx087zcjl0dfp0n7q80517";
};
buildInputs = [ ocaml findlib dune alcotest ];
buildInputs = [ alcotest ];
propagatedBuildInputs = [ angstrom faraday ];
buildPhase = "dune build -p httpaf";
doCheck = true;
checkPhase = "dune runtest -p httpaf";
inherit (dune) installPhase;
meta = {
description = "A high-performance, memory-efficient, and scalable web server for OCaml";
license = stdenv.lib.licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.vbgl ];
inherit (src.meta) homepage;
inherit (ocaml.meta) platforms;
};
}