From 35a1af63e825175d29e4aa08c507b25d3335d5be Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Mon, 26 Jul 2021 10:19:55 +0200 Subject: python/python-magic: Autodetect python3. It should be already available... Signed-off-by: Matteo Bernardini --- python/python-magic/README | 3 +-- python/python-magic/python-magic.SlackBuild | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'python/python-magic') diff --git a/python/python-magic/README b/python/python-magic/README index 8bc42186004a1..affb8833624f0 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 991344a525f0b..3a2cfabc0d5ad 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 \ -- cgit v1.2.3