robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa1d8a2702
master
1#!/bin/bash 2set -e 3 4while (( $ # > 0)) ;do 5case $ 1 in 6 --test)# install test dependencies 7TEST =1 8shift 9 ;; 10esac 11done 12 13OS =$( uname -s ) 14ARCH =$( uname -m ) 15if [[$ OS == Linux ]];then 16sudo apt-get update 17sudo apt-get install-y build-essential cmake curl gettext ninja-build 18 19if [[$ CC == clang ]];then 20DEFAULT_CLANG_VERSION =$( echo | clang -dM -E - | grep __clang_major | awk '{print $3}' ) 21CLANG_VERSION =21 22if (( DEFAULT_CLANG_VERSION >= CLANG_VERSION )) ;then 23echo "Default clang version is $ DEFAULT_CLANG_VERSION , which is equal or larger than wanted version $ CLANG_VERSION . Aborting!" 24exit 1 25fi 26 27wget https://apt.llvm.org/llvm.sh 28chmod +x llvm.sh 29sudo ./llvm.sh$ CLANG_VERSION 30# Alternatively could use `./llvm.sh … all` above, but that is heavy/slow. 31sudo apt-get install-y clang-tidy-$ CLANG_VERSION 32sudo update-alternatives--install /usr/bin/clang clang /usr/bin/clang-$ CLANG_VERSION 100 33sudo update-alternatives--set clang /usr/bin/clang-$ CLANG_VERSION 34sudo update-alternatives--install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$ CLANG_VERSION 100 35sudo update-alternatives--set clang-tidy /usr/bin/clang-tidy-$ CLANG_VERSION 36fi 37 38if [[ -n$ TEST ]];then 39sudo apt-get install-y locales-all cpanminus attr libattr1-dev fish gdb inotify-tools xdg-utils 40 41# Use default CC to avoid compilation problems when installing Python modules 42CC =ccpython3 -m pip-q install--user --upgrade --break-system-packages pynvim 43 44# Skip installing npm on aarch64 as it tends to cause intermittent segmentation faults. 45# See https://github.com/neovim/neovim/issues/32339. 46if [[$ ARCH != aarch64 ]];then 47npm install-g neovim 48npm link neovim 49fi 50fi 51elif [[$ OS == Darwin ]];then 52if [[ -n$ TEST ]];then 53brew untap aws/tap 54brew install cpanminus fish fswatch 55 56npm install-g neovim 57npm link neovim 58 59# Use default CC to avoid compilation problems when installing Python modules 60CC =ccpython3 -m pip-q install--user --upgrade --break-system-packages pynvim 61fi 62fi