gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-backoffice] branch master updated: configure: detect


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] branch master updated: configure: detect python and python modules in a more reliable way.
Date: Wed, 24 Apr 2019 13:26:59 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new 0afa59b  configure: detect python and python modules in a more 
reliable way.
0afa59b is described below

commit 0afa59bbd83b0af1b1c15fbfb4de15082fa249a5
Author: ng0 <address@hidden>
AuthorDate: Wed Apr 24 11:26:34 2019 +0000

    configure: detect python and python modules in a more reliable way.
---
 configure.ac | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 879c84f..ccd791f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,26 +14,29 @@ pyheaders=0
 PC_PYTHON_CHECK_HEADERS([pyheaders=1])
 PC_PYTHON_CHECK_VERSION()
 
-#
-# Check for pip3
-#
 
-AC_MSG_CHECKING([pip3])
-pip3 --version >/dev/null
-if test $? -ne 0;
-  then
-  AC_MSG_ERROR([Please install pip3>=6.0])
-fi
+# Get python executable name
+m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 
python3.6 python3.7 python])
+AM_PATH_PYTHON([3.4],, [:])
+AC_SUBST([PYTHON])
+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 
-VERSION=$(pip3 --version | $AWK '{ print $2 }')
+#
+# Check for pip3
+# Since it is either pip3 or pip[3.4,3.5,3.6,3.7],
+# we check using python module loading.
+PIP_EXE="$PYTHON -m pip"
+PIP_VERSION=$($PIP_EXE -V | grep -v "No module named" | tr -d '\n' | $AWK '{ 
print $2 }')
 
-AC_MSG_RESULT([$VERSION])
+VERSION=$PIP_VERSION
+AC_MSG_RESULT([pip3 version: $VERSION])
 
 AX_COMPARE_VERSION([$VERSION],[lt],[6.0], [AC_MSG_ERROR([Please install 
pip3>=6.0])])
 
 # On Debian systems, we may need to pass "--system" to pip3 to get
 # to the desired installation target directory
-pip3 install --help | grep '\-\-system' >> /dev/null
+AC_MSG_CHECKING([for pip3 --system])
+$PIP_EXE install --help | grep '\-\-system' >> /dev/null
 if test $? -ne 0;
 then
    DEBIAN_PIP3_SYSTEM=""
@@ -63,7 +66,7 @@ fi
 # Check for minifier
 #
 AC_MSG_CHECKING([jsmin])
-python3 -m jsmin &> /dev/null
+$PYTHON -m jsmin | grep -v "No module named" > /dev/null
 if test $? -ne 0;
   then
   AC_MSG_ERROR([Please install Python3 module 'jsmin'])

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]