Opened 9 years ago

Closed 9 years ago

#49838 closed defect (fixed)

qt5-qtwebengine build breaks if default python is python3

Reported by: mamoll (Mark Moll) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: qt5-qtwebengine

Description

The qt5-qtwebengine port uses the default python in the PATH. The build breaks if the default corresponds to python3 because the python code is not compatible with python3 (old-style print statements).

Change History (2)

comment:1 Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Status: newassigned

The offending code seems to come from tools/qmake/mkspecs/features/functions.prf

defineTest(isPythonVersionSupported) {
  python_major_version = $$system('python -c "import sys; print sys.version_info.major"')
  python_minor_version = $$system('python -c "import sys; print sys.version_info.minor"')
  lessThan(python_major_version, 3): greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true)
  skipBuild("Using Python version "$$python_major_version"."$$python_minor_version", but Python version 2 (2.7 or later) is required to build Qt WebEngine.")
  return(false)

Even if the print statement worked, it would still reject python_major_version>=3 by reporting that Python 2.7 or later is required.

I do not see a way of specifying a particular PYTHON program (although I do see many instances of #!/usr/bin/env python.

I committed a workaround in r142959.
Although not ideal, does it fix the problem?

comment:2 Changed 9 years ago by mamoll (Mark Moll)

Resolution: fixed
Status: assignedclosed

I have already installed qt5-qtwebengine now by temporarily selecting python2 as the default, but your commit looks like it should fix things. Thanks.

Note: See TracTickets for help on using tickets.