From 7fe9eca380accbb669c680008964279205ac5983 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 11 Oct 2024 17:52:53 -0400 Subject: [PATCH] phpExtensions.iconv: fix build on Darwin after the SDK update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHP’s m4 macros assume that the libiconv shared library can be found at the same base path as its headers, but that’s not the case on Darwin. Its libiconv has separate outputs. --- pkgs/top-level/php-packages.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 0e4fc0b6ecae..de8c6ccd5837 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -451,6 +451,9 @@ in { name = "iconv"; buildInputs = [ libiconv ]; configureFlags = [ "--with-iconv" ]; + # Some other extensions support separate libdirs, but iconv does not. This causes problems with detecting + # Darwin’s libiconv because it has separate outputs. Adding `-liconv` works around the issue. + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_LDFLAGS = "-liconv"; }; doCheck = stdenv.hostPlatform.isLinux; } {