2023-01-13 20:20:10 +01:00
|
|
|
# Copyright 2022-2023 Gentoo Authors
|
2022-10-06 17:52:01 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI="8"
|
|
|
|
|
|
|
|
LUA_COMPAT=( lua5-{1..4} luajit )
|
|
|
|
|
|
|
|
inherit lua-single vim-plugin
|
2023-06-24 19:52:54 +02:00
|
|
|
COMMIT_ID="68c619f2e3bbace5d2e885dbe44289dc68d776e5"
|
2022-10-06 17:52:01 +02:00
|
|
|
|
|
|
|
DESCRIPTION="neovim plugin: tree sitter support for syntax highlighting"
|
|
|
|
HOMEPAGE="https://github.com/nvim-treesitter/nvim-treesitter"
|
|
|
|
LICENSE="Apache-2.0"
|
2022-12-18 21:40:40 +01:00
|
|
|
MY_PN="nvim-treesitter"
|
2022-10-06 17:52:01 +02:00
|
|
|
|
|
|
|
if [[ ${PV} == *9999 ]]
|
|
|
|
then
|
|
|
|
inherit git-r3
|
|
|
|
EGIT_REPO_URI="https://github.com/nvim-treesitter/nvim-treesitter.git"
|
|
|
|
else
|
|
|
|
if [[ ${PV} == *_p* ]]; then
|
2023-03-30 22:39:47 +02:00
|
|
|
SRC_URI="https://github.com/nvim-treesitter/${MY_PN}/archive/${COMMIT_ID}.tar.gz -> ${P}.gh.tar.gz"
|
2022-12-18 21:40:40 +01:00
|
|
|
S="${WORKDIR}/${MY_PN}-${COMMIT_ID}"
|
2022-10-06 17:52:01 +02:00
|
|
|
else
|
2023-03-30 22:39:47 +02:00
|
|
|
SRC_URI="https://github.com/nvim-treesitter/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
|
2022-12-18 21:40:40 +01:00
|
|
|
S="${WORKDIR}/${MY_PN}-${PV}"
|
2022-10-06 17:52:01 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
IUSE="test"
|
|
|
|
REQUIRED_USE="${LUA_REQUIRED_USE}"
|
|
|
|
RESTRICT="!test? ( test )"
|
|
|
|
KEYWORDS="~amd64"
|
|
|
|
RDEPEND="
|
|
|
|
app-editors/neovim
|
|
|
|
dev-libs/tree-sitter-meta
|
|
|
|
"
|
|
|
|
|
|
|
|
DOCS=(
|
|
|
|
CONTRIBUTING.md
|
|
|
|
README.md
|
|
|
|
)
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
# The Makefile runs only tests.
|
|
|
|
:;
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
# We need to get the major and minor version only.
|
|
|
|
insinto /usr/share/lua/$(ver_cut 1-2 $(lua_get_version))
|
|
|
|
doins -r lua/*
|
|
|
|
rm -r lua || die
|
|
|
|
vim-plugin_src_install
|
|
|
|
}
|