]> granicus.if.org Git - graphviz/commitdiff
CI: move macOS dependency installation out of line
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 11 Mar 2022 14:49:26 +0000 (06:49 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Mar 2022 20:30:01 +0000 (13:30 -0700)
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
ci/install-build-dependencies-macos.sh [new file with mode: 0644]
ci/install-runtime-dependencies-macos.sh [new file with mode: 0644]

index 06d6b8c6c20877cef4b1650b1c39f1f2b307e732..6bdd32e69e49074abfd8fb6b11a2d5105a3a5dc5 100644 (file)
@@ -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 (file)
index 0000000..1da07d2
--- /dev/null
@@ -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 (file)
index 0000000..1c8962f
--- /dev/null
@@ -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