GNOME Bugzilla – Bug 668309
as-python.m4 should be updated or removed in favor of standard automake AM_PATH_PYTHON
Last modified: 2012-11-21 21:17:55 UTC
Building gst-plugins-base-0.10.35 on x86_64-sun-solaris2.10. There are several minor issues with the common/m4/as-python.m4 macro. - its version checks are out of date. It checks for a python binary named "python2.2", but not python2.7, python2.6, etc. - much of the code in the checks that actually uses python to determine things (like PYTHON_VERSION & PYTHON_PLATFORM) is not compatible with python3. A few of the Linux distributions are planning to convert to python3, so the version check should really be modified so that it prefers a binary named "python2" over one just named "python", as the day is coming when "python" is a 3.x binary. - it just assumes that whatever python binary it finds, the prefix it's installed under is going to be the same as ${prefix}. That's a bad assumption, and it's not needed; you can just ask python what its prefix is, similar to how a test is already asking python what its platform and version are. The test is just PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"` - same is true for PYTHON_EXEC_PREFIX: PYTHON_EXEC_PREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"` - same is true for pythondir and pkgpyexecdir; just ask python: # note distutils requires python > 1.5 pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(plat_specific=1)"` I have a patch that addresses all of these things, but I'm also kind of wondering if the common/as/as-python.m4 could just be removed, in favor of the standard AM_PATH_PYTHON macro that comes with automake. That macro even appears to work with python3.x, though that isn't much help with the python code in gst-plugins-base doesn't work with 3.x. Let me know if you want the patch, or if you would like me to instead provide a patch that just converts to using AM_PATH_PYTHON.
Note that all the same comments apply to gst-plugins-good, gst-plugins-bad, etc.
I'm not a python guy, but it seems to me that AM_PATH_PYTHON is the way to go. The common/gen-changelog.py script should just be changed to python3 unconditionally if it doesn't work with that out of the box yet (or hardcoded to use python2) - only the people who do releases use that anyway. As for the rest, I think we only use python for the gtk-doc stuff, and even then possibly only when building from git (?). We should check what the plans are for gtk-doc.
I think this is fixed now in git master. *** This bug has been marked as a duplicate of bug 563903 ***