After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668309 - as-python.m4 should be updated or removed in favor of standard automake AM_PATH_PYTHON
as-python.m4 should be updated or removed in favor of standard automake AM_PA...
Status: RESOLVED DUPLICATE of bug 563903
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Solaris
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-19 23:55 UTC by Tim Mooney
Modified: 2012-11-21 21:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim Mooney 2012-01-19 23:55:10 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.
Comment 1 Tim Mooney 2012-01-20 01:00:41 UTC
Note that all the same comments apply to gst-plugins-good, gst-plugins-bad, etc.
Comment 2 Tim-Philipp Müller 2012-01-21 13:34:15 UTC
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.
Comment 3 Tim-Philipp Müller 2012-11-21 21:17:55 UTC
I think this is fixed now in git master.

*** This bug has been marked as a duplicate of bug 563903 ***