Waf fails to build with python3
Submitted by John Ralls
Link to original bug (#746271)
Description
Created attachment 299490 Use python_cmd as the first item in cmd lists.
Waf files are generally distributed with #!/usr/bin/env python, but Python3 installs itself as python3 rather than python; besides, python2 is required to run gobject-introspection (see bug 679348), so a dual-python installation is required to build Python3 Gtk applications. That causes waf to use python2, which runs the python-config instead of python3-config and results in linking the wrong library.
Waf.py provides an attribute python_cmd to override the python, but it's used only to set $PYTHON; since waf doesn't use $PYTHON that doesn't help. The attached patch puts self.python_cmd as the first argument of the cmd lists passed to buildscript.execute overriding the shebang line in waf.
Patch 299490, "Use python_cmd as the first item in cmd lists.":
0001-Use-self.python_cmd-as-the-first-arg-in-waf-cmd-list.patch