|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -o errexit # abort on nonzero exitstatus |
| 4 | +set -o nounset # abort on unbound variable |
| 5 | +set -o pipefail # don't hide errors within pipes |
| 6 | + |
1 | 7 | # Given a cloned idris LSP repo, install the lsp server
|
2 | 8 | # distinguishes between the "old" repo (pre 0.5.1) and the new one
|
3 | 9 |
|
4 | 10 | # Also assumes that PATH and LD_LIBRARY_PATH are set correctly
|
5 | 11 |
|
| 12 | + |
6 | 13 | if [ -z ${IDRIS_LSP_VERSION+x} ]; then
|
7 | 14 | echo "IDRIS LSP VAR IS UNSET!";
|
8 | 15 | exit 1;
|
9 | 16 | else
|
10 | 17 | echo "LSP Version is set to '$IDRIS_LSP_VERSION'";
|
11 | 18 | fi
|
12 | 19 |
|
| 20 | +# Reinstall Idris2 |
| 21 | +# https://github.com/idris-community/idris2-lsp/tree/idris2-0.6.0 |
| 22 | +# I think this is similar across all versions, but I need to test with 0.4.0 and 0.5.1 |
| 23 | +cd /build/idris2-lsp/Idris2 |
| 24 | +make bootstrap SCHEME=scheme PREFIX=/usr/local/lib/idris2 |
| 25 | +make install PREFIX=/usr/local/lib/idris2 |
| 26 | + |
| 27 | +make clean PREFIX=/usr/local/lib/idris2 |
| 28 | +make all PREFIX=/usr/local/lib/idris2 |
| 29 | +make install PREFIX=/usr/local/lib/idris2 |
| 30 | +make install-with-src-libs PREFIX=/usr/local/lib/idris2 |
| 31 | +make install-with-src-api PREFIX=/usr/local/lib/idris2 |
| 32 | + |
13 | 33 | # check if the version is "idris2-0.4.0" or "idris2-0.5.1"
|
14 | 34 | # these are the "older" supported versions, before the idris2-lsp repo was split a reusable LSP-lib
|
15 |
| -if [[ $IDRIS_LSP_VERSION == "idris2-0.4.0" ]] || [[ $IDRIS_LSP_VERSION == "idris2-0.5.1" ]]; then |
| 35 | +if [[ $IDRIS_LSP_VERSION == "idris2-0.4.0" ]] || |
| 36 | + [[ $IDRIS_LSP_VERSION == "idris2-0.5.1" ]] || |
| 37 | + [[ $IDRIS_LSP_VERSION == "idris2-0.6.0" ]]; then |
16 | 38 | echo "Installing older version of idris2-lsp"
|
17 |
| - |
18 |
| - # Manual install of idris2-lsp (no need to rebuild idris) |
| 39 | + |
| 40 | + # Manual install of idris2-lsp |
19 | 41 | cd /build/idris2-lsp
|
20 | 42 | make install PREFIX=/usr/local/lib/idris2
|
21 | 43 | else
|
22 | 44 | # if the idris version is not one of the "old" ones, it is either a newer version (0.6.0 and up) or "latest"d
|
23 | 45 | echo "Installing newer version of idris2-lsp"
|
24 | 46 |
|
25 |
| - # rebuild idris2 |
26 |
| - cd /build/idris2-lsp/Idris2 |
27 |
| - make clean PREFIX=/usr/local/lib/idris2 |
28 |
| - make all PREFIX=/usr/local/lib/idris2 |
29 |
| - make install PREFIX=/usr/local/lib/idris2 |
30 |
| - make install-with-src-libs PREFIX=/usr/local/lib/idris2 |
31 |
| - make install-with-src-api PREFIX=/usr/local/lib/idris2 |
32 |
| - |
33 |
| - |
34 | 47 | # Manually install LSP library and idris2-lsp
|
35 |
| - cd /build/idris2-lsp |
36 |
| - git submodule update --init LSP-lib |
37 | 48 | cd /build/idris2-lsp/LSP-lib
|
38 | 49 | idris2 --install-with-src
|
39 | 50 | cd /build/idris2-lsp
|
|
0 commit comments