lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

curl: Modernize build

+121 -85
+3 -7
pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
··· 92 92 aclSupport = false; 93 93 })).crossDrv; 94 94 95 - curlMinimal = (pkgs.curl.override { 96 - zlibSupport = false; 97 - sslSupport = false; 98 - scpSupport = false; 99 - }).crossDrv; 95 + curl-light = pkgs.curl-light.crossDrv; 100 96 101 97 busyboxMinimal = (pkgs.busybox.override { 102 98 # TBD: uClibc is broken. ··· 170 166 cp -d ${gnumake}/bin/* $out/bin 171 167 cp -d ${patch}/bin/* $out/bin 172 168 cp ${patchelf}/bin/* $out/bin 173 - cp ${curlMinimal}/bin/curl $out/bin 174 - cp -d ${curlMinimal}/lib/libcurl* $out/lib 169 + cp ${curl-light}/bin/curl $out/bin 170 + cp -d ${curl-light}/lib/libcurl* $out/lib 175 171 176 172 cp -d ${gnugrep.pcre.crossDrv}/lib/libpcre*.so* $out/lib # needed by grep 177 173
+2 -8
pkgs/stdenv/linux/make-bootstrap-tools.nix
··· 10 10 aclSupport = false; 11 11 }); 12 12 13 - curlMinimal = curl.override { 14 - zlibSupport = false; 15 - sslSupport = false; 16 - scpSupport = false; 17 - }; 18 - 19 13 busyboxMinimal = busybox.override { 20 14 useUclibc = true; 21 15 enableStatic = true; ··· 83 77 cp -d ${gnumake}/bin/* $out/bin 84 78 cp -d ${patch}/bin/* $out/bin 85 79 cp ${patchelf}/bin/* $out/bin 86 - cp ${curlMinimal}/bin/curl $out/bin 87 - cp -d ${curlMinimal}/lib/libcurl* $out/lib 80 + cp ${curl-light}/bin/curl $out/bin 81 + cp -d ${curl-light}/lib/libcurl* $out/lib 88 82 89 83 cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep 90 84
+112 -60
pkgs/tools/networking/curl/default.nix
··· 1 - { stdenv, fetchurl 2 - , idnSupport ? false, libidn ? null 3 - , ldapSupport ? false, openldap ? null 4 - , zlibSupport ? false, zlib ? null 5 - , sslSupport ? false, openssl ? null 6 - , scpSupport ? false, libssh2 ? null 7 - , gssSupport ? false, gss ? null 8 - , c-aresSupport ? false, c-ares ? null 1 + { stdenv, fetchurl, pkgconfig 2 + 3 + # Optional Dependencies 4 + , zlib ? null, openssl ? null, libssh2 ? null, libnghttp2 ? null, c-ares ? null 5 + , gss ? null, rtmpdump ? null, openldap ? null, libidn ? null 6 + 7 + # Extra arguments 8 + , suffix ? "" 9 9 }: 10 10 11 - assert idnSupport -> libidn != null; 12 - assert ldapSupport -> openldap != null; 13 - assert zlibSupport -> zlib != null; 14 - assert sslSupport -> openssl != null; 15 - assert scpSupport -> libssh2 != null; 16 - assert c-aresSupport -> c-ares != null; 11 + let 12 + mkFlag = trueStr: falseStr: cond: name: val: 13 + if cond == null then null else 14 + "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}"; 15 + mkEnable = mkFlag "enable-" "disable-"; 16 + mkWith = mkFlag "with-" "without-"; 17 + mkOther = mkFlag "" "" true; 18 + 19 + shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null; 20 + 21 + isLight = suffix == "light"; 22 + isFull = suffix == "full"; 23 + nameSuffix = stdenv.lib.optionalString (suffix != "") "-${suffix}"; 24 + 25 + # Normal Depedencies 26 + optZlib = if isLight then null else shouldUsePkg zlib; 27 + optOpenssl = if isLight then null else shouldUsePkg openssl; 28 + optLibssh2 = if isLight then null else shouldUsePkg libssh2; 29 + optLibnghttp2 = if isLight then null else shouldUsePkg libnghttp2; 30 + optC-ares = if isLight then null else shouldUsePkg c-ares; 17 31 32 + # Full dependencies 33 + optGss = if !isFull then null else shouldUsePkg gss; 34 + optRtmpdump = if !isFull then null else shouldUsePkg rtmpdump; 35 + optOpenldap = if !isFull then null else shouldUsePkg openldap; 36 + optLibidn = if !isFull then null else shouldUsePkg libidn; 37 + in 38 + with stdenv.lib; 18 39 stdenv.mkDerivation rec { 19 - name = "curl-7.42.1"; 40 + name = "curl${nameSuffix}-${version}"; 41 + version = "7.42.1"; 20 42 21 43 src = fetchurl { 22 - url = "http://curl.haxx.se/download/${name}.tar.bz2"; 44 + url = "http://curl.haxx.se/download/curl-${version}.tar.bz2"; 23 45 sha256 = "11y8racpj6m4j9w7wa9sifmqvdgf22nk901sfkbxzhhy75rmk472"; 24 46 }; 25 47 26 - # Zlib and OpenSSL must be propagated because `libcurl.la' contains 27 - # "-lz -lssl", which aren't necessary direct build inputs of 28 - # applications that use Curl. 29 - propagatedBuildInputs = with stdenv.lib; 30 - optional idnSupport libidn ++ 31 - optional ldapSupport openldap ++ 32 - optional zlibSupport zlib ++ 33 - optional gssSupport gss ++ 34 - optional c-aresSupport c-ares ++ 35 - optional sslSupport openssl ++ 36 - optional scpSupport libssh2; 48 + # Use pkgconfig only when necessary 49 + nativeBuildInputs = optional (!isLight) pkgconfig; 50 + buildInputs = [ 51 + optZlib optOpenssl optLibssh2 optLibnghttp2 optC-ares 52 + optGss optRtmpdump optOpenldap optLibidn 53 + ]; 37 54 38 - # for the second line see http://curl.haxx.se/mail/tracker-2014-03/0087.html 39 - preConfigure = '' 40 - sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure 41 - rm src/tool_hugehelp.c 42 - ''; 43 - 44 - # make curl honor CURL_CA_BUNDLE & SSL_CERT_FILE 55 + # Make curl honor CURL_CA_BUNDLE & SSL_CERT_FILE 45 56 postConfigure = '' 46 - echo '#define CURL_CA_BUNDLE (getenv("CURL_CA_BUNDLE") ? getenv("CURL_CA_BUNDLE") : getenv("SSL_CERT_FILE"))' >> lib/curl_config.h 57 + echo '#define CURL_CA_BUNDLE (getenv("CURL_CA_BUNDLE") ? getenv("CURL_CA_BUNDLE") : getenv("SSL_CERT_FILE"))' >> lib/curl_config.h 47 58 ''; 48 59 49 60 configureFlags = [ 50 - ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" ) 51 - ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" ) 52 - ( if ldapSupport then "--enable-ldap" else "--disable-ldap" ) 53 - ( if ldapSupport then "--enable-ldaps" else "--disable-ldaps" ) 54 - ( if idnSupport then "--with-libidn=${libidn}" else "--without-libidn" ) 55 - ] 56 - ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}" 57 - ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}"; 58 - 59 - CXX = "g++"; 60 - CXXCPP = "g++ -E"; 61 - 62 - crossAttrs = { 63 - # We should refer to the cross built openssl 64 - # For the 'urandom', maybe it should be a cross-system option 65 - configureFlags = [ 66 - ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" ) 67 - "--with-random /dev/urandom" 68 - ]; 69 - }; 61 + (mkEnable true "http" null) 62 + (mkEnable true "ftp" null) 63 + (mkEnable true "file" null) 64 + (mkEnable (optOpenldap != null) "ldap" null) 65 + (mkEnable (optOpenldap != null) "ldaps" null) 66 + (mkEnable true "rtsp" null) 67 + (mkEnable true "proxy" null) 68 + (mkEnable true "dict" null) 69 + (mkEnable true "telnet" null) 70 + (mkEnable true "tftp" null) 71 + (mkEnable true "pop3" null) 72 + (mkEnable true "imap" null) 73 + (mkEnable true "smb" null) 74 + (mkEnable true "smtp" null) 75 + (mkEnable true "gopher" null) 76 + (mkEnable (!isLight) "manual" null) 77 + (mkEnable true "libcurl_option" null) 78 + (mkEnable false "libgcc" null) # TODO: Enable on gcc 79 + (mkWith (optZlib != null) "zlib" null) 80 + (mkEnable true "ipv4" null) 81 + (mkWith (optGss != null) "gssapi" null) 82 + (mkWith false "winssl" null) 83 + (mkWith false "darwinssl" null) 84 + (mkWith (optOpenssl != null) "ssl" null) 85 + (mkWith false "gnutls" null) 86 + (mkWith false "polarssl" null) 87 + (mkWith false "cyassl" null) 88 + (mkWith false "nss" null) 89 + (mkWith false "axtls" null) 90 + (mkWith false "libmetalink" null) 91 + (mkWith (optLibssh2 != null) "libssh2" null) 92 + (mkWith (optRtmpdump!= null) "librtmp" null) 93 + (mkEnable false "versioned-symbols" null) 94 + (mkWith false "winidn" null) 95 + (mkWith (optLibidn != null) "libidn" null) 96 + (mkWith (optLibnghttp2 != null) "nghttp2" null) 97 + (mkEnable false "sspi" null) 98 + (mkEnable true "crypto-auth" null) 99 + (mkEnable (optOpenssl != null) "tls-srp" null) 100 + (mkEnable true "unix-sockets" null) 101 + (mkEnable true "cookies" null) 102 + (mkEnable (optC-ares != null) "ares" null) 103 + ]; 70 104 71 - passthru = { 72 - inherit sslSupport openssl; 73 - }; 105 + # Fix all broken refernces to dependencies in .la and .pc files 106 + postInstall = optionalString (optZlib != null) '' 107 + sed -i 's,\(-lz\),-L${optZlib}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} 108 + '' + optionalString (optOpenssl != null) '' 109 + sed -i 's,\(-lssl\|-lcrypto\),-L${optOpenssl}/lib \1,' $out/lib/pkgconfig/libcurl.pc 110 + '' + optionalString (optLibssh2 != null) '' 111 + sed -i 's,\(-lssh2\),-L${optLibssh2}/lib \1,' $out/lib/pkgconfig/libcurl.pc 112 + '' + optionalString (optLibnghttp2 != null) '' 113 + sed -i 's,\(-lnghttp2\),-L${optLibnghttp2}/lib \1,' $out/lib/pkgconfig/libcurl.pc 114 + '' + optionalString (optC-ares != null) '' 115 + sed -i 's,\(-lcares\),-L${optC-ares}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} 116 + '' + optionalString (optGss != null) '' 117 + sed -i 's,\(-lgss\),-L${optGss}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} 118 + '' + optionalString (optRtmpdump != null) '' 119 + sed -i 's,\(-lrtmp\),-L${optRtmpdump}/lib \1,' $out/lib/pkgconfig/libcurl.pc 120 + '' + optionalString (optOpenldap != null) '' 121 + sed -i 's,\(-lgss\),-L${optOpenldap}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} 122 + '' + optionalString (optLibidn != null) '' 123 + sed -i 's,\(-lidn\),-L${optLibidn}/lib \1,' $out/lib/pkgconfig/libcurl.pc 124 + ''; 74 125 75 - meta = with stdenv.lib; { 126 + meta = { 76 127 description = "A command line tool for transferring files with URL syntax"; 77 128 homepage = http://curl.haxx.se/; 78 - maintainers = with maintainers; [ lovek323 ]; 129 + license = licenses.mit; 79 130 platforms = platforms.all; 131 + maintainers = with maintainers; [ lovek323 wkennington ]; 80 132 }; 81 133 }
+4 -10
pkgs/top-level/all-packages.nix
··· 1097 1097 1098 1098 cudatoolkit = cudatoolkit5; 1099 1099 1100 - curlFull = curl.override { 1101 - idnSupport = true; 1102 - ldapSupport = true; 1103 - gssSupport = true; 1104 - }; 1105 - 1106 - curl = callPackage ../tools/networking/curl rec { 1100 + curl-light = curl.override { suffix = "light"; }; 1101 + curl = curl-full.override { 1107 1102 fetchurl = fetchurlBoot; 1108 - zlibSupport = true; 1109 - sslSupport = zlibSupport; 1110 - scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin; 1103 + suffix = ""; 1111 1104 }; 1105 + curl-full = callPackage ../tools/networking/curl { suffix = "full"; }; 1112 1106 1113 1107 curl3 = callPackage ../tools/networking/curl/7.15.nix rec { 1114 1108 zlibSupport = true;