about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/lwt_ssl
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/lwt_ssl
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/lwt_ssl')
-rw-r--r--pkgs/development/ocaml-modules/lwt_ssl/default.nix18
1 files changed, 6 insertions, 12 deletions
diff --git a/pkgs/development/ocaml-modules/lwt_ssl/default.nix b/pkgs/development/ocaml-modules/lwt_ssl/default.nix
index a06e72529864..49c2b7de3980 100644
--- a/pkgs/development/ocaml-modules/lwt_ssl/default.nix
+++ b/pkgs/development/ocaml-modules/lwt_ssl/default.nix
@@ -1,28 +1,22 @@
-{ stdenv, fetchzip, ocaml, findlib, dune, ssl, lwt }:
+{ stdenv, fetchzip, buildDunePackage, ssl, lwt }:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4.02"
-then throw "lwt_ssl is not available for OCaml ${ocaml.version}"
-else
-
-stdenv.mkDerivation rec {
+buildDunePackage rec {
+  pname = "lwt_ssl";
   version = "1.1.2";
-  name = "ocaml${ocaml.version}-lwt_ssl-${version}";
+
+  minimumOCamlVersion = "4.02";
 
   src = fetchzip {
-    url = "https://github.com/aantron/lwt_ssl/archive/${version}.tar.gz";
+    url = "https://github.com/aantron/${pname}/archive/${version}.tar.gz";
     sha256 = "1q0an3djqjxv83v3iswi7m81braqx93kcrcwrxwmf6jzhdm4pn15";
   };
 
-  buildInputs = [ ocaml findlib dune ];
   propagatedBuildInputs = [ ssl lwt ];
 
-  inherit (dune) installPhase;
-
   meta = {
     homepage = "https://github.com/aantron/lwt_ssl";
     description = "OpenSSL binding with concurrent I/O";
     license = stdenv.lib.licenses.lgpl21;
     maintainers = [ stdenv.lib.maintainers.vbgl ];
-    inherit (ocaml.meta) platforms;
   };
 }