summaryrefslogtreecommitdiff
path: root/python/pytz
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-01-19 08:52:40 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-01-19 08:53:16 +0700
commitf541ffa506ba0ac3dee5ae8583c3aa633d4a309d (patch)
tree99b45f2beed81fcc13cf32420d7a6d58e5159e91 /python/pytz
parentaae8051ee16c18fd0994ffe7f96f27634a69e29d (diff)
downloadslackbuilds-f541ffa506ba0ac3dee5ae8583c3aa633d4a309d.tar.gz
python/pytz: Add python3 support by default.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/pytz')
-rw-r--r--python/pytz/README5
-rw-r--r--python/pytz/pytz.SlackBuild8
2 files changed, 5 insertions, 8 deletions
diff --git a/python/pytz/README b/python/pytz/README
index fe43022964..0c4151713e 100644
--- a/python/pytz/README
+++ b/python/pytz/README
@@ -4,7 +4,4 @@ or higher. It also solves the issue of ambiguous times at the end
of daylight savings, which you can read more about in the Python
Library Reference (datetime.tzinfo).
-python3 is an optional dependency. You need to set PYTHON3=yes,
-for example:
-
- PYTHON3=yes ./pytz.SlackBuild
+python3 is auto-detected at build time.
diff --git a/python/pytz/pytz.SlackBuild b/python/pytz/pytz.SlackBuild
index 38f1076691..97a3befea3 100644
--- a/python/pytz/pytz.SlackBuild
+++ b/python/pytz/pytz.SlackBuild
@@ -57,12 +57,12 @@ find -L . \
python setup.py install --root=$PKG
-# Install python3 bindings. Default is no.
-if [ "${PYTHON3:-no}" = "yes" ]; then
- python3 setup.py install --root=$PKG
+# Python 3 support.
+if $(python3 -c 'import sys' 2>/dev/null); then
+ python3 setup.py install --root=$PKG
fi
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION