tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: for python use an already installed version?



"Jeremy C. Reed" <reed%reedmedia.net@localhost> writes:

> See pkgsrc/lang/python/pyversion.mk. Why does the pkgsrc version do the 
> following?
>
> # if the default is accepted, it is first choice
>
>  ... so skips ...
>
> # prefer an already installed version, in order of "accepted"
>
> I have python33 installed but it wants to build python27.
>
> My package Makefile has:
>
> PYTHON_FOR_BUILD_ONLY=  yes
> PYTHON_VERSIONS_INCLUDE_3X=     yes
> CONFIG_SHELL=           ${PYTHONBIN}
> .include "../../lang/python/application.mk"
>
> Is there a pkgsrc way so I don't needlessly build a build dependency if 
> I have a good enough one already installed (for makefile)?
>
> My workaround is to set PYTHON_VERSION_DEFAULT=33 but that is not an 
> infrastructure variable.

You set PYTHON_VERSIONS_INCLUDE_3X=yes, but that doesn't prohibit 2x.
So the package says it's happy with any of 33 32 31 27 26.  Therefore,
because the default version (27, since you hadn't set it) is acceptable,
it's used.  This seems right to me.

There's a tension here between doing what the variables say should
happen, and doing something more compatible with what's installed.  With
python, many packages can be built for multiple versions without
conflicting, and thus you can reasonably end up with multiple python
versions installed.  Also, just because you have python33 installed
doesn't mean you want the next program to build against it.

I don't see how the code after the 'prefer an already installed version'
actually does that.

For apache2 vs apache22, one can have one or the other.  So it does make
sense to depend on exactly the installed version.  Postgresql also seems
to have a one-version-only requirement.  So those situations are really
quite different from python where one might need a 2x for many things
(because you want a particular program in python, not because you want
python) and also a 3x for some other newer program.

So, I'd say that if you choose to have 33 be what you want, you should
set PYTHON_VERSION_DEFAULT=33.  That's the planned way where people tell
pkgsrc what they want.

Attachment: pgpsgkMng6AL1.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index