nixpkgs/pkgs/development/python-modules/weasyprint/library-paths.patch

39 lines
1.5 KiB
Diff
Raw Normal View History

2019-03-11 12:27:40 +00:00
diff --git a/weasyprint/fonts.py b/weasyprint/fonts.py
2020-12-30 16:08:17 +00:00
index 79e3b5b..4438eb4 100644
2019-03-11 12:27:40 +00:00
--- a/weasyprint/fonts.py
+++ b/weasyprint/fonts.py
2020-12-30 16:08:17 +00:00
@@ -45,11 +45,8 @@ else:
2019-03-11 12:27:40 +00:00
# with OSError: dlopen() failed to load a library: cairo / cairo-2
# So let's hope we find the same file as cairo already did ;)
# Same applies to pangocairo requiring pangoft2
- fontconfig = dlopen(ffi, 'fontconfig', 'libfontconfig',
- 'libfontconfig-1.dll',
- 'libfontconfig.so.1', 'libfontconfig-1.dylib')
- pangoft2 = dlopen(ffi, 'pangoft2-1.0', 'libpangoft2-1.0-0',
2020-12-30 16:08:17 +00:00
- 'libpangoft2-1.0.so.0', 'libpangoft2-1.0.dylib')
2019-03-11 12:27:40 +00:00
+ fontconfig = dlopen(ffi, '@fontconfig@')
+ pangoft2 = dlopen(ffi, '@pangoft2@')
ffi.cdef('''
// FontConfig
diff --git a/weasyprint/text.py b/weasyprint/text.py
2020-12-30 16:08:17 +00:00
index 1dc5e4d..b070bad 100644
2019-03-11 12:27:40 +00:00
--- a/weasyprint/text.py
+++ b/weasyprint/text.py
2020-12-30 16:08:17 +00:00
@@ -255,12 +255,9 @@ def dlopen(ffi, *names):
2019-03-11 12:27:40 +00:00
return ffi.dlopen(names[0]) # pragma: no cover
2020-12-30 16:08:17 +00:00
-gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so.0',
2019-03-11 12:27:40 +00:00
- 'libgobject-2.0.dylib')
2020-12-30 16:08:17 +00:00
-pango = dlopen(ffi, 'pango-1.0', 'libpango-1.0-0', 'libpango-1.0.so.0',
2019-03-11 12:27:40 +00:00
- 'libpango-1.0.dylib')
-pangocairo = dlopen(ffi, 'pangocairo-1.0', 'libpangocairo-1.0-0',
2020-12-30 16:08:17 +00:00
- 'libpangocairo-1.0.so.0', 'libpangocairo-1.0.dylib')
2019-03-11 12:27:40 +00:00
+gobject = dlopen(ffi, '@gobject@')
+pango = dlopen(ffi, '@pango@')
+pangocairo = dlopen(ffi, '@pangocairo@')
gobject.g_type_init()