blob: 5e9ba1af1df6e7d6eca6e1af1e078d9ee8272aad (
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#!/bin/sh
if [ "$(id -u)" -eq 0 ] ; then
echo "Run as a regular user"
exit 1
fi
set -ex
nproc=1
case "$(uname)" in
Darwin|OpenBSD) nproc="$(sysctl -n hw.ncpu)" ;;
Linux) nproc="$(nproc)" ;;
esac
codedir="${CODEDIR:-$HOME/scm}"
nvimdir="${codedir}/nvim"
NVIM_PREFIX="${NVIM_PREFIX:-$HOME/.local}"
# On OpenBSD:
# Workaround for OpenBSD's make being called endlessly...
# #!/bin/sh
# exec gmake "$@"
# Call it `make` and place it in your path before the system make.
# Then:
# pkg_add gmake cmake cargo rust clang-tools-extra
# Also in the environment:
# LIBCLANG_PATH=/usr/local/llvm21/lib
# CARGO_TARGET_DIR=$HOME/.cache/cargo-target-dir # /tmp is usually small...
# Then cargo for tree-sitter-cli...
# cargo install tree-sitter-cli
# Also add ~/.cargo/bin to your path when you're done.
# useful for clangd: `pkg_add bear spdlog`
if ! [ -d "$nvimdir" ] ; then
git clone https://github.com/neovim/neovim "$nvimdir"
fi
_extra_flags=''
# Detectl musl libc and turn off LIBINTL
for _f in /lib/ld-musl*so* ; do
if [ -e "$_f" ] ; then
_extra_flags="-DENABLE_LIBINTL=OFF"
break
fi
done
cd "$nvimdir"
git clean -fdx .
rm -rf build || echo ""
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$NVIM_PREFIX $_extra_flags" -j"$nproc"
make install
cd -
|