Subject: Re: [PATCH] config.mak.uname: use iconv from Homebrew on macOS

From: Torsten Bögershausen <[email-masked]>
Date: Wed, 10 Dec 2025 17:42:56 +0100

On Tue, Dec 09, 2025 at 08:35:34PM +0100, René Scharfe wrote:
> The library function iconv(3) supplied with macOS versions 15.7.2
> (Sequoia) and 26.1 (Tahoe) is unreliable when doing conversions from
> ISO-2022-JP to UTF-8 in multiple steps; t3900 reports this breakage:
> 
>   not ok 17 - ISO-2022-JP should be shown in UTF-8 now
>   not ok 25 - ISO-2022-JP should be shown in UTF-8 now
>   not ok 38 - commit --fixup into ISO-2022-JP from UTF-8
> 
> As a workaround, use libiconv from Homebrew, if available.
> 
> Helped-by: Koji Nakamaru <[email-masked]>
> Signed-off-by: René Scharfe <[email-masked]>
> ---
>  config.mak.uname | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/config.mak.uname b/config.mak.uname
> index 1691c6ae6e..1b305e38c6 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -182,6 +182,13 @@ ifeq ($(uname_S),Darwin)
>          endif
>          endif
>  
> +	ifeq ($(shell test -d /opt/homebrew/opt/libiconv/ && echo y),y)
> +		ICONVDIR ?= /opt/homebrew/opt/libiconv
> +	endif
> +	ifeq ($(shell test -d /usr/local/opt/libiconv/ && echo y),y)
> +		ICONVDIR ?= /usr/local/opt/libiconv
> +	endif
> +
>  	BASIC_LDFLAGS += -framework CoreServices
>  endif
>  ifeq ($(uname_S),SunOS)
> -- 
> 2.52.0
> 

(Probaly a stupid question:) Does libiconv from homebrew provide UTF-8-MAC ?
And does t3910 pass ?

I just realized that I am building against libiconv from mac ports,
since years.
Digging into the Makefile shows that we have a switch:
NO_DARWIN_PORTS
(and another one for FINK)
Does it make sense to have a switch here as well ?