[aur-general] Packages depends on either python 2 or 3

Evangelos Foutras evangelos at foutrelis.com
Tue Oct 16 21:21:23 EDT 2012


On Wed, Oct 17, 2012 at 4:01 AM, Felix Yan <felixonmars at gmail.com> wrote:
> Hi all,
>
> I have written a tool [1] in python and packaged it in AUR [2], now I
> have the following problem:
>
> 1) The tool is written compatible with python 2.7 and 3.x, so I'd like
> to depends on something like (python>=2.7), but the package python2
> does not provides python=$pkgver. So what should the package depend
> on? (is there an "or"-like operator in depends=?)

You can't specify an "OR dependency relation" in a PKGBUILD, so it's
up to you whether it'll depend on 'python' or 'python2'.

> 2) How about the shebang line then? Now it is "/usr/bin/env python"
> but if the user only installed python2 this won't work correctly in
> the default case.

"/usr/bin/env python3" if you decide on Python 3; "/usr/bin/env
python2" otherwise.

It may be a good idea to keep "/usr/bin/env python" on Github and
change it using sed(1) in the PKGBUILD. This way the upstream script
will support both major Python versions, while the AUR package can be
tailored for Arch.

> I've been keeping a watchful eye on recent rebuilds of python
> packages, but still confused about the above situation, thanks for any
> ideas :)
>
> [1] https://github.com/felixonmars/ydcv
> [2] https://aur.archlinux.org/packages.php?ID=62759
>
> Felix Yan
> Twitter: @felixonmars
> Wiki: http://felixc.at


More information about the aur-general mailing list