neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

install_deps.sh (1782B)


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