aboutsummaryrefslogtreecommitdiff
path: root/.github/scripts/install_deps.sh
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /.github/scripts/install_deps.sh
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to '.github/scripts/install_deps.sh')
-rwxr-xr-x.github/scripts/install_deps.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/.github/scripts/install_deps.sh b/.github/scripts/install_deps.sh
new file mode 100755
index 0000000000..9a782e9698
--- /dev/null
+++ b/.github/scripts/install_deps.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+while (($# > 0)); do
+ case $1 in
+ --test) # install test dependencies
+ TEST=1
+ shift
+ ;;
+ esac
+done
+
+os=$(uname -s)
+if [[ $os == Linux ]]; then
+ sudo apt-get update
+ sudo apt-get install -y build-essential cmake curl gettext ninja-build
+
+ if [[ $CC == clang ]]; then
+ DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
+ CLANG_VERSION=17
+ if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
+ echo "Default clang version is $DEFAULT_CLANG_VERSION, which equal or larger than wanted version $CLANG_VERSION. Aborting!"
+ exit 1
+ fi
+
+ wget https://apt.llvm.org/llvm.sh
+ chmod +x llvm.sh
+ sudo ./llvm.sh $CLANG_VERSION
+ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100
+ sudo update-alternatives --set clang /usr/bin/clang-$CLANG_VERSION
+ fi
+
+ if [[ -n $TEST ]]; then
+ sudo apt-get install -y locales-all cpanminus attr libattr1-dev gdb
+ fi
+elif [[ $os == Darwin ]]; then
+ brew update --quiet
+ brew install ninja
+ if [[ -n $TEST ]]; then
+ brew install cpanminus
+ fi
+fi