From: Junio C Hamano Date: Sun, 14 Dec 2025 23:19:57 GMT Subject: Re: [PATCH v2 1/2] Makefile: add NO_HOMEBREW Message-ID: In-Reply-To: <435e4190-6c46-4404-b769-234f704f608a@web.de> René Scharfe writes: > Sounds useful, but before this can become a documented feature it > deserves more research and refinement. The current code uses what it > can find in an ad-hoc manner, and the patches just extend this behavior > to libiconv. A user-settable HOMEBREW_PREFIX would require a more > principled approach, so that overriding it affects the search for > gettext and libiconv. Oh, that is so true (but the specifics in macOS details is a bit beyond my depth :/). > I guess that would look like this in config.mak.uname: > > ifeq ($(uname_S),Darwin) > ifeq ($(uname_M),arm64) > HOMEBREW_PREFIX = /opt/homebrew > else > HOMEBREW_PREFIX = /usr/local > endif > USE_HOMEBREW_GETTEXT = IfAvailable > USE_HOMEBREW_MSGFMT = IfAvailable > USE_HOMEBREW_LIBICONV = IfAvailable > endif > > ... and in Makefile: > > ifndef NO_HOMEBREW > ifdef HOMEBREW_PREFIX > ifdef USE_HOMEBREW_GETTEXT > # magic! > endif > ifdef USE_HOMEBREW_MSGFMT > # more magic! > endif > ifdef USE_HOMEBREW_LIBICONV > ifeq ($(shell test -d $(HOMEBREW_PREFIX)/opt/libiconv && echo y),y) > ICONVDIR ?= $(HOMEBREW_PREFIX)/opt/libiconv > endif > endif > endif > > Perhaps the magic parts just need to check for the existence of > $(HOMEBREW_PREFIX)/opt/gettext and use that, but the current code is > more complicated for some reason. > > René