curl: Optionally add support for GSSAPI (Kerberos).

@vcunat also did some configureFlags refactoring

authored by Petr Rockai and committed by Vladimír Čunát 7abebbad 7959eaf8

+20 -16
+20 -16
pkgs/tools/networking/curl/default.nix
··· 2 2 , zlibSupport ? false, zlib ? null 3 3 , sslSupport ? false, openssl ? null 4 4 , scpSupport ? false, libssh2 ? null 5 + , gssSupport ? false, gss ? null 5 6 , linkStatic ? false 6 7 }: 7 8 ··· 20 21 # Zlib and OpenSSL must be propagated because `libcurl.la' contains 21 22 # "-lz -lssl", which aren't necessary direct build inputs of 22 23 # applications that use Curl. 23 - propagatedBuildInputs = 24 - stdenv.lib.optional zlibSupport zlib ++ 25 - stdenv.lib.optional sslSupport openssl; 24 + propagatedBuildInputs = with stdenv.lib; 25 + optional zlibSupport zlib ++ 26 + optional gssSupport gss ++ 27 + optional sslSupport openssl; 26 28 27 - configureFlags = '' 28 - ${if sslSupport then "--with-ssl=${openssl}" else "--without-ssl"} 29 - ${if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2"} 30 - ${if linkStatic then "--enable-static --disable-shared" else ""} 29 + preConfigure = '' 30 + sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure 31 31 ''; 32 + configureFlags = [ 33 + ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" ) 34 + ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" ) 35 + ] 36 + ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}" 37 + ++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ] 38 + ; 32 39 33 40 dontDisableStatic = linkStatic; 34 41 ··· 44 51 crossAttrs = { 45 52 # We should refer to the cross built openssl 46 53 # For the 'urandom', maybe it should be a cross-system option 47 - configureFlags = '' 48 - ${if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl"} 49 - ${if linkStatic then "--enable-static --disable-shared" else ""} 50 - --with-random /dev/urandom 51 - ''; 54 + configureFlags = [ 55 + ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" ) 56 + "--with-random /dev/urandom" 57 + ] 58 + ++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ] 59 + ; 52 60 }; 53 61 54 62 passthru = { 55 63 inherit sslSupport openssl; 56 64 }; 57 - 58 - preConfigure = '' 59 - sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure 60 - ''; 61 65 62 66 meta = { 63 67 homepage = "http://curl.haxx.se/";