void-packages/srcpkgs/neovim/template

86 lines
3.5 KiB
Bash

# Template file for 'neovim'
pkgname=neovim
version=0.10.1
revision=2
# as per https://github.com/neovim/neovim/blob/master/cmake.deps/deps.txt
_treesitter_c_version=0.21.3
_treesitter_lua_version=0.1.0
_treesitter_vim_version=0.4.0
_treesitter_vimdoc_version=3.0.0
_treesitter_query_version=0.4.0
_treesitter_markdown_version=0.2.3
build_style=cmake
build_helper="qemu"
configure_args="-DCOMPILE_LUA=OFF -DPREFER_LUA=$(vopt_if luajit OFF ON)"
hostmakedepends="gettext patchelf"
makedepends="libuv-devel libvterm-devel msgpack-devel
libluv-devel tree-sitter-devel unibilium-devel
lua51-lpeg $(vopt_if luajit LuaJIT-devel lua51-devel)"
short_desc="Fork of Vim aiming to improve user experience, plugins and GUIs"
maintainer="tranzystorekk <tranzystorek.io@protonmail.com>"
license="Apache-2.0, Vim"
homepage="https://neovim.io"
changelog="https://github.com/neovim/neovim/releases"
distfiles="https://github.com/neovim/neovim/archive/refs/tags/v${version}.tar.gz
https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v${_treesitter_c_version}.tar.gz>treesitter_c_${_treesitter_c_version}.tar.gz
https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/refs/tags/v${_treesitter_lua_version}.tar.gz>treesitter_lua_${_treesitter_lua_version}.tar.gz
https://github.com/tree-sitter-grammars/tree-sitter-vim/archive/refs/tags/v${_treesitter_vim_version}.tar.gz>treesitter_vim_${_treesitter_vim_version}.tar.gz
https://github.com/neovim/tree-sitter-vimdoc/archive/refs/tags/v${_treesitter_vimdoc_version}.tar.gz>treesitter_vimdoc_${_treesitter_vimdoc_version}.tar.gz
https://github.com/tree-sitter-grammars/tree-sitter-query/archive/refs/tags/v${_treesitter_query_version}.tar.gz>treesitter_query_${_treesitter_query_version}.tar.gz
https://github.com/tree-sitter-grammars/tree-sitter-markdown/archive/refs/tags/v${_treesitter_markdown_version}.tar.gz>treesitter_markdown_${_treesitter_markdown_version}.tar.gz"
checksum="edce96e79903adfcb3c41e9a8238511946325ea9568fde177a70a614501af689
75a3780df6114cd37496761c4a7c9fd900c78bee3a2707f590d78c0ca3a24368
230cfcbfa74ed1f7b8149e9a1f34c2efc4c589a71fe0f5dc8560622f8020d722
9f856f8b4a10ab43348550fa2d3cb2846ae3d8e60f45887200549c051c66f9d5
a639bf92bf57bfa1cdc90ca16af27bfaf26a9779064776dd4be34c1ef1453f6c
d3a423ab66dc62b2969625e280116678a8a22582b5ff087795222108db2f6a6e
4909d6023643f1afc3ab219585d4035b7403f3a17849782ab803c5f73c8a31d5"
skip_extraction="
treesitter_c_${_treesitter_c_version}.tar.gz
treesitter_lua_${_treesitter_lua_version}.tar.gz
treesitter_vim_${_treesitter_vim_version}.tar.gz
treesitter_vimdoc_${_treesitter_vimdoc_version}.tar.gz
treesitter_query_${_treesitter_query_version}.tar.gz
treesitter_markdown_${_treesitter_markdown_version}.tar.gz"
build_options=luajit
case "$XBPS_TARGET_MACHINE" in
armv6l|armv7l|riscv64*) build_options_default="" ;;
*) build_options_default="luajit" ;;
esac
alternatives="
vi:vi:/usr/bin/nvim
vi:vi.1:/usr/share/man/man1/nvim.1
vi:view:/usr/bin/nvim
vi:view.1:/usr/share/man/man1/nvim.1
vim:vim:/usr/bin/nvim
vim:vim.1:/usr/share/man/man1/nvim.1"
# They want assertion
CFLAGS=-UNDEBUG
post_extract() {
for _distfile in ${skip_extraction}; do
vsrcextract -C .deps/build/src/${_distfile%_*} ${_distfile}
done
}
pre_configure() {
# build bundled treesitter parsers
cmake -S cmake.deps -B .deps -G Ninja -DUSE_BUNDLED=OFF -DUSE_BUNDLED_TS_PARSERS=ON
cmake --build .deps
}
post_install() {
vlicense LICENSE.txt
if [ "${CROSS_BUILD}" ]; then
patchelf --replace-needed \
${XBPS_CROSS_BASE}/usr/lib/lua/5.1/lpeg.so /usr/lib/lua/5.1/lpeg.so \
${DESTDIR}/usr/bin/nvim
fi
}