From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0C8EE1396D0 for ; Sat, 9 Sep 2017 23:00:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DFD2FE0D33; Sat, 9 Sep 2017 23:00:41 +0000 (UTC) Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 80719E0CB8 for ; Sat, 9 Sep 2017 23:00:41 +0000 (UTC) Received: by mail-pf0-x233.google.com with SMTP id e199so9158090pfh.3 for ; Sat, 09 Sep 2017 16:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :in-reply-to:user-agent; bh=FsDynHQyQtFEyu9by7IaPgXktnJyXbmdRbJM0zGitNw=; b=AyhU9b59WIIDNKhxh0OooFrnz4jxLUZ9Hfo09/m95irEVPveQ+bZoZSkALzdis52wb VE5vGcUdljVPaqTwG7CnRW9bUTGNpaHhVdVprrw+q/RBgZKrXuYCU6luuGRzdr6j6J8Z opXlGN2DWUb54S19ICjEHz5YWg/qrKqzlW6CdE7fdd0YDmsW6rYP5ygrzqMt9/4Ce3mE 4Ssnuyh1wHoWm9JpYDWJJzUk9qmzqnatDuI4Wxuqmnn9J4Ku1Myf9iUGeuMmIgmoC5Fx Esx9JytDDVoFxy5p3Ny2fY3kL8dZWLSBV/yyzOkdnjEwxUEbC/JTtG22N1iNTUGEyDY6 kCpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:in-reply-to:user-agent; bh=FsDynHQyQtFEyu9by7IaPgXktnJyXbmdRbJM0zGitNw=; b=UD7M/tBiCvIc01TfAZQa7oPFIMh/C9/jsU3jgwNsW4jxBPJTIDHCdsGJTi3t0/dMs0 qAd2d0CvQCzpF8z2kjMqRVqSXitSZfVJkW6HCjY0+kbwNTQw+iOAKEtfNFKaH3BfNSyI HIeS5l65zZufA4hXMhCoMpgIndsND7JrAlCMHNx/zHRsT6unbmIyYEWJcAelHkts1oby HXFgrJm/xSl/MzWkhxJTq3oQZSAJpgIdKlVl4sMrRVDeEQNp2oFyje7IesJLiwynFuOz QXCLkWeDHNBcTi8z6hrNsXvl3oiy5L5MAbyqUM0mpW56CeYK6uAnJGhgHXv4TEPfNBh8 m4Yg== X-Gm-Message-State: AHPjjUjSyM5bpmaEs6YaDucCBO5AMcPkyyU9LQoXkhfAPLQ8vpzFtkeJ WXfVUimSe2bTn6T5M8Y= X-Google-Smtp-Source: ADKCNb6pUVKTTUVS+Urse+1BMUwbk1wR5cG/5TwatKpaDT/YNiKnL/ORvsiYhuprZZjYMkPctGc0QA== X-Received: by 10.101.87.207 with SMTP id q15mr7526008pgr.453.1504998040455; Sat, 09 Sep 2017 16:00:40 -0700 (PDT) Received: from gmail.com ([2607:f140:400:a011:47de:bccd:2bdb:f91e]) by smtp.gmail.com with ESMTPSA id b89sm9534544pfe.43.2017.09.09.16.00.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2017 16:00:39 -0700 (PDT) Date: Sat, 9 Sep 2017 16:00:36 -0700 From: Aric Belsito To: Patrice Clement , gentoo-dev@lists.gentoo.org, "Vadim A. Misbakh" Subject: Re: [gentoo-dev] [RFC] New eclass vim-runtime Message-ID: <20170909230036.GA2716@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13934394.zehC0WrXp7@note> <20170909203256.GG10007@patriceclement.me> User-Agent: Mutt/1.9.0 (2017-09-02) X-Archives-Salt: 90420b99-9968-4a78-baf5-ddb4085d8f43 X-Archives-Hash: 0606274373bb6f9f0dfc102ba1e53aad 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 > > 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 > > + 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 > > - 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