public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] New eclass vim-runtime
@ 2017-09-08 22:27 Aric Belsito
  2017-09-08 23:44 ` Vadim A. Misbakh-Soloviov
  0 siblings, 1 reply; 3+ messages in thread
From: Aric Belsito @ 2017-09-08 22:27 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

This is really messy at the moment because I'm not sure whether the vim
team is interested, and I didn't want to put in the effort if it's just
going to be rejected, but I'm posting what I have here to start some
kind of discussion.

At the moment functions/other things need to be described, among other
issues. I have not yet tested to see if everything is still working with
vim, though I believe it works with neovim.

I'm also adding a patch file for vim-plugin.eclass, vim-doc.eclass and
vim-spell.eclass

I have a bug open on the bugtracker as well:
https://bugs.gentoo.org/612644

-- 
Aric Belsito

[-- Attachment #2: vim_eclasses.patch --]
[-- Type: text/x-diff, Size: 6845 bytes --]

From 08411b7ade20df1138c28b9a70679b7acf350f87 Mon Sep 17 00:00:00 2001
From: Aric Belsito <lluixhi@gmail.com>
Date: Tue, 5 Sep 2017 14:21:08 -0700
Subject: [PATCH] vim-runtime.eclass: new eclass

Gentoo-Bug: https://bugs.gentoo.org/612644
---
 eclass/vim-doc.eclass     | 40 ++++++++++++++++++++++++----------------
 eclass/vim-plugin.eclass  | 31 +++++++++++++------------------
 eclass/vim-spell.eclass   |  8 ++------
 4 files changed, 39 insertions(+), 40 deletions(-)
 create mode 100644 eclass/vim-runtime.eclass

diff --git a/eclass/vim-doc.eclass b/eclass/vim-doc.eclass
index 5f281eba25f2..c4fa9ed22a44 100644
--- a/eclass/vim-doc.eclass
+++ b/eclass/vim-doc.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # This eclass is used by vim.eclass and vim-plugin.eclass to update
@@ -10,22 +10,28 @@
 # DEPEND in vim-plugin or by whatever version of vim is being
 # installed by the eclass.
 
+inherit vim-runtime
+
+run_helptags() {
+	# Update tags; need a vim binary for this
+	if [[ -n "$1" ]]; then
+		einfo "Updating documentation tags in $2"
+		DISPLAY= $1 -u NONE -n \
+			'+set nobackup nomore' \
+			"+helptags $2/doc" \
+			'+qa!' </dev/null &>/dev/null
+	fi
+}
 
 update_vim_helptags() {
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
 	local vimfiles vim d s
 
 	# This is where vim plugins are installed
-	vimfiles="${EROOT}"/usr/share/vim/vimfiles
+	vimfiles="${EPREFIX}$(vimfiles_directory)"
 
 	if [[ $PN != vim-core ]]; then
-		# Find a suitable vim binary for updating tags :helptags
-		vim=$(type -P vim 2>/dev/null)
-		[[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
-		[[ -z "$vim" ]] && vim=$(type -P kvim 2>/dev/null)
-		if [[ -z "$vim" ]]; then
-			ewarn "No suitable vim binary to rebuild documentation tags"
-		fi
+		vim="$(vim_binary)"
 	fi
 
 	# Make vim not try to connect to X. See :help gui-x11-start
@@ -59,14 +65,16 @@ update_vim_helptags() {
 		fi
 
 		# Update tags; need a vim binary for this
-		if [[ -n "$vim" ]]; then
-			einfo "Updating documentation tags in $d"
-			DISPLAY= $vim -u NONE -U NONE -T xterm -X -n -f \
-				'+set nobackup nomore' \
-				"+helptags $d/doc" \
-				'+qa!' </dev/null &>/dev/null
-		fi
+		run_helptags $vim $d
 	done
 
+	# For neovim, just run :helptags on the tag directory
+	if use nvim ; then
+		[[ -d $vimfiles/doc ]] || break
+
+		# Update tags; need a vim binary for this
+		run_helptags $vim $vimfiles
+	fi
+
 	[[ -n "${vim}" && -f "${vim}" ]] && rm "${vim}"
 }
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index cdc24a15cf6f..f99693aeeb11 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vim-plugin.eclass
@@ -7,18 +7,13 @@
 # @BLURB: used for installing vim plugins
 # @DESCRIPTION:
 # This eclass simplifies installation of app-vim plugins into
-# /usr/share/vim/vimfiles.  This is a version-independent directory
+# $(vimfiles_directory).  This is a version-independent directory
 # which is read automatically by vim.  The only exception is
 # documentation, for which we make a special case via vim-doc.eclass.
 
-inherit vim-doc
+inherit vim-doc vim-runtime
 EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
 
-VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-7.3}"
-
-DEPEND="|| ( >=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
-	>=app-editors/gvim-${VIM_PLUGIN_VIM_VERSION} )"
-RDEPEND="${DEPEND}"
 if [[ ${PV} != 9999* ]] ; then
 	SRC_URI="mirror://gentoo/${P}.tar.bz2
 		https://dev.gentoo.org/~radhermit/vim/${P}.tar.bz2"
@@ -27,7 +22,7 @@ SLOT="0"
 
 vim-plugin_src_install() {
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
-	local f
+	local f vimfiles="${EPREFIX}$(vimfiles_directory)"
 
 	if use !prefix && [[ ${EUID} -eq 0 ]] ; then
 		ebegin "Fixing file permissions"
@@ -59,11 +54,11 @@ vim-plugin_src_install() {
 
 	# Install remainder of plugin
 	cd "${WORKDIR}"
-	dodir /usr/share/vim
-	mv "${S}" "${ED}"/usr/share/vim/vimfiles
+	dodir "$(dirname $vimfiles)"
+	mv "${S}" "${D%/}$vimfiles"
 
 	# Fix remaining bad permissions
-	chmod -R -x+X "${ED}"/usr/share/vim/vimfiles/ || die "chmod failed"
+	chmod -R -x+X "${D%/}$vimfiles" || die "chmod failed"
 }
 
 vim-plugin_pkg_postinst() {
@@ -79,21 +74,21 @@ vim-plugin_pkg_postrm() {
 
 	# Remove empty dirs; this allows
 	# /usr/share/vim to be removed if vim-core is unmerged
-	find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null
+	find "${EPREFIX}$(vimfiles_directory)" -depth -type d -exec rmdir {} \; 2>/dev/null
 }
 
 # update_vim_afterscripts: create scripts in
-# /usr/share/vim/vimfiles/after/* comprised of the snippets in
-# /usr/share/vim/vimfiles/after/*/*.d
+# $(vimfiles_directory)/after/* comprised of the snippets in
+# $(vimfiles_directory)/after/*/*.d
 update_vim_afterscripts() {
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
-	local d f afterdir="${EROOT}"/usr/share/vim/vimfiles/after
+	local d f afterdir="${EPREFIX}$(vimfiles_directory)"/after
 
 	# Nothing to do if the dir isn't there
 	[ -d "${afterdir}" ] || return 0
 
-	einfo "Updating scripts in ${EPREFIX}/usr/share/vim/vimfiles/after"
+	einfo "Updating scripts in ${afterdir}"
 	find "${afterdir}" -type d -name \*.vim.d | \
 	while read d; do
 		echo '" Generated by update_vim_afterscripts' > "${d%.d}"
@@ -101,7 +96,7 @@ update_vim_afterscripts() {
 		sort -z | xargs -0 cat >> "${d%.d}"
 	done
 
-	einfo "Removing dead scripts in ${EPREFIX}/usr/share/vim/vimfiles/after"
+	einfo "Removing dead scripts in ${afterdir}"
 	find "${afterdir}" -type f -name \*.vim | \
 	while read f; do
 		[[ "$(head -n 1 ${f})" == '" Generated by update_vim_afterscripts' ]] \
diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
index 2844ea9d995e..5126f8fa19ce 100644
--- a/eclass/vim-spell.eclass
+++ b/eclass/vim-spell.eclass
@@ -62,14 +62,10 @@
 # spell files. It's best to let upstream know if you've generated spell files
 # for another language rather than keeping them Gentoo-specific.
 
-inherit eutils
+inherit eutils vim-runtime
 
 EXPORT_FUNCTIONS src_install pkg_postinst
 
-IUSE=""
-DEPEND="|| ( >=app-editors/vim-7_alpha
-	>=app-editors/gvim-7_alpha )"
-RDEPEND="${DEPEND}"
 SRC_URI="mirror://gentoo/${P}.tar.bz2"
 SLOT="0"
 
@@ -91,7 +87,7 @@ SLOT="0"
 # @INTERNAL
 # @DESCRIPTION:
 # This variable defines the path to Vim spell files.
-: ${VIM_SPELL_DIRECTORY:="${EPREFIX}/usr/share/vim/vimfiles/spell/"}
+: ${VIM_SPELL_DIRECTORY:="${EPREFIX}$(vimfiles_directory)/spell/"}
 
 # @ECLASS-VARIABLE: DESCRIPTION
 # @DESCRIPTION:

[-- Attachment #3: vim-runtime.eclass --]
[-- Type: text/plain, Size: 1230 bytes --]

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: vim-runtime.eclass
# @MAINTAINER:
# vim@gentoo.org
# @BLURB: used for installing vim plugins
# @DESCRIPTION:
# This eclass simplifies installation of app-vim plugins into
# $(vimfiles_directory).  This is a version-independent directory
# which is read automatically by vim.  The only exception is
# documentation, for which we make a special case via vim-doc.eclass.

# @ECLASS-VARIABLE: VIM_PLUGIN_VIM_VERSION
# @DESCRIPTION:
# This variable defines the default vim version for a vim plugin.
# The default value is "7.3".
: ${VIM_PLUGIN_VIM_VERSION:=7.3}

IUSE="nvim"
DEPEND="|| (
	>=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
	>=app-editors/gvim-${VIM_PLUGIN_VIM_VERSION}
	app-editors/neovim
)"
RDEPEND="${DEPEND}"

vim_binary() {
	# Find a suitable vim binary
	local vim=$(type -P vim 2>/dev/null)
	[[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
	[[ -z "$vim" ]] && vim=$(type -P nvim 2>/dev/null)
	if [[ -z "$vim" ]]; then
		ewarn "No suitable vim binary found"
	fi
	echo "$vim"
}

vimfiles_directory() {
	if use nvim ; then
		echo "/usr/share/nvim/runtime"
	else
		echo "/usr/share/vim/vimfiles"
	fi
}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [RFC] New eclass vim-runtime
  2017-09-08 22:27 [gentoo-dev] [RFC] New eclass vim-runtime Aric Belsito
@ 2017-09-08 23:44 ` Vadim A. Misbakh-Soloviov
       [not found]   ` <20170909203256.GG10007@patriceclement.me>
  0 siblings, 1 reply; 3+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2017-09-08 23:44 UTC (permalink / raw
  To: gentoo-dev

DEPENDS part and "binary" function makes me sad panda:
they assumes there are no "vims" exist, while there is at least `vim-qt` 
(well, actually that one is dropped from gentoo) and `neovim-qt` (and that one 
is in overlays, but anyway), and so on.

I think, it'd be nice to somehow avoid exact binary names matching (just as 
exact package names), or, uhm... make it extendable somehow?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [RFC] New eclass vim-runtime
       [not found]   ` <20170909203256.GG10007@patriceclement.me>
