]> granicus.if.org Git - graphviz/commitdiff
Add support for macOS to ci/install.sh
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 20 Oct 2020 13:51:12 +0000 (15:51 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 24 Oct 2020 05:46:24 +0000 (07:46 +0200)
ci/install-packages.sh

index c85a5295cbf57995863fb0a30f94e50fac94776d..839f2d29bebe5fca644639efddfd1817fadfaa77 100755 (executable)
@@ -5,6 +5,9 @@ set -x
 if test -f /etc/os-release; then
     cat /etc/os-release
     . /etc/os-release
+elif [ "$( uname -s )" = "Darwin" ]; then
+    ID=$( uname -s )
+    VERSION_ID=$( uname -r )
 else
     cat /etc/redhat-release
     ID=$( cat /etc/redhat-release | cut -d' ' -f1 | tr 'A-Z' 'a-z' )
@@ -18,6 +21,9 @@ ARCH=$( uname -m )
 if [ "${build_system}" = "cmake" ]; then
     if [ "${ID_LIKE}" = "debian" ]; then
         apt install ./${DIR}/os/${ARCH}/Graphviz-${GV_VERSION}-Linux.deb
+    elif [ "${ID}" = "Darwin" ]; then
+        unzip ${DIR}/os/${ARCH}/Graphviz-${GV_VERSION}-Darwin.zip
+        cp -rp Graphviz-${GV_VERSION}-Darwin/* /usr/local
     else
         rpm --install --force ${DIR}/os/${ARCH}/Graphviz-${GV_VERSION}-Linux.rpm
     fi
@@ -26,6 +32,9 @@ else
         apt install ./${DIR}/os/${ARCH}/libgraphviz4_${GV_VERSION}-1_amd64.deb
         apt install ./${DIR}/os/${ARCH}/libgraphviz-dev_${GV_VERSION}-1_amd64.deb
         apt install ./${DIR}/os/${ARCH}/graphviz_${GV_VERSION}-1_amd64.deb
+    elif [ "${ID}" = "Darwin" ]; then
+        tar xf ${DIR}/os/${ARCH}/graphviz-${GV_VERSION}-${ARCH}.tar.gz
+        cp -rp build/* /usr/local
     else
         rpm --install --force \
             ${DIR}/os/${ARCH}/graphviz-${GV_VERSION}*.rpm \