git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 1/1] MacOs/brew: Let the build find gettext headers/libraries/msgfmt

From
tboegi@web.de <tboegi@web.de>
Date
Apr 26, 2020, 20:09 UTC
Message-ID
<20200426200932.3769-1-tboegi@web.de>
In-Reply-To
<pull.616.v2.git.1587819266388.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

Apparently a recent Homebrew update now installs `gettext` into the subdirectory /usr/local/opt/gettext/[lib/include].

Sometimes the ci job succeeds:
 brew link --force gettext
 Linking /usr/local/Cellar/gettext/0.20.1... 179 symlinks created
And sometimes installing the package "gettext" with force-link fails:
 brew link --force gettext
 Warning: Refusing to link macOS provided/shadowed software: gettext
 If you need to have gettext first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
(And the is not the final word either, since MacOs itself says:
 The default interactive shell is now zsh.)

Anyway, The latter requires CFLAGS to include /usr/local/opt/gettext/include and LDFLAGS to include /usr/local/opt/gettext/lib.

Likewise, the `msgfmt` tool is no longer in the `PATH`.

While it is unclear which change is responsible for this breakage (that most notably only occurs on CI build agents that updated very recently), https://github.com/Homebrew/homebrew-core/pull/53489 has fixed it.

Nevertheless, let's work around this issue, as there are still quite a few build agents out there that need some help in this regard: we explicitly do not call `brew update` in our CI/PR builds anymore.

Helped-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 Changes since V2:
   Updated the commit message
config.mak.uname | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/config.mak.uname b/config.mak.uname
index 0ab8e00938..1ea16e8928 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -133,8 +133,17 @@ ifeq ($(uname_S),Darwin)
 	HAVE_BSD_SYSCTL = YesPlease
 	FREAD_READS_DIRECTORIES = UnfortunatelyYes
 	HAVE_NS_GET_EXECUTABLE_PATH = YesPlease
-	BASIC_CFLAGS += -I/usr/local/include
-	BASIC_LDFLAGS += -L/usr/local/lib
+
+	# Workaround for `gettext` being keg-only and not even being linked via
+	# `brew link --force gettext`, should be obsolete as of
+	# https://github.com/Homebrew/homebrew-core/pull/53489
+	ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
+		BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include
+		BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
+		ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
+			MSGFMT = /usr/local/opt/gettext/bin/msgfmt
+		endif
+	endif
 endif
 ifeq ($(uname_S),SunOS)
 	NEEDS_SOCKET = YesPlease
--
2.26.1.107.gefe3874640
Previous: Carlo Marcelo Arenas Belón
Message 12 of 12 in “macos: do let the build find the gettext headers/libraries/msgfmt”
  1. macos: do let the build find the gettext headers/libraries/msgfmtJohannes Schindelin via GitGitGadget, Apr 23, 2020
  2. Eric SunshineApr 23, 2020
  3. Eric SunshineApr 23, 2020
  4. Johannes SchindelinApr 25, 2020
  5. Carlo ArenasApr 26, 2020
  6. Johannes SchindelinApr 26, 2020
  7. macos: do not assume brew and gettext are always available/wantedCarlo Marcelo Arenas Belón, Apr 25, 2020
  8. Johannes SchindelinApr 25, 2020
  9. macos: do let the build find the gettext headers/libraries/msgfmtJohannes Schindelin via GitGitGadget, Apr 25, 2020
  10. Torsten BögershausenApr 26, 2020
  11. Carlo Marcelo Arenas BelónApr 26, 2020
  12. 1/1 MacOs/brew: Let the build find gettext headers/libraries/msgfmttboegi@web.de, Apr 26, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.