Bug 30254

Summary: Can't build pycairo (python 3 version)
Product: pycairo Reporter: Vincent Untz <vuntz>
Component: generalAssignee: Steve Chaplin <d74n5pohf9>
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Vincent Untz 2010-09-18 07:26:19 UTC
+ ./waf configure --prefix=/usr
Checking for program gcc or cc           : /usr/bin/gcc
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for gcc                         : ok
Checking for program python              : /usr/bin/python
Checking for Python version >= 3.1.0     : not found
/usr/src/packages/BUILD/pycairo-1.8.10/wscript:34: error: The python version is too old ('2.7.0')

Except that I do have python3 installed. It's just not named /usr/bin/python since we keep python2 as default for now, but /usr/bin/python3.
Comment 1 Vincent Untz 2010-09-18 11:42:55 UTC
Sounds like a bug in waf: I have to call waf with python3, else it assumes that the python binary to use is the one running waf, instead of using the PYTHON environment variable. I'm not even sure using the PYTHON environment variable would be the recommended way to fix this...
Comment 2 Steve Chaplin 2010-09-18 23:31:28 UTC
I use a shell function to change /usr/bin/python to link to python2.6 or python3
as required, and it works for me.

Or you can call waf as
  $ python3 ./waf configure
Which is the solution you have discovered already.

Or you can edit ./waf to set the line
#!/usr/bin/env python3

What are you trying to do - compile Python 3 code by running Python 2? I don't think that can ever work completely because creating the .pyc and .pyo files requires the correct version of Python.

Possibly waf could run under Python 2, and then call Python 3 as required. But it
would complicate waf. If you think this is a waf bug, and not a limitation, then mail the waf list, or open a waf bug report.
Comment 3 Vincent Untz 2010-09-19 00:22:10 UTC
Really, you should at least document this in INSTALL...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.