about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/conduit
diff options
context:
space:
mode:
authorThéo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2018-11-05 11:21:46 +0100
committerThéo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2018-11-07 10:08:03 +0100
commit794158fcd54b862f3775bc8b54495a842a250b7b (patch)
tree333ef218a45bf9ca5d20186dc67bb9bd5209aca3 /pkgs/development/ocaml-modules/conduit
parent5fc73fd52e7e9aa56911d152e3a5c49de8a18f61 (diff)
downloadnixlib-794158fcd54b862f3775bc8b54495a842a250b7b.tar
nixlib-794158fcd54b862f3775bc8b54495a842a250b7b.tar.gz
nixlib-794158fcd54b862f3775bc8b54495a842a250b7b.tar.bz2
nixlib-794158fcd54b862f3775bc8b54495a842a250b7b.tar.lz
nixlib-794158fcd54b862f3775bc8b54495a842a250b7b.tar.xz
nixlib-794158fcd54b862f3775bc8b54495a842a250b7b.tar.zst
nixlib-794158fcd54b862f3775bc8b54495a842a250b7b.zip
buildDunePackage: new support function; use it to refactor some OCaml derivations
Diffstat (limited to 'pkgs/development/ocaml-modules/conduit')
-rw-r--r--pkgs/development/ocaml-modules/conduit/default.nix13
-rw-r--r--pkgs/development/ocaml-modules/conduit/lwt-unix.nix12
-rw-r--r--pkgs/development/ocaml-modules/conduit/lwt.nix12
3 files changed, 14 insertions, 23 deletions
diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix
index fdfd2bed1f15..39234e86ef1c 100644
--- a/pkgs/development/ocaml-modules/conduit/default.nix
+++ b/pkgs/development/ocaml-modules/conduit/default.nix
@@ -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;
 	};
 }
diff --git a/pkgs/development/ocaml-modules/conduit/lwt-unix.nix b/pkgs/development/ocaml-modules/conduit/lwt-unix.nix
index b4357979de75..b6d2e24ec551 100644
--- a/pkgs/development/ocaml-modules/conduit/lwt-unix.nix
+++ b/pkgs/development/ocaml-modules/conduit/lwt-unix.nix
@@ -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";
 }
diff --git a/pkgs/development/ocaml-modules/conduit/lwt.nix b/pkgs/development/ocaml-modules/conduit/lwt.nix
index 69d7132a83a4..560600e2fee8 100644
--- a/pkgs/development/ocaml-modules/conduit/lwt.nix
+++ b/pkgs/development/ocaml-modules/conduit/lwt.nix
@@ -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";
 }