From edf8541adf31d6d7be401119327d1eacc3cca911 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 11 Mar 2022 06:49:26 -0800 Subject: [PATCH] CI: move macOS dependency installation out of line Makes these a little easier to manage. Note that this also unifies the runtime dependencies installed in Autotools and CMake jobs which simplifies ongoing maintenance. --- .gitlab-ci.yml | 27 ++----------- ci/install-build-dependencies-macos.sh | 49 ++++++++++++++++++++++++ ci/install-runtime-dependencies-macos.sh | 15 ++++++++ 3 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 ci/install-build-dependencies-macos.sh create mode 100644 ci/install-runtime-dependencies-macos.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06d6b8c6c..6bdd32e69 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,19 +78,7 @@ portable-source: stage: build needs: [] # FIXME: remove when building from portable source script: - - brew update - - brew install autogen || brew upgrade autogen - - brew install automake || brew upgrade automake - - brew install cmake || brew upgrade cmake - - brew install bison || brew upgrade bison - - export PATH="/usr/local/opt/bison/bin:$PATH" - - brew install pango || brew upgrade pango - - brew install qt5 || brew upgrade qt5 - - export PATH="/usr/local/opt/qt@5/bin:$PATH" - - export LDFLAGS="-L/usr/local/opt/qt@5/lib" - - export CPPFLAGS="-I/usr/local/opt/qt@5/include" - - export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" - - brew install libxaw || brew upgrade libxaw + - source ci/install-build-dependencies-macos.sh - logfile=`mktemp` - ci/build.sh 2>&1 | tee $logfile - echo "$CI_JOB_NAME-warnings `grep -c 'warning:' $logfile`" | tee metrics.txt @@ -1139,14 +1127,7 @@ fedora35-test: macos-autotools-test: <<: *test_definition before_script: - - brew update - - brew install pango || brew upgrade pango - - brew install qt5 || brew upgrade qt5 - - export PATH="/usr/local/opt/qt@5/bin:$PATH" - - export LDFLAGS="-L/usr/local/opt/qt@5/lib" - - export CPPFLAGS="-I/usr/local/opt/qt@5/include" - - export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" - - brew install libxaw || brew upgrade libxaw + - source ci/install-runtime-dependencies-macos.sh - python3 -m pip install --requirement requirements.txt - export build_system="autotools" needs: @@ -1253,9 +1234,7 @@ centos7-cmake-test: macos-cmake-test: <<: *test_definition before_script: - - brew update - - brew install pango || brew upgrade pango - - brew install libxaw || brew upgrade libxaw + - source ci/install-runtime-dependencies-macos.sh - python3 -m pip install --requirement requirements.txt - export build_system="cmake" - python3 gen_version.py --output GRAPHVIZ_VERSION diff --git a/ci/install-build-dependencies-macos.sh b/ci/install-build-dependencies-macos.sh new file mode 100644 index 000000000..1da07d2cf --- /dev/null +++ b/ci/install-build-dependencies-macos.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u +set -x + +brew update +brew install autogen || brew upgrade autogen +brew install automake || brew upgrade automake +brew install cmake || brew upgrade cmake +brew install bison || brew upgrade bison + +# quoting Homebrew: +# +# bison is keg-only, which means it was not symlinked into /usr/local, +# because macOS already provides this software and installing another version +# in parallel can cause all kinds of trouble. +# +# If you need to have bison first in your PATH, run: +# echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.zshrc +# +# For compilers to find bison you may need to set: +# export LDFLAGS="-L/usr/local/opt/bison/lib" +export PATH="/usr/local/opt/bison/bin:$PATH" + +brew install pango || brew upgrade pango +brew install qt5 || brew upgrade qt5 + +# quoting Homebrew: +# +# qt@5 is keg-only, which means it was not symlinked into /usr/local, +# because this is an alternate version of another formula. +# +# If you need to have qt@5 first in your PATH, run: +# echo 'export PATH="/usr/local/opt/qt@5/bin:$PATH"' >> ~/.zshrc +# +# For compilers to find qt@5 you may need to set: +# export LDFLAGS="-L/usr/local/opt/qt@5/lib" +# export CPPFLAGS="-I/usr/local/opt/qt@5/include" +# +# For pkg-config to find qt@5 you may need to set: +# export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" +export PATH="/usr/local/opt/qt@5/bin:$PATH" +export LDFLAGS="-L/usr/local/opt/qt@5/lib" +export CPPFLAGS="-I/usr/local/opt/qt@5/include" +export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" + +brew install libxaw || brew upgrade libxaw diff --git a/ci/install-runtime-dependencies-macos.sh b/ci/install-runtime-dependencies-macos.sh new file mode 100644 index 000000000..1c8962f19 --- /dev/null +++ b/ci/install-runtime-dependencies-macos.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u +set -x + +brew update +brew install pango || brew upgrade pango +brew install qt5 || brew upgrade qt5 +export PATH="/usr/local/opt/qt@5/bin:$PATH" +export LDFLAGS="-L/usr/local/opt/qt@5/lib" +export CPPFLAGS="-I/usr/local/opt/qt@5/include" +export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig" +brew install libxaw || brew upgrade libxaw -- 2.40.0