Am 13.12.2015 20:54 schrieb Larry Hajali:
I've been on the fence about adding that auto-detection in my python
slackbuilds. Some people think that this should be an option set at build
time to add python3 support by using a variable.

Eg.

if ["${PYTHON3SUPPORT:-no}" == "yes" ]; then

  python3 setup.py install --root=$PKG

fi

I'm not opposed to that, but I'm also not sure how to handle packages that
put files in /usr/bin directory (like python-pillow) for python2 and
python3 scripts.  If python3 files are built after python2 files, then
everything in /usr/bin/* will have a shebang with #!/usr/bin/python3. I'm
not sure that is a desired outcome.

It may be best to create a second python3 package for python-pillow and
possibly other python slackbuilds that support python3 to avoid file
conflicts.

Perhaps we could also avoid duplicating packages where such conflicts are possible, by adding an "else" statement in order to build either with Python OR Python3 support. For example:

if ["${PYTHON3SUPPORT:-no}" == "yes" ]; then
  python3 setup.py install --root=$PKG
else
  python setup.py install --root=$PKG
fi

Philip


Thanks,
--Larry

On Sun, Dec 13, 2015 at 11:23 AM, Philip Lacroix <[email protected]> wrote:

Greetings

I wonder if something like the following test could be added to
python-pillow.SlackBuild, in order to automatically add support for Python3
if the latter is installed:

 python setup.py install --root=$PKG

+ if $(python3 -c 'import sys' 2>/dev/null); then
+  python3 setup.py install --root=$PKG
+ fi


I've been using this test in my script for glances, after borrowing it
from Larry Hajali's script for psutil, and it seems to do its job nicely.

The reason for my suggestion is that I'm preparing a new SlackBuild that will require both python3 and python-pillow. The software expects pillow to support Python 3, but it doesn't, unless the script is manually edited. I understand that Slackware-current, from which the python-pillow script was taken, doesn't include Python 3, however SBo does, so it would be nice to
have it autodetected. :)

Best regards
Philip
_______________________________________________
SlackBuilds-users mailing list
[email protected]
http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - http://slackbuilds.org/faq/

Reply via email to