-
-
Save darcyparker/153124662b05c679c417 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash | |
#Build and install neovim for Debian | |
#See: https://neovim.io/ | |
#See: https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start | |
#See: https://gist.github.com/darcyparker/153124662b05c679c417 | |
#Save current dir | |
pushd . > /dev/null || exit | |
#Install dependencies | |
sudo apt-get update | |
sudo apt-get install -y \ | |
autoconf \ | |
automake \ | |
cmake \ | |
g++ \ | |
gettext \ | |
libncurses5-dev \ | |
libtool \ | |
libtool-bin \ | |
libunibilium-dev \ | |
libunibilium4 \ | |
ninja-build \ | |
pkg-config \ | |
python3-pip \ | |
software-properties-common \ | |
unzip | |
# Enable use of python plugins | |
# Note: python neovim module was renamed to pynvim | |
# https://github.com/neovim/neovim/wiki/Following-HEAD#steps-to-update-pynvim-formerly-neovim-python-package | |
# pip3 uninstall pynvim neovim | |
pip3 install setuptools | |
pip3 install --upgrade pynvim | |
gem install neovim | |
npm install -g neovim | |
#Get or update neovim github repo | |
mkdir -p ~/src | |
cd ~/src || exit | |
if [ ! -e ~/src/neovim ]; then | |
git clone https://github.com/neovim/neovim | |
else | |
cd neovim || exit | |
git pull origin | |
fi | |
cd ~/src/neovim || exit | |
git checkout master | |
#Remove old build dir and .deps dir | |
rm -rf build/ | |
rm -rf .deps/ | |
make distclean | |
# Build and install neovim | |
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr/local/" | |
make install | |
# Enable use of ruby plugins | |
# sudo gem install neovim | |
#Restore dir | |
popd > /dev/null || exit | |
echo "nvim command: $(command -v nvim)" | |
echo "nvim command: $(ls -al "$(command -v nvim)")" |
In line 65 , it is better change
make install
to
sudo make install
@marcuslannister - I disagree... See comment https://gist.github.com/darcyparker/153124662b05c679c417?permalink_comment_id=3080477#gistcomment-3080477 above. If you want to live dangerously and do sudo make install
with MAKE_INSTALL_PREFIX=/usr/local/"
, go ahead... but I never sudo make install
to /usr/local
.
@marcuslannister - I disagree... See comment https://gist.github.com/darcyparker/153124662b05c679c417?permalink_comment_id=3080477#gistcomment-3080477 above. If you want to live dangerously and do
sudo make install
withMAKE_INSTALL_PREFIX=/usr/local/"
, go ahead... but I neversudo make install
to/usr/local
.
Ok, I got it. Thanks.
As of march 2023, neovim (0.9.0 pre-release) needs ibvterm-dev from experimental (0.3.1-1). Fortunately, this is available in experimental. Also, we use ninja as the build back end. So the above method of making Debian package is not current.
Of course, you can probably build it using upstream source combined with debian/* files in the latest Debian package. But I am making deb package using CMAKE (CPACK). under Debian testing (bookworm).
See https://osamuaoki.github.io/en/2023/03/05/vim-learn-7/#get-latest-neovim
Just a big thank you @osamuaoki !
@darcyparker Oh, got it. Thanks!!