summaryrefslogtreecommitdiff
path: root/eclass/nvim-plugin.eclass
blob: c436cf48c42c41748d1d341f4f9cc7c363f3f96b (plain)
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
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: nvim-plugin.eclass
# @MAINTAINER: navi@vlhl.dev
# @SUPPORTED_EAPIS: 8
# @BLURB: used for installing neovim plugins

case ${EAPI} in
	8) ;;
	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ -z ${_NVIM_PLUGIN_ECLASS} ]]; then
_NVIM_PLUGIN_ECLASS=1

DEPEND="app-editors/neovim"
RDEPEND="${DEPEND}"

SLOT="0"

# List of searched directories under 'runtimepath'
_NVIM_RUNTIME=(
	filetype.lua autoload colors compiler doc ftplugin indent keymap lang
	lua menu.vim pack parser plugin queries rplugin spell syntax tutor
)

# @FUNCTION: nvim-plugin_src-install
# @DESCRIPTION: installs the plugin into the runtime folder
nvim-plugin_src_install() {
	einstalldocs

	insinto "${EPREFIX}/usr/share/nvim/site/pack/gentoo/start/${PN}"
	local rt
	for rt in "${_NVIM_RUNTIME[@]}"; do
		[[ -e "${rt}" ]] || continue
		doins -r "${rt}"
	done
}

# @FUNCTION: nvim-plugin_src_compile
# @DESCRIPTION: noop, but some packages include unused Makefiles.
nvim-plugin_src_compile() {
	:
}

fi

EXPORT_FUNCTIONS src_install src_compile