summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorAneesh Agrawal <aneeshusa@gmail.com>2017-08-20 13:34:16 -0700
committerAneesh Agrawal <aneeshusa@gmail.com>2017-09-18 09:21:54 -0700
commit42a8ac1b711ea4a371811f1c935e7203ddae32b5 (patch)
treea6ae7f3847ca4e5815bedfaa11d6b024afa74702 /pkgs/development
parent018a5ae2f4e01c0e7ccd63a58c308082387fc73b (diff)
downloadnixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.tar
nixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.tar.gz
nixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.tar.bz2
nixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.tar.lz
nixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.tar.xz
nixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.tar.zst
nixlib-42a8ac1b711ea4a371811f1c935e7203ddae32b5.zip
libevent: Make OpenSSL dependency optional
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/libevent/default.nix21
1 files changed, 16 insertions, 5 deletions
diff --git a/pkgs/development/libraries/libevent/default.nix b/pkgs/development/libraries/libevent/default.nix
index 6fa0caa97e91..e14f4cbf5d63 100644
--- a/pkgs/development/libraries/libevent/default.nix
+++ b/pkgs/development/libraries/libevent/default.nix
@@ -1,4 +1,8 @@
-{ stdenv, fetchurl, openssl, findutils }:
+{ stdenv, fetchurl, findutils
+, sslSupport? true, openssl
+}:
+
+assert sslSupport -> openssl != null;
 
 stdenv.mkDerivation rec {
   name = "libevent-${version}";
@@ -11,13 +15,20 @@ stdenv.mkDerivation rec {
 
   # libevent_openssl is moved into its own output, so that openssl isn't present
   # in the default closure.
-  outputs = [ "out" "dev" "openssl" ];
+  outputs = [ "out" "dev" ]
+    ++ stdenv.lib.optional sslSupport "openssl"
+    ;
   outputBin = "dev";
-  propagatedBuildOutputs = [ "out" "openssl" ];
+  propagatedBuildOutputs = [ "out" ]
+    ++ stdenv.lib.optional sslSupport "openssl"
+    ;
 
-  buildInputs = [ openssl ] ++ stdenv.lib.optional stdenv.isCygwin findutils;
+  buildInputs = []
+    ++ stdenv.lib.optional sslSupport openssl
+    ++ stdenv.lib.optional stdenv.isCygwin findutils
+    ;
 
-  postInstall = ''
+  postInstall = stdenv.lib.optionalString sslSupport ''
     moveToOutput "lib/libevent_openssl*" "$openssl"
     substituteInPlace "$dev/lib/pkgconfig/libevent_openssl.pc" \
       --replace "$out" "$openssl"