From 372cb3760e7e3f7dc544e83b252628f5fe1cef03 Mon Sep 17 00:00:00 2001 From: Lengyel Balázs Date: Sun, 5 Feb 2017 13:37:16 +0100 Subject: Merge #17694: curl: add gnutlsSupport ? false (incl. a nitpick change from vcunat) --- pkgs/tools/networking/curl/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkgs/tools/networking/curl') 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" ]; }; -- cgit 1.4.1