Skip to content

Commit

Permalink
Merge pull request #906 from qw-ctf/homebrewfix
Browse files Browse the repository at this point in the history
CI: Workaround for build-dep conflicts on macOS.
  • Loading branch information
tcsabina authored Mar 10, 2024
2 parents 5cd08a3 + b6742f3 commit 400936d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/scripts/homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ dependencies=(
sdl2_mixer
)

function cleanup_python() {
# Workaround for sdl2_mixer, installs a new Python version
# that fails to clean up state of the old one.
rm -rf \
/usr/local/bin/{2to3*,idle3*,pydoc3*,python3*} \
/usr/local/share/man/man1/python3* \
/usr/local/lib/pkgconfig/python3* \
/usr/local/Frameworks/Python.framework
}

function install_arm64() {
export CPU="arm64"
Expand All @@ -41,6 +50,8 @@ function install_arm64() {
export HOMEBREW_NO_INSTALL_CLEANUP="true"
export HOMEBREW_DIR="/Users/runner/Library/Caches/Homebrew/downloads"

cleanup_python

brew reinstall --quiet pkg-config
brew fetch --force --bottle-tag=arm64_sonoma "${dependencies[@]}"

Expand All @@ -52,7 +63,11 @@ function install_arm64() {

function install_intel() {
export CPU="x86_64"
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK="true"
export HOMEBREW_NO_INSTALL_CLEANUP="true"

cleanup_python

brew reinstall --quiet pkg-config
brew install --quiet "${dependencies[@]}"
}
Expand Down

0 comments on commit 400936d

Please sign in to comment.