commit:     d7b62acd7caa4fe0129e6172347bb0768830c4e6
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 21 13:06:11 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Dec 21 13:11:21 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7b62acd

app-editors/vim: migrate to lua-single.eclass

Both the latest release we have got in the tree and the live ebuild.
Compatibility - same as in unmigrated ebuilds, with the USE=deprecated
requirement on PUC Lua I didn't even bother testing newer versions.

Closes: https://bugs.gentoo.org/752537
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../{vim-9999.ebuild => vim-8.2.0814-r100.ebuild}  | 27 ++++++++++++++--------
 app-editors/vim/vim-9999.ebuild                    | 27 ++++++++++++++--------
 profiles/package.mask                              |  1 +
 3 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/app-editors/vim/vim-9999.ebuild 
b/app-editors/vim/vim-8.2.0814-r100.ebuild
similarity index 93%
copy from app-editors/vim/vim-9999.ebuild
copy to app-editors/vim/vim-8.2.0814-r100.ebuild
index 37285363833..c9e9b3a5b2e 100644
--- a/app-editors/vim/vim-9999.ebuild
+++ b/app-editors/vim/vim-8.2.0814-r100.ebuild
@@ -3,11 +3,12 @@
 
 EAPI=7
 VIM_VERSION="8.2"
+LUA_COMPAT=( lua5-1 luajit )
 PYTHON_COMPAT=( python3_{6,7,8} )
 PYTHON_REQ_USE="threads(+)"
 USE_RUBY="ruby24 ruby25 ruby26 ruby27"
 
-inherit vim-doc flag-o-matic bash-completion-r1 python-single-r1 ruby-single 
desktop xdg-utils
+inherit vim-doc flag-o-matic bash-completion-r1 lua-single python-single-r1 
ruby-single desktop xdg-utils
 
 if [[ ${PV} == 9999* ]] ; then
        inherit git-r3
@@ -23,8 +24,9 @@ HOMEPAGE="https://vim.sourceforge.io/ 
https://github.com/vim/vim";
 
 SLOT="0"
 LICENSE="vim"
-IUSE="X acl cscope debug gpm lua luajit minimal nls perl python racket ruby 
selinux sound tcl terminal vim-pager"
+IUSE="X acl cscope debug gpm lua minimal nls perl python racket ruby selinux 
sound tcl terminal vim-pager"
 REQUIRED_USE="
+       lua? ( ${LUA_REQUIRED_USE} )
        python? ( ${PYTHON_REQUIRED_USE} )
        vim-pager? ( !minimal )
 "
@@ -36,9 +38,8 @@ RDEPEND="
        acl? ( kernel_linux? ( sys-apps/acl ) )
        cscope? ( dev-util/cscope )
        gpm? ( >=sys-libs/gpm-1.19.3 )
