forked from mirrors/nixpkgs
curl: cleanup build configuration
This commit is contained in:
parent
1e4864e295
commit
851b12b691
|
@ -1,13 +1,7 @@
|
||||||
{ stdenv, lib, fetchurl, pkg-config, perl
|
{ lib, stdenv, fetchurl, pkg-config, perl
|
||||||
, http2Support ? true, nghttp2
|
, brotliSupport ? false, brotli ? null
|
||||||
, idnSupport ? false, libidn2 ? null
|
, c-aresSupport ? false, c-ares ? null
|
||||||
, ldapSupport ? false, openldap ? null
|
|
||||||
, zlibSupport ? true, zlib ? null
|
|
||||||
, zstdSupport ? false, zstd ? null
|
|
||||||
, opensslSupport ? zlibSupport, openssl ? null
|
|
||||||
, gnutlsSupport ? false, gnutls ? null
|
, gnutlsSupport ? false, gnutls ? null
|
||||||
, wolfsslSupport ? false, wolfssl ? null
|
|
||||||
, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
|
|
||||||
, gsaslSupport ? false, gsasl ? null
|
, gsaslSupport ? false, gsasl ? null
|
||||||
, gssSupport ? with stdenv.hostPlatform; (
|
, gssSupport ? with stdenv.hostPlatform; (
|
||||||
!isWindows &&
|
!isWindows &&
|
||||||
|
@ -19,10 +13,16 @@
|
||||||
# not worth the effort.
|
# not worth the effort.
|
||||||
!(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform))
|
!(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform))
|
||||||
), libkrb5 ? null
|
), libkrb5 ? null
|
||||||
, c-aresSupport ? false, c-ares ? null
|
, http2Support ? true, nghttp2 ? null
|
||||||
, brotliSupport ? false, brotli ? null
|
, idnSupport ? false, libidn2 ? null
|
||||||
, rtmpSupport ? false, rtmpdump ? null
|
, ldapSupport ? false, openldap ? null
|
||||||
|
, opensslSupport ? zlibSupport, openssl ? null
|
||||||
, pslSupport ? false, libpsl ? null
|
, pslSupport ? false, libpsl ? null
|
||||||
|
, rtmpSupport ? false, rtmpdump ? null
|
||||||
|
, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
|
||||||
|
, wolfsslSupport ? false, wolfssl ? null
|
||||||
|
, zlibSupport ? true, zlib ? null
|
||||||
|
, zstdSupport ? false, zstd ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# Note: this package is used for bootstrapping fetchurl, and thus
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
||||||
|
@ -30,24 +30,24 @@
|
||||||
# cgit) that are needed here should be included directly in Nixpkgs as
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
||||||
# files.
|
# files.
|
||||||
|
|
||||||
assert http2Support -> nghttp2 != null;
|
|
||||||
assert idnSupport -> libidn2 != null;
|
|
||||||
assert ldapSupport -> openldap != null;
|
|
||||||
assert zlibSupport -> zlib != null;
|
|
||||||
assert zstdSupport -> zstd != null;
|
|
||||||
assert opensslSupport -> openssl != null;
|
|
||||||
assert !(gnutlsSupport && opensslSupport);
|
assert !(gnutlsSupport && opensslSupport);
|
||||||
assert !(gnutlsSupport && wolfsslSupport);
|
assert !(gnutlsSupport && wolfsslSupport);
|
||||||
assert !(opensslSupport && wolfsslSupport);
|
assert !(opensslSupport && wolfsslSupport);
|
||||||
assert gnutlsSupport -> gnutls != null;
|
|
||||||
assert wolfsslSupport -> wolfssl != null;
|
|
||||||
assert scpSupport -> libssh2 != null;
|
|
||||||
assert c-aresSupport -> c-ares != null;
|
|
||||||
assert brotliSupport -> brotli != null;
|
assert brotliSupport -> brotli != null;
|
||||||
|
assert c-aresSupport -> c-ares != null;
|
||||||
|
assert gnutlsSupport -> gnutls != null;
|
||||||
assert gsaslSupport -> gsasl != null;
|
assert gsaslSupport -> gsasl != null;
|
||||||
assert gssSupport -> libkrb5 != null;
|
assert gssSupport -> libkrb5 != null;
|
||||||
assert rtmpSupport -> rtmpdump !=null;
|
assert http2Support -> nghttp2 != null;
|
||||||
|
assert idnSupport -> libidn2 != null;
|
||||||
|
assert ldapSupport -> openldap != null;
|
||||||
|
assert opensslSupport -> openssl != null;
|
||||||
assert pslSupport -> libpsl !=null;
|
assert pslSupport -> libpsl !=null;
|
||||||
|
assert rtmpSupport -> rtmpdump !=null;
|
||||||
|
assert scpSupport -> libssh2 != null;
|
||||||
|
assert wolfsslSupport -> wolfssl != null;
|
||||||
|
assert zlibSupport -> zlib != null;
|
||||||
|
assert zstdSupport -> zstd != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "curl";
|
pname = "curl";
|
||||||
|
@ -78,21 +78,21 @@ stdenv.mkDerivation rec {
|
||||||
# "-lz -lssl", which aren't necessary direct build inputs of
|
# "-lz -lssl", which aren't necessary direct build inputs of
|
||||||
# applications that use Curl.
|
# applications that use Curl.
|
||||||
propagatedBuildInputs = with lib;
|
propagatedBuildInputs = with lib;
|
||||||
|
optional brotliSupport brotli ++
|
||||||
|
optional c-aresSupport c-ares ++
|
||||||
|
optional gnutlsSupport gnutls ++
|
||||||
|
optional gsaslSupport gsasl ++
|
||||||
|
optional gssSupport libkrb5 ++
|
||||||
optional http2Support nghttp2 ++
|
optional http2Support nghttp2 ++
|
||||||
optional idnSupport libidn2 ++
|
optional idnSupport libidn2 ++
|
||||||
optional ldapSupport openldap ++
|
optional ldapSupport openldap ++
|
||||||
optional zlibSupport zlib ++
|
|
||||||
optional zstdSupport zstd ++
|
|
||||||
optional gsaslSupport gsasl ++
|
|
||||||
optional gssSupport libkrb5 ++
|
|
||||||
optional c-aresSupport c-ares ++
|
|
||||||
optional opensslSupport openssl ++
|
optional opensslSupport openssl ++
|
||||||
optional gnutlsSupport gnutls ++
|
optional pslSupport libpsl ++
|
||||||
optional wolfsslSupport wolfssl ++
|
|
||||||
optional scpSupport libssh2 ++
|
|
||||||
optional brotliSupport brotli ++
|
|
||||||
optional rtmpSupport rtmpdump ++
|
optional rtmpSupport rtmpdump ++
|
||||||
optional pslSupport libpsl;
|
optional scpSupport libssh2 ++
|
||||||
|
optional wolfsslSupport wolfssl ++
|
||||||
|
optional zlibSupport zlib ++
|
||||||
|
optional zstdSupport zstd;
|
||||||
|
|
||||||
# for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html
|
# for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
@ -101,25 +101,26 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
|
# Build without manual
|
||||||
|
"--disable-manual"
|
||||||
# Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback
|
# Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback
|
||||||
# to nss-cacert from the default profile.
|
# to nss-cacert from the default profile.
|
||||||
"--without-ca-bundle"
|
"--without-ca-bundle"
|
||||||
"--without-ca-path"
|
"--without-ca-path"
|
||||||
# The build fails when using wolfssl with --with-ca-fallback
|
(lib.enableFeature c-aresSupport "ares")
|
||||||
(lib.withFeature (!wolfsslSupport) "ca-fallback")
|
|
||||||
"--disable-manual"
|
|
||||||
(lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl))
|
|
||||||
(lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls))
|
|
||||||
(lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2))
|
|
||||||
(lib.enableFeature ldapSupport "ldap")
|
(lib.enableFeature ldapSupport "ldap")
|
||||||
(lib.enableFeature ldapSupport "ldaps")
|
(lib.enableFeature ldapSupport "ldaps")
|
||||||
(lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2))
|
# The build fails when using wolfssl with --with-ca-fallback
|
||||||
(lib.withFeature zstdSupport "zstd")
|
(lib.withFeature (!wolfsslSupport) "ca-fallback")
|
||||||
(lib.withFeature brotliSupport "brotli")
|
|
||||||
(lib.withFeature rtmpSupport "librtmp")
|
(lib.withFeature rtmpSupport "librtmp")
|
||||||
|
(lib.withFeature zstdSupport "zstd")
|
||||||
|
(lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli))
|
||||||
|
(lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls))
|
||||||
|
(lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2))
|
||||||
|
(lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl))
|
||||||
|
(lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2))
|
||||||
|
(lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl))
|
||||||
]
|
]
|
||||||
++ lib.optional wolfsslSupport "--with-wolfssl=${lib.getDev wolfssl}"
|
|
||||||
++ lib.optional c-aresSupport "--enable-ares=${c-ares}"
|
|
||||||
++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}"
|
++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}"
|
||||||
# For the 'urandom', maybe it should be a cross-system option
|
# For the 'urandom', maybe it should be a cross-system option
|
||||||
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
|
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
|
||||||
|
|
Loading…
Reference in a new issue