Merge #17694: curl: add gnutlsSupport ? false

(incl. a nitpick change from vcunat)
This commit is contained in:
Lengyel Balázs 2017-02-05 13:37:16 +01:00 committed by Vladimír Čunát
parent 150cddca6f
commit 372cb3760e
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
2 changed files with 13 additions and 1 deletions

View file

@ -37,7 +37,7 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen ]
buildInputs = [ lzo lzip libtasn1 libidn p11_kit zlib gmp autogen ]
++ lib.optional doCheck nettools
++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv
++ lib.optional (tpmSupport && stdenv.isLinux) trousers
@ -47,6 +47,8 @@ stdenv.mkDerivation {
nativeBuildInputs = [ perl pkgconfig ] ++ nativeBuildInputs;
propagatedBuildInputs = [ nettle ];
inherit doCheck;
# Fixup broken libtool and pkgconfig files

View file

@ -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"
];
};