aboutsummaryrefslogtreecommitdiff
path: root/compile/nvim.sh
blob: de0c4f8ef98fbc95b8b89575aa9c6429fa0910c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
if [ "$(id -u)" -eq 0 ] ; then
	echo "Run as a regular user"
	exit 1
fi
set -ex
nproc=1
if [ $(uname) = "Darwin" ] ; then
	nproc="$(sysctl -n hw.ncpu)"
elif [ $(uname) = "Linux" ] ; then
	nproc="$(nproc)"
fi
codedir="${CODEDIR:-$HOME/scm}"
nvimdir="${codedir}/nvim"
if ! [ -d "$nvimdir" ] ; then
	git clone https://github.com/neovim/neovim "$nvimdir"
fi
cd "$nvimdir"
git clean -fdx .
rm -rf build || echo ""
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/.local" -j"$nproc"
make install
cd -