buildDunePackage: new support function; use it to refactor some OCaml derivations
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
{ stdenv, fetchFromGitHub, ocaml, findlib, dune
|
||||
{ stdenv, fetchFromGitHub, buildDunePackage
|
||||
, ppx_sexp_conv
|
||||
, astring, ipaddr, uri
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
buildDunePackage rec {
|
||||
pname = "conduit";
|
||||
version = "1.0.0";
|
||||
name = "ocaml${ocaml.version}-conduit-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mirage";
|
||||
@@ -14,18 +14,13 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1ryigzh7sfif1mly624fpm87aw5h60n5wzdlrvqsf71qcpxc6iiz";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib dune ppx_sexp_conv ];
|
||||
buildInputs = [ ppx_sexp_conv ];
|
||||
propagatedBuildInputs = [ astring ipaddr uri ];
|
||||
|
||||
buildPhase = "dune build -p conduit";
|
||||
|
||||
inherit (dune) installPhase;
|
||||
|
||||
meta = {
|
||||
description = "Network connection library for TCP and SSL";
|
||||
license = stdenv.lib.licenses.isc;
|
||||
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
||||
inherit (src.meta) homepage;
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, ocaml, findlib, dune, conduit-lwt
|
||||
{ stdenv, buildDunePackage, conduit-lwt
|
||||
, logs, ppx_sexp_conv, lwt_ssl
|
||||
}:
|
||||
|
||||
@@ -6,13 +6,11 @@ if !stdenv.lib.versionAtLeast conduit-lwt.version "1.0"
|
||||
then conduit-lwt
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ocaml${ocaml.version}-conduit-lwt-unix-${version}";
|
||||
inherit (conduit-lwt) version src installPhase meta;
|
||||
buildDunePackage rec {
|
||||
pname = "conduit-lwt-unix";
|
||||
inherit (conduit-lwt) version src meta;
|
||||
|
||||
buildInputs = [ ocaml findlib dune ppx_sexp_conv ];
|
||||
buildInputs = [ ppx_sexp_conv ];
|
||||
|
||||
propagatedBuildInputs = [ conduit-lwt logs lwt_ssl ];
|
||||
|
||||
buildPhase = "dune build -p conduit-lwt-unix";
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
{ stdenv, ocaml, findlib, dune, ppx_sexp_conv, conduit, ocaml_lwt }:
|
||||
{ stdenv, buildDunePackage, ppx_sexp_conv, conduit, ocaml_lwt }:
|
||||
|
||||
if !stdenv.lib.versionAtLeast conduit.version "1.0"
|
||||
then conduit
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ocaml${ocaml.version}-conduit-lwt-${version}";
|
||||
inherit (conduit) version src installPhase meta;
|
||||
buildDunePackage rec {
|
||||
pname = "conduit-lwt";
|
||||
inherit (conduit) version src meta;
|
||||
|
||||
buildInputs = [ ocaml findlib dune ppx_sexp_conv ];
|
||||
buildInputs = [ ppx_sexp_conv ];
|
||||
|
||||
propagatedBuildInputs = [ conduit ocaml_lwt ];
|
||||
|
||||
buildPhase = "dune build -p conduit-lwt";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user