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: fixes for static linking on Darwin #346950

Merged
merged 2 commits into from
Oct 11, 2024
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
8 changes: 7 additions & 1 deletion pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ stdenv.mkDerivation (finalAttrs: {

strictDeps = true;

env = lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic) {
# Not having this causes curl’s `configure` script to fail with static builds on Darwin because
# some of curl’s propagated inputs need libiconv.
NIX_LDFLAGS = "-liconv";
};

nativeBuildInputs = [ pkg-config perl ];

# Zlib and OpenSSL must be propagated because `libcurl.la' contains
Expand Down Expand Up @@ -228,7 +234,7 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [ lovek323 ];
platforms = lib.platforms.all;
# Fails to link against static brotli or gss
broken = stdenv.hostPlatform.isStatic && (brotliSupport || gssSupport || stdenv.hostPlatform.system == "x86_64-darwin");
broken = stdenv.hostPlatform.isStatic && (brotliSupport || gssSupport);
pkgConfigModules = [ "libcurl" ];
mainProgram = "curl";
};
Expand Down