From: René Scharfe Date: Sat, 13 Dec 2025 18:42:42 GMT Subject: [PATCH v2 2/2] config.mak.uname: use iconv from Homebrew on macOS Message-ID: <5153f701-cc22-4b36-9f88-7187809cbeb8@web.de> In-Reply-To: <53690064-1c98-40e9-8b9a-7ba6bee63703@web.de> 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. Search it in its default locations: /opt/homebrew for Apple Silicon and /usr/local for macOS Intel, with the former taking precedence. Respect ICONVDIR if already set by the user, though. Helped-by: Koji Nakamaru Signed-off-by: René Scharfe --- Makefile | 3 +++ config.mak.uname | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index dbd2760d18..80af832529 100644 --- a/Makefile +++ b/Makefile @@ -1707,6 +1707,9 @@ ifndef NO_HOMEBREW ifdef HOMEBREW_MSGFMT MSGFMT = $(HOMEBREW_MSGFMT) endif + ifdef HOMEBREW_ICONVDIR + ICONVDIR ?= $(HOMEBREW_ICONVDIR) + endif endif ifdef NO_LIBGEN_H diff --git a/config.mak.uname b/config.mak.uname index a6521575ee..a926943141 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -172,6 +172,13 @@ ifeq ($(uname_S),Darwin) endif endif + ifeq ($(shell test -d /usr/local/opt/libiconv/ && echo y),y) + HOMEBREW_ICONVDIR = /usr/local/opt/libiconv + endif + ifeq ($(shell test -d /opt/homebrew/opt/libiconv/ && echo y),y) + HOMEBREW_ICONVDIR = /opt/homebrew/opt/libiconv + endif + # The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require # Unix domain sockets and PThreads. ifndef NO_PTHREADS -- 2.52.0