summaryrefslogtreecommitdiff
path: root/python/python-magic
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2021-07-26 10:19:55 +0200
committerRobby Workman <rworkman@slackbuilds.org>2021-07-28 18:02:33 -0500
commit35a1af63e825175d29e4aa08c507b25d3335d5be (patch)
tree68a45eb96f3500a594493c05d8f3539fb6c33060 /python/python-magic
parent254c61e8499a67fe02a75bd996e5668ca12424f4 (diff)
downloadslackbuilds-35a1af63e825175d29e4aa08c507b25d3335d5be.tar.gz
python/python-magic: Autodetect python3.
It should be already available... Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'python/python-magic')
-rw-r--r--python/python-magic/README3
-rw-r--r--python/python-magic/python-magic.SlackBuild7
2 files changed, 4 insertions, 6 deletions
diff --git a/python/python-magic/README b/python/python-magic/README
index 8bc4218600..affb883362 100644
--- a/python/python-magic/README
+++ b/python/python-magic/README
@@ -2,5 +2,4 @@ This module uses ctypes to access the libmagic file type identification
library. It makes use of the local magic database and supports both textual
and MIME-type output.
-Note: To install python3 bindings pass PYTHON3=yes to the slackbuild.
- # PYTHON3=yes ./python-magic.SlackBuild
+python3 is an optional dependency (autodetected).
diff --git a/python/python-magic/python-magic.SlackBuild b/python/python-magic/python-magic.SlackBuild
index 991344a525..3a2cfabc0d 100644
--- a/python/python-magic/python-magic.SlackBuild
+++ b/python/python-magic/python-magic.SlackBuild
@@ -67,10 +67,9 @@ find -L . \
python2 setup.py install --root=$PKG
-# Install for python3. Default is no.
-if [ "${PYTHON3:-no}" == "yes" ]; then
- rm -rf build
- python3 setup.py install --root=$PKG
+# Add Python3 support
+if $(python3 -c 'import sys' 2>/dev/null); then
+ python3 setup.py install --root=$PKG
fi
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \