Skip to content

Commit

Permalink
Fix library names tried by dlopen
Browse files Browse the repository at this point in the history
Related to #119.
  • Loading branch information
liZe committed Aug 10, 2019
1 parent f1ef560 commit 8792536
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cairocffi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def dlopen(ffi, *names):
return ffi.dlopen(names[0]) # pragma: no cover


cairo = dlopen(ffi, 'cairo', 'cairo-2', 'libcairo.so.2')
cairo = dlopen(ffi, 'cairo', 'cairo-2', 'libcairo.so')


class _keepref(object):
Expand Down
13 changes: 9 additions & 4 deletions cairocffi/pixbuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@

__all__ = ['decode_to_image_surface']

gdk_pixbuf = dlopen(ffi, 'gdk_pixbuf-2.0', 'gdk_pixbuf-2.0-0')
gobject = dlopen(ffi, 'gobject-2.0', 'gobject-2.0-0')
glib = dlopen(ffi, 'glib-2.0', 'glib-2.0-0', 'glib-2.0.so')
gdk_pixbuf = dlopen(
ffi, 'gdk_pixbuf-2.0', 'gdk_pixbuf-2.0-0', 'libgdk_pixbuf-2.0.so')
gobject = dlopen(
ffi, 'gobject-2.0', 'gobject-2.0-0', 'libgobject-2.0.so')
glib = dlopen(
ffi, 'glib-2.0', 'glib-2.0-0', 'libglib-2.0.so')
try:
gdk = dlopen(ffi, 'gdk-3', 'gdk-x11-2.0', 'gdk-win32-2.0-0')
gdk = dlopen(
ffi, 'gdk-3', 'gdk-2', 'gdk-x11-2.0', 'gdk-win32-2.0-0', 'libgdk-3.so',
'libgdk-x11-2.0.so')
except OSError:
gdk = None

Expand Down

0 comments on commit 8792536

Please sign in to comment.