| View previous topic :: View next topic |
| Author |
Message |
marnix n00b

Joined: 13 Jan 2004 Posts: 18
|
Posted: Tue Dec 02, 2014 1:44 pm Post subject: vim and gvim: enable both python2 and python3 interpreter |
|
|
Hello,
Vim and gvim have support for both a python2 and a python3 interpreter that can be used by typing :py or :py3 respectively. I want to enable both, but as far as I can see, the ebuild of the currently installed version on my system (vim-7.4.273.ebuild) prevents this. I've looked at the ebuild and found this in the src_configure() function:
| Code: |
if use python ; then
if [[ ${EPYTHON} == python3* ]] ; then
myconf+=" --enable-python3interp"
export vi_cv_path_python3="${PYTHON}"
else
myconf+=" --enable-pythoninterp"
export vi_cv_path_python="${PYTHON}"
fi
else
myconf+=" --disable-pythoninterp --disable-python3interp"
fi
|
The ebuild inherits python-single-r1 and the result is that only one of --enable-pythoninterp or --enable-python3interp gets selected, depending on the PYTHON_SINGLE_TARGET variable, even if PYTHON_TARGETS has both a python2 and python3 version enabled. I've created a modified version of the ebuild that inherits python-r1 instead of python-single-r1 and uses the following to replace the above snippet:
| Code: |
if use python ; then
if [[ ${PYTHON_TARGETS} == *python3* ]] ; then
myconf+=" --enable-python3interp"
export vi_cv_path_python3="${PYTHON}"
fi
if [[ ${PYTHON_TARGETS} == *python2* ]] ; then
myconf+=" --enable-pythoninterp
export vi_cv_path_python="${PYTHON}"
fi
else
myconf+=" --disable-pythoninterp --disable-python3interp"
fi
|
I did a similar change to the ebuild script of gvim (gvim-7.4.273). Both build and work as expected after this change and I can use both the python2 and python3 interpreter in vim. Since I'm not a very experienced ebuild writer I wanted to ask whether this is a sane approach or whether I am misusing the PYTHON_TARGETS variable here before filing a bug report? Also, I could not infer from the original ebuild script why python-single-r1 was chosen instead of python-r1 in this case, since as far as I can tell it is only used to enable one of these two configure flags. Any advice or insights on this are appreciated! |
|
| Back to top |
|
 |
azp Guru

Joined: 16 Nov 2003 Posts: 456 Location: Sweden
|
Posted: Tue Jan 20, 2015 11:41 pm Post subject: |
|
|
This is an interesting question, especially since I have issues with my python flags for (G)Vim. For what is probably the reason you mention in your post, I only get Python 3 support, and no ordinary "python" support.
I definitely think this is a bug since it has been working before... I have this as my build flags for Gvim:
| Code: | root@skare$ emerge -pqv vim
[ebuild R ] app-editors/vim-7.4.560 USE="X acl gpm nls perl python vim-pager -cscope -debug -lua -luajit -minimal -racket -ruby (-selinux) -tcl" PYTHON_SINGLE_TARGET="python2_7 -python3_3 -python3_4" PYTHON_TARGETS="python2_7 python3_3 python3_4"
root@skare$ emerge -pqv gvim
[ebuild R ] app-editors/gvim-7.4.560 USE="acl gnome gtk netbeans nls perl python session (-aqua) -cscope -debug -lua -luajit -motif -neXt -racket -ruby (-selinux) -tcl" PYTHON_SINGLE_TARGET="python3_3 -python2_7 -python3_4" PYTHON_TARGETS="python2_7 python3_3 -python3_4" |
but when checking :version in GVim this is what I have:
_________________ Weeks of coding can save you hours of planning. |
|
| Back to top |
|
 |
marnix n00b

Joined: 13 Jan 2004 Posts: 18
|
|
| Back to top |
|
 |
azp Guru

Joined: 16 Nov 2003 Posts: 456 Location: Sweden
|
Posted: Tue Feb 03, 2015 8:41 pm Post subject: Re: bugreport |
|
|
Oh, I had already reported one, forgot to mention that =) _________________ Weeks of coding can save you hours of planning. |
|
| Back to top |
|
 |
|