Debian Codegraph @

ci/install-packages.sh

raw
1 #!/usr/bin/env bash
2
3 if [ -z ${CI+x} ]; then
4 echo "this script is only intended to run in CI" >&2
5 exit 1
6 fi
7
8 set -e
9 set -o pipefail
10 set -u
11 set -x
12
13 if [ -f /etc/os-release ]; then
14 cat /etc/os-release
15 . /etc/os-release
16 else
17 ID=$( uname -s )
18 # remove trailing text after actual version
19 VERSION_ID=$( uname -r | sed "s/\([0-9\.]*\).*/\1/")
20 fi
21
22 if [[ ${ID} == msys* ]]; then
23 # MSYS2/MinGW doesn't have VERSION_ID in /etc/os-release
24 VERSION_ID=$( uname -r )
25 fi
26
27 GV_VERSION=$(python3 gen_version.py)
28 if [ "${CI_JOB_NAME}" = "lint_python" ]; then
29 DIR=Packages/ubuntu-24.04-build
30 elif [ "${CI_JOB_NAME}" = "ubuntu-24.04-cmake-ASan-build-and-test-including-ctest" ]; then
31 DIR=Packages/ubuntu-24.04-cmake-ASan-build-and-test-including-ctest
32 else
33 DIR=Packages/${CI_JOB_NAME%-test}-build
34 fi
35 ARCH=$( uname -m )
36
37 if [ "${build_system}" = "cmake" ]; then
38 if [ "${ID_LIKE:-}" = "debian" ]; then
39 apt install ./${DIR}/${ID}_${VERSION_ID}_graphviz-${GV_VERSION}-cmake.deb
40 elif [ "${ID}" = "Darwin" ]; then
41 unzip ${DIR}/${ID}_${VERSION_ID}_Graphviz-${GV_VERSION}-Darwin.zip
42 sudo cp -rp Graphviz-${GV_VERSION}-Darwin/* /usr/local
43 else
44 rpm --install --force -vv ${DIR}/${ID}_${VERSION_ID}_graphviz-${GV_VERSION}-cmake.rpm
45 fi
46 else
47 if [ "${ID_LIKE:-}" = "debian" ]; then
48 tar xf ${DIR}/${ID}_${VERSION_ID}_graphviz-${GV_VERSION}-debs.tar.xz
49 apt install ./libgraphviz4_${GV_VERSION}-1_amd64.deb
50 apt install ./libgraphviz-dev_${GV_VERSION}-1_amd64.deb
51 apt install ./graphviz_${GV_VERSION}-1_amd64.deb
52 apt install ./libgv-python_${GV_VERSION}-1_amd64.deb
53 apt install ./libgv-ruby_${GV_VERSION}-1_amd64.deb
54 apt install ./libgv-tcl_${GV_VERSION}-1_amd64.deb
55 elif [ "${ID}" = "Darwin" ]; then
56 sudo installer -verbose -target / -pkg ${DIR}/${ID}_${VERSION_ID}_graphviz-${GV_VERSION}-${ARCH}.pkg
57 else
58 tar xvf ${DIR}/${ID}_${VERSION_ID}_graphviz-${GV_VERSION}-rpms.tar.xz
59 rpm --install --force -vv graphviz-*${GV_VERSION}*.rpm
60 fi
61 fi