Summary: | xpyb support in waf | ||
---|---|---|---|
Product: | pycairo | Reporter: | Martin Scholz <scholz.m82> |
Component: | general | Assignee: | Steve Chaplin <d74n5pohf9> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | Arfrever.FTA, scholz.m82 |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Fix xpyb check in py2cairo
Fix xpyb check in pycairo |
Description
Martin Scholz
2012-05-19 19:08:01 UTC
totally forgot to mention it is the waf I need the way for... :) sometimes I'm to fast in typing Add the following lines to wscript: xpyb_version_required = '1.3' ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required, args='--cflags --libs', mandatory=False) The changes are in the git repository. http://cgit.freedesktop.org/py2cairo/commit/?id=2f1f3788fa2d9b693c77645edc44f35e7073aadd and http://cgit.freedesktop.org/pycairo/commit/?id=cbb102e3d0735028c624583264ce5243d93ef844 added only xpyb.pc file, but xpyb can be installed for different Python version. xpyb currently supports only Python 2, so it can be installed e.g. for Python 2.7 and /usr/lib64/pkgconfig/xpyb.pc will exist, but pycairo built with Python 3.2 will detect xpyb.pc presence and at run time fail with: >>> import cairo Traceback (most recent call last): File "<stdin>", line 1, in <module> File "cairo/__init__.py", line 18, in <module> from ._cairo import * ImportError: cairo/_cairo.cpython-32.so: undefined symbol: PyCObject_Import >>> Please add 'import xcb' check in wscript: try: import xcb except ImportError: pass else: ctx.check_cfg(package='xpyb', ...) (In reply to comment #3) > added only xpyb.pc file added only check for xpyb.pc file I don't think your fix is correct. Waf is designed, I believe, so the version of Python used to configure and build a software package is independent from the version of Python that the package actually uses. Your fix assumes the version of Python waf uses is the same version of Python that the software package will use. When xpyb is released for Python 3, is should probably use a different file name from 'xpyb.pc'. For example for GTK+ the files used are gtk+-2.0.pc gtk+-3.0.pc So each major version of a package has its own .pc file, to avoid clashing with the previous version's file. I've commented out the code in wscript for Python 3, so that should fix the problem for the moment. Created attachment 65519 [details] [review] Fix xpyb check in py2cairo Created attachment 65520 [details] [review] Fix xpyb check in pycairo Please review the new patches, which address the problem mentioned in comment #5. Could these patches be applied? The code update from comment 5 fixes the reported bug. So it is unclear what additional bug your latest patch is addressing, especially as xpyb does not support yet Python 3. Since 1.11 pycairo uses distutils for building. There is a good chance that this bug no longer occurs with the new system. If there are still problems please file a bug: https://github.com/pygobject/pycairo/issues xpyb support can be enabled there by using: "python2 setup.py build --enable-xpyb" (It defaults to off) |
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.