summaryrefslogtreecommitdiff
path: root/eclass/nvim-plugin.eclass
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-10-02 17:04:44 +0200
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-10-02 22:02:26 +0200
commit73a8e48e553ea31bf9750ab1ef951d5aac8ad80d (patch)
tree02adf841370d1b5eaef9eb7c93b7abb0fc35f01e /eclass/nvim-plugin.eclass
parentbf5154e97c1b865a0e69a75f5de0d3ad4f8a9752 (diff)
nvim-plugin.eclass: eclass for neovim plugins
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'eclass/nvim-plugin.eclass')
-rw-r--r--eclass/nvim-plugin.eclass49
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