Re: [PATCH v2 1/2] Makefile: add NO_HOMEBREW
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 14, 2025, 23:19 UTC
- Message-ID
- <xmqq1pkwabxe.fsf@gitster.g>
- In-Reply-To
- <435e4190-6c46-4404-b769-234f704f608a@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 6 quoted lines
> 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 :/).
Show 35 quoted lines
> 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é