Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl: gate darwin workarounds behind stdenv.isDarwin to make life on linux easier #169331

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ stdenv.mkDerivation rec {
configureFlags = [
# Build without manual
"--disable-manual"
# Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback
# to nss-cacert from the default profile.
# https://github.com/curl/curl/issues/8696 - fallback is not supported by HTTP3
(if http3Support then "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" else "--without-ca-bundle")
"--without-ca-path"
(lib.enableFeature c-aresSupport "ares")
(lib.enableFeature ldapSupport "ldap")
(lib.enableFeature ldapSupport "ldaps")
Expand All @@ -136,6 +131,12 @@ stdenv.mkDerivation rec {
++ lib.optionals stdenv.hostPlatform.isWindows [
"--disable-shared"
"--enable-static"
] ++ lib.optionals stdenv.isDarwin [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to use stdenv.hostPlatform.isDarwin instead to take care of the cross-compiling cases here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback to nss-cacert from the default profile.
# Without this curl might detect /etc/ssl/cert.pem at build time on macOS, causing curl to ignore NIX_SSL_CERT_FILE.
# https://github.com/curl/curl/issues/8696 - fallback is not supported by HTTP3
(if http3Support then "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" else "--without-ca-bundle")
"--without-ca-path"
];

CXX = "${stdenv.cc.targetPrefix}c++";
Expand Down