diff options
Diffstat (limited to 'eclass/nvim-plugin.eclass')
-rw-r--r-- | eclass/nvim-plugin.eclass | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/eclass/nvim-plugin.eclass b/eclass/nvim-plugin.eclass new file mode 100644 index 0000000..c436cf4 --- /dev/null +++ b/eclass/nvim-plugin.eclass @@ -0,0 +1,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 |