@ 2017-09-09 23:00     ` Aric Belsito
  0 siblings, 0 replies; 3+ messages in thread
From: Aric Belsito @ 2017-09-09 23:00 UTC (permalink / raw
  To: Patrice Clement, gentoo-dev, Vadim A. Misbakh

Hi Patrice,

No problem, thanks for looking at it. I'll get on the #gentoo-vim IRC
channel to discuss things.

I don't have any issues with the review, but I'm debating whether it's a
better idea to use a USE_EXPAND for vim implementations or maybe a
virtual?, and then iterate through those and install to the appropriate
runtime directories -- this was just the simplest and least destructive
implementation I could think of to get the packages in app-vim working
on neovim. (and make it easy to replace
`insinto /usr/share/vim/vimfiles` with `insinto $(vimfiles_directory)`
for packages that include vim syntax.)

On Sat, Sep 09, 2017 at 10:32:56PM +0200, Patrice Clement wrote:
> Hi Aric
> 
> Thanks a lot for your patch.
> 
> We ran a quick survey the other day and found out the Gentoo Vim team is
> basically just radhermit and myself at the moment. Please bear with us if it
> takes some time to get back to you with clear answers.
> 
> I have reviewed your code over at:
> https://github.com/lluixhi/gentoo/commit/cf191a3df28b16a479c1670ce4a6c1dcdbe8846b
> 
> Please have a look at my reviews and let me know.
> 
> I have recently joined the #gentoo-vim IRC channel. Feel free to drop in and
> talk to me and/or other people in the channel. IRC is in my opinion easier to
> discuss and talk about code and you'll get feedback quicker than over email.
> 
> Cheers
> 
> Friday 08 Sep 2017 15:27:24, Aric Belsito wrote :
> > This is really messy at the moment because I'm not sure whether the vim
> > team is interested, and I didn't want to put in the effort if it's just
> > going to be rejected, but I'm posting what I have here to start some
> > kind of discussion.
> > 
> > At the moment functions/other things need to be described, among other
> > issues. I have not yet tested to see if everything is still working with
> > vim, though I believe it works with neovim.
> > 
> > I'm also adding a patch file for vim-plugin.eclass, vim-doc.eclass and
> > vim-spell.eclass
> > 
> > I have a bug open on the bugtracker as well:
> > https://bugs.gentoo.org/612644
> > 
> > -- 
> > Aric Belsito
> 
> > From 08411b7ade20df1138c28b9a70679b7acf350f87 Mon Sep 17 00:00:00 2001
> > From: Aric Belsito <lluixhi@gmail.com>
> > Date: Tue, 5 Sep 2017 14:21:08 -0700
> > Subject: [PATCH] vim-runtime.eclass: new eclass
> > 
> > Gentoo-Bug: https://bugs.gentoo.org/612644
> > ---
> >  eclass/vim-doc.eclass     | 40 ++++++++++++++++++++++++----------------
> >  eclass/vim-plugin.eclass  | 31 +++++++++++++------------------
> >  eclass/vim-spell.eclass   |  8 ++------
> >  4 files changed, 39 insertions(+), 40 deletions(-)
> >  create mode 100644 eclass/vim-runtime.eclass
> > 
> > diff --git a/eclass/vim-doc.eclass b/eclass/vim-doc.eclass
> > index 5f281eba25f2..c4fa9ed22a44 100644
> > --- a/eclass/vim-doc.eclass
> > +++ b/eclass/vim-doc.eclass
> > @@ -1,4 +1,4 @@
> > -# Copyright 1999-2011 Gentoo Foundation
> > +# Copyright 1999-2017 Gentoo Foundation
> >  # Distributed under the terms of the GNU General Public License v2
> >  #
> >  # This eclass is used by vim.eclass and vim-plugin.eclass to update
> > @@ -10,22 +10,28 @@
> >  # DEPEND in vim-plugin or by whatever version of vim is being
> >  # installed by the eclass.
> >  
> > +inherit vim-runtime
> > +
> > +run_helptags() {
> > +	# Update tags; need a vim binary for this
> > +	if [[ -n "$1" ]]; then
> > +		einfo "Updating documentation tags in $2"
> > +		DISPLAY= $1 -u NONE -n \
> > +			'+set nobackup nomore' \
> > +			"+helptags $2/doc" \
> > +			'+qa!' </dev/null &>/dev/null
> > +	fi
> > +}
> >  
> >  update_vim_helptags() {
> >  	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
> >  	local vimfiles vim d s
> >  
> >  	# This is where vim plugins are installed
> > -	vimfiles="${EROOT}"/usr/share/vim/vimfiles
> > +	vimfiles="${EPREFIX}$(vimfiles_directory)"
> >  
> >  	if [[ $PN != vim-core ]]; then
> > -		# Find a suitable vim binary for updating tags :helptags
> > -		vim=$(type -P vim 2>/dev/null)
> > -		[[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
> > -		[[ -z "$vim" ]] && vim=$(type -P kvim 2>/dev/null)
> > -		if [[ -z "$vim" ]]; then
> > -			ewarn "No suitable vim binary to rebuild documentation tags"
> > -		fi
> > +		vim="$(vim_binary)"
> >  	fi
> >  
> >  	# Make vim not try to connect to X. See :help gui-x11-start
> > @@ -59,14 +65,16 @@ update_vim_helptags() {
> >  		fi
> >  
> >  		# Update tags; need a vim binary for this
> > -		if [[ -n "$vim" ]]; then
> > -			einfo "Updating documentation tags in $d"
> > -			DISPLAY= $vim -u NONE -U NONE -T xterm -X -n -f \
> > -				'+set nobackup nomore' \
> > -				"+helptags $d/doc" \
> > -				'+qa!' </dev/null &>/dev/null
> > -		fi
> > +		run_helptags $vim $d
> >  	done
> >  
> > +	# For neovim, just run :helptags on the tag directory
> > +	if use nvim ; then
> > +		[[ -d $vimfiles/doc ]] || break
> > +
> > +		# Update tags; need a vim binary for this
> > +		run_helptags $vim $vimfiles
> > +	fi
> > +
> >  	[[ -n "${vim}" && -f "${vim}" ]] && rm "${vim}"
> >  }
> > diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
> > index cdc24a15cf6f..f99693aeeb11 100644
> > --- a/eclass/vim-plugin.eclass
> > +++ b/eclass/vim-plugin.eclass
> > @@ -1,4 +1,4 @@
> > -# Copyright 1999-2016 Gentoo Foundation
> > +# Copyright 1999-2017 Gentoo Foundation
> >  # Distributed under the terms of the GNU General Public License v2
> >  
> >  # @ECLASS: vim-plugin.eclass
> > @@ -7,18 +7,13 @@
> >  # @BLURB: used for installing vim plugins
> >  # @DESCRIPTION:
> >  # This eclass simplifies installation of app-vim plugins into
> > -# /usr/share/vim/vimfiles.  This is a version-independent directory
> > +# $(vimfiles_directory).  This is a version-independent directory
> >  # which is read automatically by vim.  The only exception is
> >  # documentation, for which we make a special case via vim-doc.eclass.
> >  
> > -inherit vim-doc
> > +inherit vim-doc vim-runtime
> >  EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
> >  
> > -VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-7.3}"
> > -
> > -DEPEND="|| ( >=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
> > -	>=app-editors/gvim-${VIM_PLUGIN_VIM_VERSION} )"
> > -RDEPEND="${DEPEND}"
> >  if [[ ${PV} != 9999* ]] ; then
> >  	SRC_URI="mirror://gentoo/${P}.tar.bz2
> >  		https://dev.gentoo.org/~radhermit/vim/${P}.tar.bz2"
> > @@ -27,7 +22,7 @@ SLOT="0"
> >  
> >  vim-plugin_src_install() {
> >  	has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
> > -	local f
> > +	local f vimfiles="${EPREFIX}$(vimfiles_directory)"
> >  
> >  	if use !prefix && [[ ${EUID} -eq 0 ]] ; then
> >  		ebegin "Fixing file permissions"
> > @@ -59,11 +54,11 @@ vim-plugin_src_install() {
> >  
> >  	# Install remainder of plugin
> >  	cd "${WORKDIR}"
> > -	dodir /usr/share/vim
> > -	mv "${S}" "${ED}"/usr/share/vim/vimfiles
> > +	dodir "$(dirname $vimfiles)"
> > +	mv "${S}" "${D%/}$vimfiles"
> >  
> >  	# Fix remaining bad permissions
> > -	chmod -R -x+X "${ED}"/usr/share/vim/vimfiles/ || die "chmod failed"
> > +	chmod -R -x+X "${D%/}$vimfiles" || die "chmod failed"
> >  }
> >  
> >  vim-plugin_pkg_postinst() {
> > @@ -79,21 +74,21 @@ vim-plugin_pkg_postrm() {
> >  
> >  	# Remove empty dirs; this allows
> >  	# /usr/share/vim to be removed if vim-core is unmerged
> > -	find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null
> > +	find "${EPREFIX}$(vimfiles_directory)" -depth -type d -exec rmdir {} \; 2>/dev/null
> >  }
> >  
> >  # update_vim_afterscripts: create scripts in
> > -# /usr/share/vim/vimfiles/after/* comprised of the snippets in
> > -# /usr/share/vim/vimfiles/after/*/*.d
> > +# $(vimfiles_directory)/after/* comprised of the snippets in
> > +# $(vimfiles_directory)/after/*/*.d
> >  update_vim_afterscripts() {
> >  	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
> >  	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
> > -	local d f afterdir="${EROOT}"/usr/share/vim/vimfiles/after
> > +	local d f afterdir="${EPREFIX}$(vimfiles_directory)"/after
> >  
> >  	# Nothing to do if the dir isn't there
> >  	[ -d "${afterdir}" ] || return 0
> >  
> > -	einfo "Updating scripts in ${EPREFIX}/usr/share/vim/vimfiles/after"
> > +	einfo "Updating scripts in ${afterdir}"
> >  	find "${afterdir}" -type d -name \*.vim.d | \
> >  	while read d; do
> >  		echo '" Generated by update_vim_afterscripts' > "${d%.d}"
> > @@ -101,7 +96,7 @@ update_vim_afterscripts() {
> >  		sort -z | xargs -0 cat >> "${d%.d}"
> >  	done
> >  
> > -	einfo "Removing dead scripts in ${EPREFIX}/usr/share/vim/vimfiles/after"
> > +	einfo "Removing dead scripts in ${afterdir}"
> >  	find "${afterdir}" -type f -name \*.vim | \
> >  	while read f; do
> >  		[[ "$(head -n 1 ${f})" == '" Generated by update_vim_afterscripts' ]] \
> > diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
> > index 2844ea9d995e..5126f8fa19ce 100644
> > --- a/eclass/vim-spell.eclass
> > +++ b/eclass/vim-spell.eclass
> > @@ -62,14 +62,10 @@
> >  # spell files. It's best to let upstream know if you've generated spell files
> >  # for another language rather than keeping them Gentoo-specific.
> >  
> > -inherit eutils
> > +inherit eutils vim-runtime
> >  
> >  EXPORT_FUNCTIONS src_install pkg_postinst
> >  
> > -IUSE=""
> > -DEPEND="|| ( >=app-editors/vim-7_alpha
> > -	>=app-editors/gvim-7_alpha )"
> > -RDEPEND="${DEPEND}"
> >  SRC_URI="mirror://gentoo/${P}.tar.bz2"
> >  SLOT="0"
> >  
> > @@ -91,7 +87,7 @@ SLOT="0"
> >  # @INTERNAL
> >  # @DESCRIPTION:
> >  # This variable defines the path to Vim spell files.
> > -: ${VIM_SPELL_DIRECTORY:="${EPREFIX}/usr/share/vim/vimfiles/spell/"}
> > +: ${VIM_SPELL_DIRECTORY:="${EPREFIX}$(vimfiles_directory)/spell/"}
> >  
> >  # @ECLASS-VARIABLE: DESCRIPTION
> >  # @DESCRIPTION:
> 
> > # Copyright 1999-2017 Gentoo Foundation
> > # Distributed under the terms of the GNU General Public License v2
> > 
> > # @ECLASS: vim-runtime.eclass
> > # @MAINTAINER:
> > # vim@gentoo.org
> > # @BLURB: used for installing vim plugins
> > # @DESCRIPTION:
> > # This eclass simplifies installation of app-vim plugins into
> > # $(vimfiles_directory).  This is a version-independent directory
> > # which is read automatically by vim.  The only exception is
> > # documentation, for which we make a special case via vim-doc.eclass.
> > 
> > # @ECLASS-VARIABLE: VIM_PLUGIN_VIM_VERSION
> > # @DESCRIPTION:
> > # This variable defines the default vim version for a vim plugin.
> > # The default value is "7.3".
> > : ${VIM_PLUGIN_VIM_VERSION:=7.3}
> > 
> > IUSE="nvim"
> > DEPEND="|| (
> > 	>=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
> > 	>=app-editors/gvim-${VIM_PLUGIN_VIM_VERSION}
> > 	app-editors/neovim
> > )"
> > RDEPEND="${DEPEND}"
> > 
> > vim_binary() {
> > 	# Find a suitable vim binary
> > 	local vim=$(type -P vim 2>/dev/null)
> > 	[[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
> > 	[[ -z "$vim" ]] && vim=$(type -P nvim 2>/dev/null)
> > 	if [[ -z "$vim" ]]; then
> > 		ewarn "No suitable vim binary found"
> > 	fi
> > 	echo "$vim"
> > }
> > 
> > vimfiles_directory() {
> > 	if use nvim ; then
> > 		echo "/usr/share/nvim/runtime"
> > 	else
> > 		echo "/usr/share/vim/vimfiles"
> > 	fi
> > }
> 
> 
> -- 
> Patrice Clement
> Gentoo Linux developer
> http://www.gentoo.org
> 

Yeah, the DEPEND part and the `vim_binary` function are not pretty. I
pulled them out of the vim-plugin, vim-spell, and vim-doc eclasses and
didn't rewrite them.

I do know about neovim-qt, but isn't that just a UI that communicates
with RPC to a neovim binary? e.g. if you wanted to use a plugin with
neovim-qt wouldn't you just install it for neovim?

On Sat, Sep 09, 2017 at 06:44:16AM +0700, Vadim A. Misbakh-Soloviov wrote:
> DEPENDS part and "binary" function makes me sad panda:
> they assumes there are no "vims" exist, while there is at least `vim-qt` 
> (well, actually that one is dropped from gentoo) and `neovim-qt` (and that one 
> is in overlays, but anyway), and so on.
> 
> I think, it'd be nice to somehow avoid exact binary names matching (just as 
> exact package names), or, uhm... make it extendable somehow?
> 

-- 
Aric Belsito


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-09 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-08 22:27 [gentoo-dev] [RFC] New eclass vim-runtime Aric Belsito
2017-09-08 23:44 ` Vadim A. Misbakh-Soloviov
     [not found]   ` <20170909203256.GG10007@patriceclement.me>
2017-09-09 23:00     ` Aric Belsito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox