Skip to content

Commit

Permalink
curl: link libiconv in static builds on Darwin
Browse files Browse the repository at this point in the history
Some of curl’s dependencies require libiconv, but the `configure` script
is not including `-liconv` in the linker flags when checking for those
dependencies in static builds. That causes the check to fail and
prevents curl from building statically on Darwin.
  • Loading branch information
reckenrode committed Oct 10, 2024
1 parent 2ab1817 commit fbf56c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 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

0 comments on commit fbf56c1

Please sign in to comment.