unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 317f0c542e5970159a76eac85492be58bd79525b 1684 bytes (raw)
name: patches/weasyprint-library-paths.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
Make weasyprint load dynamic libraries from hard-coded path.

From NixOS
pkgs/development/python-modules/weasyprint/library-paths.patch

diff --git a/weasyprint/fonts.py b/weasyprint/fonts.py
index 377716c1..2016e01c 100644
--- a/weasyprint/fonts.py
+++ b/weasyprint/fonts.py
@@ -48,11 +48,8 @@ else:
     # 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',
-                      'libpangoft2-1.0.so', 'libpangoft2-1.0.dylib')
+    fontconfig = dlopen(ffi, '@fontconfig@')
+    pangoft2 = dlopen(ffi, '@pangoft2@')
 
     ffi.cdef('''
         // FontConfig
diff --git a/weasyprint/text.py b/weasyprint/text.py
index 035074e9..08e40395 100644
--- a/weasyprint/text.py
+++ b/weasyprint/text.py
@@ -243,12 +243,9 @@ def dlopen(ffi, *names):
     return ffi.dlopen(names[0])  # pragma: no cover
 
 
-gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so',
-                 'libgobject-2.0.dylib')
-pango = dlopen(ffi, 'pango-1.0', 'libpango-1.0-0', 'libpango-1.0.so',
-               'libpango-1.0.dylib')
-pangocairo = dlopen(ffi, 'pangocairo-1.0', 'libpangocairo-1.0-0',
-                    'libpangocairo-1.0.so', 'libpangocairo-1.0.dylib')
+gobject = dlopen(ffi, '@gobject@')
+pango = dlopen(ffi, '@pango@')
+pangocairo = dlopen(ffi, '@pangocairo@')
 
 gobject.g_type_init()
 

debug log:

solving 317f0c542e5970159a76eac85492be58bd79525b ...
found 317f0c542e5970159a76eac85492be58bd79525b in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).