From 56bea56b2d8fabc4b09d41531177a22d9297ce2c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 21 Jun 2016 18:14:10 +0200 Subject: Fix python version check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chromium requires python version 2.7.6. Adjust the python version check accordingly. Change-Id: I988371a1c132e63f3c57b3aeacdc1a50a8cf2dce Reviewed-by: Michael BrĂ¼ning --- tools/qmake/mkspecs/features/functions.prf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tools/qmake/mkspecs/features/functions.prf') diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 9e8886e86..33bebb47a 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -55,16 +55,20 @@ defineTest(isPlatformSupported) { } defineTest(isPythonVersionSupported) { - python_error_msg = "Python version 2 (2.7 or later) is required to build Qt WebEngine." - python_major_version = $$system('python -c "import sys; print(sys.version_info[0])"') + python_error_msg = "Python version 2 (2.7.6 or later) is required to build Qt WebEngine." + python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"') + python_version ~= s/[()]//g + python_version = $$split(python_version, ',') + python_major_version = $$first(python_version) greaterThan(python_major_version, 2) { skipBuild("Python version 3 is not supported by Chromium.") skipBuild($$python_error_msg) return(false) } - python_minor_version = $$system('python -c "import sys; print(sys.version_info[1])"') - greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true) - skipBuild("Using Python version "$$python_major_version"."$$python_minor_version".") + python_minor_version = $$member(python_version, 1) + python_patch_version = $$member(python_version, 2) + greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 5): return(true) + skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") skipBuild($$python_error_msg) return(false) } -- cgit v1.2.3