Skip to content

Commit 9cd1bd0

Browse files
committed
Add proper flags to have gettext use the proper libiconv
1 parent b4d1be3 commit 9cd1bd0

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/actions/universal-package/action.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,24 @@ runs:
3535
# version and stomp what we have here.
3636
brew update
3737
38-
# Patch the official Homebrew formula to explicitly build for min deployment target and a universal binary. We
39-
# also need to explicitly use system Clang because Homebrew's bundled clang script tries to inject -march
40-
# compiler flags that will cause universal builds to fail as Clang does not like that.
41-
brew cat ${formula} | \
42-
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "'${MACOSX_DEPLOYMENT_TARGET}$'"\n' | \
43-
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CC"] = "/usr/bin/clang"\n' | \
44-
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] = "-arch x86_64 -arch arm64"\n' | \
45-
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] = "-arch x86_64 -arch arm64"\n' >${formula}.rb
38+
brew cat ${formula} >${formula}.rb
4639
4740
if [[ "${{ inputs.gnuiconv }}" == "true" ]]; then
4841
# We also manually depend on GNU libiconv as Apple iconv is broken since macOS 14. This is necessary as MacVim
4942
# itself it built against it and we need both to match.
5043
sed -i.bak '/^[[:blank:]]*def install$/i\'$'\n depends_on "libiconv"\n' ${formula}.rb
44+
sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] += " -I'$(brew --prefix)$'/opt/libiconv/lib"\n' ${formula}.rb
45+
sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] += " -L'$(brew --prefix)$'/opt/libiconv/lib"\n' ${formula}.rb
5146
fi
5247
48+
# Patch the official Homebrew formula to explicitly build for min deployment target and a universal binary. We
49+
# also need to explicitly use system Clang because Homebrew's bundled clang script tries to inject -march
50+
# compiler flags that will cause universal builds to fail as Clang does not like that.
51+
sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "'${MACOSX_DEPLOYMENT_TARGET}$'"\n' ${formula}.rb
52+
sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["CC"] = "/usr/bin/clang"\n' ${formula}.rb
53+
sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] = "-arch x86_64 -arch arm64"\n' ${formula}.rb
54+
sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] = "-arch x86_64 -arch arm64"\n' ${formula}.rb
55+
5356
# Homebrew requires formula files to be placed in taps and disallows
5457
# installing from raw paths, so we manually create a taps folder for a
5558
# 'macvim-dev/deps' tap.

0 commit comments

Comments
 (0)