Skip to content

Commit 6779b85

Browse files
authored
Merge pull request #1592 from ychin/ci-fix-homebrew-custom-package-formula
CI: Fix failure to install Homebrew package in universal-package
2 parents fc3de1b + 175fee2 commit 6779b85

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ runs:
4040
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] = "-arch x86_64 -arch arm64"\n' | \
4141
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] = "-arch x86_64 -arch arm64"\n' >${formula}.rb
4242
43+
# Homebrew requires formula files to be placed in taps and disallows
44+
# installing from raw paths, so we manually create a taps folder for a
45+
# 'macvim-dev/deps' tap.
46+
FORMULA_DIR="$(brew --repository)/Library/Taps/macvim-dev/homebrew-deps/Formula/"
47+
mkdir -p "$FORMULA_DIR"
48+
cp ${formula}.rb "$FORMULA_DIR"
49+
4350
# Uninstall the already installed formula because we want to build our own
4451
brew uninstall --ignore-dependencies ${formula} || true
4552
@@ -74,7 +81,7 @@ runs:
7481
7582
# This will be a no-op if formula was cached. We check if the package
7683
# exists first just to avoid an "already installed" warning.
77-
brew list ${formula} &>/dev/null || brew install --quiet --formula -s ./${formula}.rb
84+
brew list ${formula} &>/dev/null || brew install --quiet --formula -s macvim-dev/deps/${formula}
7885
7986
# If formula was cached, this step is necessary to relink it to brew prefix (e.g. /usr/local)
8087
brew unlink ${formula} && brew link ${formula}

0 commit comments

Comments
 (0)