Opened 12 years ago

Closed 12 years ago

#34724 closed defect (duplicate)

pygtk fails when cairo built with +no_x11

Reported by: dave@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: Cc: icemac (Michael Howitz)
Port: py27-cairo py27-gtk

Description

/opt/local/bin/python
pluto:/Volumes/plain/Virtual Machines dave% python
Python 2.7.3 (default, Apr 19 2012, 00:55:09) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 40, in <module>
    from gtk import _gtk
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cairo/__init__.py", line 1, in <module>
    from _cairo import *
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cairo/_cairo.so, 2): Symbol not found: _cairo_xlib_surface_get_depth
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cairo/_cairo.so
  Expected in: /opt/local/lib/libcairo.2.dylib
 in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cairo/_cairo.so
% port info cairo
cairo @1.12.2 (graphics)
Variants:             (+)no_x11, opengl, (+)quartz, universal, [-]x11, x11_xcb

Description:          Cairo is a vector graphics library with cross-device output support. It is designed to produce identical output on all output media while taking
                      advantage of display hardware acceleration when available (e.g. through the X Render Extension).
Homepage:             http://cairographics.org/

Extract Dependencies: xz
Build Dependencies:   pkgconfig
Library Dependencies: libpixman, glib2, fontconfig, freetype, libpng, zlib, expat
Conflicts with:       cairo-devel
Platforms:            darwin, macosx
License:              LGPL-2.1 MPL-1.1
Maintainers:          ryandesign@macports.org

Change History (5)

comment:1 Changed 12 years ago by dave@…

I believe I fixed it by adding this to the py27-cairo portfile:

variant quartz conflicts x11 {
    configure.cflags -UCAIRO_HAS_XLIB_SURFACE
}
variant x11 conflicts quartz {}
if {![variant_isset x11] && ![variant_isset quartz]} {
    default_variants +x11
}

The second stanza I took from other Portfiles, which is to say that I'm inexpert at this, and the change should be vetted by someone who knows what they're doing. For what it's worth, I think this change applies to all of the py*-cairo portfiles, and I found quite a few bugs around the tracker that seemed related to this one so if this fix is good you might be able to fix a lot of other things too.

comment:2 Changed 12 years ago by jmroot (Joshua Root)

Port: py27-cairo py27-gtk added

comment:3 Changed 12 years ago by stefan+macports@…

Great, your suggestion fixed my problem starting zim, a pygtk program. Py26-cairo worked fine before and only just recently I got the error listed in the bug description.

comment:4 Changed 12 years ago by icemac (Michael Howitz)

Cc: mh@… added

The suggestion helped me, too.

Last edited 12 years ago by icemac (Michael Howitz) (previous) (diff)

comment:5 Changed 12 years ago by g5pw (Aljaž Srebrnič)

Resolution: duplicate
Status: newclosed

This is basically a duplicate of #34889 (or at least it fails from the same reason)

Note: See TracTickets for help on using tickets.