From d10a9d5cc7b7fc4f17e45c98f4c59c1184cb11b9 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 17 May 2024 09:48:57 +0200 Subject: [PATCH] CI macOS: install only not installed brew formulas The GitHub actions now complain if trying to install a formula, that is already installed, eg: ``` run macOS (macos-14) pkg-config 0.29.2_3 is already installed and up-to-date. To reinstall 0.29.2_3, run: brew reinstall pkg-config ``` As a workaround, install just the formulas, that are not already installed. --- .github/scripts/macOS/prepare.sh | 44 +++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/.github/scripts/macOS/prepare.sh b/.github/scripts/macOS/prepare.sh index 31e759ea6..e4d1a6ebe 100755 --- a/.github/scripts/macOS/prepare.sh +++ b/.github/scripts/macOS/prepare.sh @@ -30,16 +30,42 @@ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> "$GITHUB_ENV" echo "/usr/local/opt/qt/bin" >> "$GITHUB_PATH" echo "DYLIBBUNDLER_FLAGS=$DYLIBBUNDLER_FLAGS" >> "$GITHUB_ENV" -brew install autoconf automake libtool pkg-config \ - asciidoctor -brew install libsoxr speexdsp -brew install ffmpeg portaudio sdl2 sdl2_mixer sdl2_ttf -brew install molten-vk vulkan-headers -brew install imagemagick libcaca libnatpmp jack opencv wolfssl -brew install ossp-uuid # for cineform -brew install qt -brew install glm +set -- \ + asciidoctor \ + autoconf \ + automake \ + ffmpeg \ + glm \ + imagemagick \ + jack \ + libcaca \ + libnatpmp \ + libsoxr \ + libtool \ + molten-vk \ + opencv \ + ossp-uuid `#for cineform` \ + pkg-config \ + portaudio \ + qt \ + sdl2 \ + sdl2_mixer \ + sdl2_ttf \ + speexdsp \ + vulkan-headers \ + wolfssl \ +# shellcheck disable=SC2034 +for n in $(seq $#); do + # if not installed, add on the back of positional parameters + if ! brew list "$1" >/dev/null; then + set -- "$@" "$1" + fi + shift # remove from the front +done + +brew install "$@" + mkdir $TEMP_INST cd $TEMP_INST