aboutsummaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
Diffstat (limited to 'installer')
-rwxr-xr-xinstaller/install-clangd.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/installer/install-clangd.sh b/installer/install-clangd.sh
new file mode 100755
index 0000000..0c47461
--- /dev/null
+++ b/installer/install-clangd.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -e
+
+cd $(dirname $0)
+
+server_dir="../servers/clangd"
+[ -d $server_dir ] && rm -rf $server_dir
+mkdir $server_dir && cd $server_dir
+
+os=$(uname -s | tr "[:upper:]" "[:lower:]")
+
+case $os in
+ linux)
+ platform="pc-linux-gnu"
+ ;;
+ darwin)
+ platform="darwin-apple"
+ ;;
+esac
+
+# Check Ubuntu version
+ubuntu_version=$(lsb_release -a 2>&1 | grep 'Release' | awk '{print $2}')
+
+case $ubuntu_version in
+ 14.04|16.04|18.04)
+ platform="linux-gnu-ubuntu-$ubuntu_version"
+ ;;
+esac
+
+filename="clang+llvm-9.0.0-x86_64-$platform"
+url="http://releases.llvm.org/9.0.0/$filename.tar.xz"
+echo "Downloading clangd and LLVM..."
+curl -LO "$url"
+echo "Extracting archive..."
+tar xvf $filename.tar.xz --strip-components=2 $filename/bin/clangd
+rm -fr clang+llvm-9.0.0*
+./clangd --version