From 73a8e48e553ea31bf9750ab1ef951d5aac8ad80d Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Wed, 2 Oct 2024 17:04:44 +0200 Subject: nvim-plugin.eclass: eclass for neovim plugins Signed-off-by: Anna (navi) Figueiredo Gomes --- eclass/nvim-plugin.eclass | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 eclass/nvim-plugin.eclass 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 -- cgit v1.2.3