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 634082 - [0.10] gst-python does not compile if python 3 is default compiler
[0.10] gst-python does not compile if python 3 is default compiler
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-python
unspecified
Other Linux
: Normal blocker
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 681558 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-11-05 14:42 UTC by Thijs Vermeir
Modified: 2012-12-17 11:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: check for python>2.3 (652 bytes, patch)
2010-11-15 16:30 UTC, Thijs Vermeir
rejected Details | Review
Compilation failure log (620 bytes, application/octet-stream)
2012-08-10 21:52 UTC, Adrian Zgorzałek
  Details

Description Thijs Vermeir 2010-11-05 14:42:47 UTC
I have python 3 as the default python on my system.

I have 2 problems with this:
* I can't find any configuration option to specify the python version, the only check that is done is that the python version > 2.3. Looks like it is not possible to build for a non-default python version (if python2 is also installed next to python3)
* Build on python 3 does not work.

configure passes but gives some ugly output, compile failes:

checking for python... /usr/bin/python
checking for python version... 3.1
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python3.1/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.1/site-packages
checking for python >= 2.3... okay
checking for headers required to compile python extensions...   File "<string>", line 1
    import sys; print sys.prefix
                        ^
SyntaxError: invalid syntax
  • File "<string>", line 1
    import sys; print sys.exec_prefix
SyntaxError: invalid syntax
found
...
Building against GStreamer core 0.10.30 , ignoring API additions if needed
checking for GST_BASE... yes
checking for GST_CONTROLLER... yes
checking for GST_NET... yes
checking for GST_DP... yes
checking for GST_PLUGINS_BASE... yes
checking for PYGOBJECT... yes
yes
checking for PYGOBJECT_2_12... yes
yes
checking for PYGOBJECT_2_16... yes
yes
...
checking for libraries required to embed python...   File "<string>", line 1
    import distutils.sysconfig as s; print s.get_python_lib(standard_lib=1)
                                           ^
SyntaxError: invalid syntax
yes


error for build:

make[3]: Entering directory `/home/tvermeir/devel/jhbuild_root/gst-python/gst'
  CC     _gst_la-gstmodule.lo
gstmodule.c:153:1: warning: return type defaults to 'int'
gstmodule.c: In function 'DL_EXPORT':
gstmodule.c:154:1: error: expected declaration specifiers before 'init_gst'
gstmodule.c:417:1: error: expected '{' at end of input
make[3]: *** [_gst_la-gstmodule.lo] Error 1
Comment 1 Thijs Vermeir 2010-11-15 16:30:33 UTC
Created attachment 174520 [details] [review]
build: check for python>2.3
Comment 2 Alessandro Decina 2010-11-19 18:31:04 UTC
The patch is not enough afaiu. What is giving errors during configure are our own custom checks in acinclude.m4.

Also, as far as I can see, AM_PATH_PYTHON and AS_PATH_PYTHON do the same thing, except that the latter looks like it hasn't been updated for a while.

I'll try to compile with python3 as the default python and post an update.
Comment 3 Thijs Vermeir 2010-11-22 15:18:35 UTC
Indeed, this fixes only building with the non-default python2 compiler. It doesn't pickes the default 3.0 compiler.

But this is also used in gnonlin, so I guess it's better than current implementation. Probably this should be better synchronized between different gst* modules.
Comment 4 vineeth 2010-12-01 15:41:05 UTC
The fix for this would be to add braces around print, i.e:
 print (s.get_python_lib(standard_lib=1))
Another easy option would be to run 2to3 ( http://docs.python.org/library/2to3.html ), but not certain about the backward compatibility.
Comment 5 Tim-Philipp Müller 2010-12-01 15:49:38 UTC
Can this be worked around by setting the PYTHON environment variable when calling configure?
Comment 6 Kibeom Kim 2011-07-25 16:28:16 UTC
how about let the installer script call 'python2' instead of 'python'. I think that's the most right way.
and separate pygst2 and pygst3
Comment 7 Tim-Philipp Müller 2012-08-09 23:06:07 UTC
*** Bug 681558 has been marked as a duplicate of this bug. ***
Comment 8 Adrian Zgorzałek 2012-08-10 21:52:59 UTC
Created attachment 220915 [details]
Compilation failure log

I tried to compile and failed with the attached log.
I also tried patching this configure and after autoconf, ./configure I get the same error during make.

My python is changed so that it points to python2 instead of 3, so the other fix fails as well:
$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 7 07-26 21:34 /usr/bin/python -> python2

Any ideas?

I would like to build pitivi with ges, but can't because of gst-python which is dependency...
Comment 9 Sebastian Dröge (slomo) 2012-12-17 11:40:47 UTC
Closing this bug now, gst-python is only an extension module to pygi now and this bug doesn't make much sense anymore in this context.

Also Tim changed many things to work with Python 3 lately.