curl: fixes for static linking on Darwin (#346950)

This commit is contained in:
Emily 2024-10-11 01:18:26 +01:00 committed by GitHub
commit 2ecae25333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,6 +82,12 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
env = lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic) {
# Not having this causes curls `configure` script to fail with static builds on Darwin because
# some of curls propagated inputs need libiconv.
NIX_LDFLAGS = "-liconv";
};
nativeBuildInputs = [ pkg-config perl ];
# Zlib and OpenSSL must be propagated because `libcurl.la' contains
@ -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";
};