summary refs log tree commit diff
path: root/pkgs/tools/networking/curl
diff options
context:
space:
mode:
authorLengyel Balázs <ikervagyok@gmail.com>2017-02-05 13:37:16 +0100
committerVladimír Čunát <vcunat@gmail.com>2017-02-05 13:37:16 +0100
commit372cb3760e7e3f7dc544e83b252628f5fe1cef03 (patch)
tree56db8dc9ce6c407b5d4b3e188034b440e1af5843 /pkgs/tools/networking/curl
parent150cddca6f3ee29b46d999e74a2be11b630b3975 (diff)
downloadnixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.tar
nixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.tar.gz
nixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.tar.bz2
nixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.tar.lz
nixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.tar.xz
nixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.tar.zst
nixlib-372cb3760e7e3f7dc544e83b252628f5fe1cef03.zip
Merge #17694: curl: add gnutlsSupport ? false
(incl. a nitpick change from vcunat)
Diffstat (limited to 'pkgs/tools/networking/curl')
-rw-r--r--pkgs/tools/networking/curl/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index a80069974224..de841be3f052 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -4,6 +4,7 @@
 , ldapSupport ? false, openldap ? null
 , zlibSupport ? false, zlib ? null
 , sslSupport ? false, openssl ? null
+, gnutlsSupport ? false, gnutls ? null
 , scpSupport ? false, libssh2 ? null
 , gssSupport ? false, gss ? null
 , c-aresSupport ? false, c-ares ? null
@@ -14,6 +15,8 @@ assert idnSupport -> libidn != null;
 assert ldapSupport -> openldap != null;
 assert zlibSupport -> zlib != null;
 assert sslSupport -> openssl != null;
+assert !(gnutlsSupport && sslSupport);
+assert gnutlsSupport -> gnutls != null;
 assert scpSupport -> libssh2 != null;
 assert c-aresSupport -> c-ares != null;
 
@@ -44,6 +47,7 @@ stdenv.mkDerivation rec {
     optional gssSupport gss ++
     optional c-aresSupport c-ares ++
     optional sslSupport openssl ++
+    optional gnutlsSupport gnutls ++
     optional scpSupport libssh2;
 
   # for the second line see http://curl.haxx.se/mail/tracker-2014-03/0087.html
@@ -56,6 +60,7 @@ stdenv.mkDerivation rec {
       "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt"
       "--disable-manual"
       ( if sslSupport then "--with-ssl=${openssl.dev}" else "--without-ssl" )
+      ( if gnutlsSupport then "--with-gnutls=${gnutls.dev}" else "--without-gnutls" )
       ( if scpSupport then "--with-libssh2=${libssh2.dev}" else "--without-libssh2" )
       ( if ldapSupport then "--enable-ldap" else "--disable-ldap" )
       ( if ldapSupport then "--enable-ldaps" else "--disable-ldaps" )
@@ -70,6 +75,10 @@ stdenv.mkDerivation rec {
   postInstall = ''
     moveToOutput bin/curl-config "$dev"
     sed '/^dependency_libs/s|${libssh2.dev}|${libssh2.out}|' -i "$out"/lib/*.la
+  '' + stdenv.lib.optionalString gnutlsSupport ''
+    ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so
+    ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so.4
+    ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so.4.4.0
   '';
 
   crossAttrs = {
@@ -77,6 +86,7 @@ stdenv.mkDerivation rec {
     # For the 'urandom', maybe it should be a cross-system option
     configureFlags = [
         ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" )
+        ( if gnutlsSupport then "--with-gnutls=${gnutls.crossDrv}" else "--without-gnutls" )
         "--with-random /dev/urandom"
       ];
   };