-       lua? (
-               luajit? ( dev-lang/luajit:2= )
-               !luajit? ( dev-lang/lua:0[deprecated] )
+       lua? ( ${LUA_DEPS}
+               $(lua_gen_impl_dep 'deprecated' lua5-1)
        )
        !minimal? ( ~app-editors/vim-core-${PV} )
        vim-pager? ( app-editors/vim-core[-minimal] )
@@ -57,6 +58,8 @@ DEPEND="
        sys-devel/autoconf
        nls? ( sys-devel/gettext )
 "
+# configure runs the Lua interpreter
+BDEPEND="lua? ( ${LUA_DEPS} )"
 
 pkg_setup() {
        # people with broken alphabets run into trouble. bug 82186.
@@ -67,6 +70,7 @@ pkg_setup() {
        mkdir -p "${T}"/home || die "mkdir failed"
        export HOME="${T}"/home
 
+       use lua && lua-single_pkg_setup
        use python && python-single-r1_pkg_setup
 }
 
@@ -198,13 +202,10 @@ src_configure() {
                        $(use_enable acl)
                        $(use_enable cscope)
                        $(use_enable gpm)
-                       $(use_enable lua luainterp)
-                       $(usex lua "--with-lua-prefix=${EPREFIX}/usr" "")
-                       $(use_with luajit)
                        $(use_enable nls)
                        $(use_enable perl perlinterp)
                        $(use_enable python python3interp)
-                       $(use_with python python3-command $(type -P $(eselect 
python show --python3)))
+                       $(use_with python python3-command "${PYTHON}")
                        $(use_enable racket mzschemeinterp)
                        $(use_enable ruby rubyinterp)
                        $(use_enable selinux)
@@ -219,6 +220,14 @@ src_configure() {
                                '/# define FEAT_CSCOPE/d' src/feature.h || die 
"sed failed"
                fi
 
+               if use lua; then
+                       myconf+=(
+                               --enable-luainterp
+                               $(use_with lua_single_target_luajit luajit)
+                               --with-lua-prefix="${EPREFIX}/usr"
+                       )
+               fi
+
                # don't test USE=X here ... see bug #19115
                # but need to provide a way to link against X ... see bug #20093
                myconf+=(

diff --git a/app-editors/vim/vim-9999.ebuild b/app-editors/vim/vim-9999.ebuild
index 37285363833..c9e9b3a5b2e 100644
--- a/app-editors/vim/vim-9999.ebuild
+++ b/app-editors/vim/vim-9999.ebuild
@@ -3,11 +3,12 @@
 
 EAPI=7
 VIM_VERSION="8.2"
+LUA_COMPAT=( lua5-1 luajit )
 PYTHON_COMPAT=( python3_{6,7,8} )
 PYTHON_REQ_USE="threads(+)"
 USE_RUBY="ruby24 ruby25 ruby26 ruby27"
 
-inherit vim-doc flag-o-matic bash-completion-r1 python-single-r1 ruby-single 
desktop xdg-utils
+inherit vim-doc flag-o-matic bash-completion-r1 lua-single python-single-r1 
ruby-single desktop xdg-utils
 
 if [[ ${PV} == 9999* ]] ; then
        inherit git-r3
@@ -23,8 +24,9 @@ HOMEPAGE="https://vim.sourceforge.io/ 
https://github.com/vim/vim";
 
 SLOT="0"
 LICENSE="vim"
-IUSE="X acl cscope debug gpm lua luajit minimal nls perl python racket ruby 
selinux sound tcl terminal vim-pager"
+IUSE="X acl cscope debug gpm lua minimal nls perl python racket ruby selinux 
sound tcl terminal vim-pager"
 REQUIRED_USE="
+       lua? ( ${LUA_REQUIRED_USE} )
        python? ( ${PYTHON_REQUIRED_USE} )
        vim-pager? ( !minimal )
 "
@@ -36,9 +38,8 @@ RDEPEND="
        acl? ( kernel_linux? ( sys-apps/acl ) )
        cscope? ( dev-util/cscope )
        gpm? ( >=sys-libs/gpm-1.19.3 )
-       lua? (
-               luajit? ( dev-lang/luajit:2= )
-               !luajit? ( dev-lang/lua:0[deprecated] )
+       lua? ( ${LUA_DEPS}
+               $(lua_gen_impl_dep 'deprecated' lua5-1)
        )
        !minimal? ( ~app-editors/vim-core-${PV} )
        vim-pager? ( app-editors/vim-core[-minimal] )
@@ -57,6 +58,8 @@ DEPEND="
        sys-devel/autoconf
        nls? ( sys-devel/gettext )
 "
+# configure runs the Lua interpreter
+BDEPEND="lua? ( ${LUA_DEPS} )"
 
 pkg_setup() {
        # people with broken alphabets run into trouble. bug 82186.
@@ -67,6 +70,7 @@ pkg_setup() {
        mkdir -p "${T}"/home || die "mkdir failed"
        export HOME="${T}"/home
 
+       use lua && lua-single_pkg_setup
        use python && python-single-r1_pkg_setup
 }
 
@@ -198,13 +202,10 @@ src_configure() {
                        $(use_enable acl)
                        $(use_enable cscope)
                        $(use_enable gpm)
-                       $(use_enable lua luainterp)
-                       $(usex lua "--with-lua-prefix=${EPREFIX}/usr" "")
-                       $(use_with luajit)
                        $(use_enable nls)
                        $(use_enable perl perlinterp)
                        $(use_enable python python3interp)
-                       $(use_with python python3-command $(type -P $(eselect 
python show --python3)))
+                       $(use_with python python3-command "${PYTHON}")
                        $(use_enable racket mzschemeinterp)
                        $(use_enable ruby rubyinterp)
                        $(use_enable selinux)
@@ -219,6 +220,14 @@ src_configure() {
                                '/# define FEAT_CSCOPE/d' src/feature.h || die 
"sed failed"
                fi
 
+               if use lua; then
+                       myconf+=(
+                               --enable-luainterp
+                               $(use_with lua_single_target_luajit luajit)
+                               --with-lua-prefix="${EPREFIX}/usr"
+                       )
+               fi
+
                # don't test USE=X here ... see bug #19115
                # but need to provide a way to link against X ... see bug #20093
                myconf+=(

diff --git a/profiles/package.mask b/profiles/package.mask
index 559d3760edb..954d79f7fb8 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -444,6 +444,7 @@ kde-apps/kdebase-meta:5
 >=app-crypt/ekeyd-1.1.5-r100
 >=app-editors/neovim-0.4.4-r100
 =app-editors/scite-4.4.4-r10
+>=app-editors/vim-8.2.0814-r100
 >=app-emulation/libguestfs-1.38.6-r100
 >=app-misc/worker-3.8.3-r100
 >=dev-games/cegui-0.8.7-r100

Reply via email to