From 35a1af63e825175d29e4aa08c507b25d3335d5be Mon Sep 17 00:00:00 2001
From: Matteo Bernardini <ponce@slackbuilds.org>
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 <ponce@slackbuilds.org>
---
 python/python-magic/python-magic.SlackBuild | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'python/python-magic/python-magic.SlackBuild')

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