python.pkgs.cairocffi: support darwin

This commit is contained in:
Orivej Desh 2018-06-06 07:17:52 +00:00
parent 46dfe1eca8
commit 832973d179
2 changed files with 7 additions and 5 deletions

View file

@ -1,5 +1,6 @@
# FIXME: make gdk_pixbuf dependency optional
{ buildPythonPackage
{ stdenv
, buildPythonPackage
, fetchPypi
, lib
, substituteAll
@ -42,6 +43,7 @@ buildPythonPackage rec {
# OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0
(substituteAll {
src = ./dlopen-paths.patch;
ext = stdenv.hostPlatform.extensions.sharedLibrary;
cairo = cairo.out;
glib = glib.out;
gdk_pixbuf = gdk_pixbuf.out;

View file

@ -16,10 +16,10 @@ index 718aa7f..1a1dcff 100644
+# Use hardcoded soname, because ctypes.util use gcc/objdump which shouldn't be required for runtime
+_LIBS = {
+ 'cairo': '@cairo@/lib/libcairo.so.2',
+ 'glib-2.0': '@glib@/lib/libglib-2.0.so.0',
+ 'gobject-2.0': '@glib@/lib/libgobject-2.0.so.0',
+ 'gdk_pixbuf-2.0': '@gdk_pixbuf@/lib/libgdk_pixbuf-2.0.so.0',
+ 'cairo': '@cairo@/lib/libcairo@ext@',
+ 'glib-2.0': '@glib@/lib/libglib-2.0@ext@',
+ 'gobject-2.0': '@glib@/lib/libgobject-2.0@ext@',
+ 'gdk_pixbuf-2.0': '@gdk_pixbuf@/lib/libgdk_pixbuf-2.0@ext@',
+}
-def dlopen(ffi, *names):