Browse Source

gnu: python-cairocffi: Fix loading of shared libraries.

Fixes <https://bugs.gnu.org/32170>.

* gnu/packages/patches/python-cairocffi-dlopen-path.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/python.scm (python-cairocffi)[inputs]: Add glib, gtk+, pango.
[native-inputs]: Add python-pytest.
[arguments]: Enable tests.
[arguments]<#:phases>[patch-paths]: New phase.
wip-gnome3.34
Danny Milosavljevic 4 years ago
parent
commit
a545090ce5
No known key found for this signature in database GPG Key ID: E71A35542C30BAA5
  1. 1
      gnu/local.mk
  2. 10
      gnu/packages/patches/python-cairocffi-dlopen-path.patch
  3. 38
      gnu/packages/python.scm

1
gnu/local.mk

@ -1057,6 +1057,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-search-paths.patch \
%D%/packages/patches/python-3-fix-tests.patch \
%D%/packages/patches/python-axolotl-AES-fix.patch \
%D%/packages/patches/python-cairocffi-dlopen-path.patch \
%D%/packages/patches/python-dendropy-fix-tests.patch \
%D%/packages/patches/python-fix-tests.patch \
%D%/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch \

10
gnu/packages/patches/python-cairocffi-dlopen-path.patch

@ -0,0 +1,10 @@
--- cairocffi-0.8.0/cairocffi/__init__.py.orig 2018-07-16 11:00:59.075664158 +0200
+++ cairocffi-0.8.0/cairocffi/__init__.py 2018-07-16 17:09:42.471958015 +0200
@@ -35,6 +35,7 @@
return lib
except OSError:
pass
+ return ffi.dlopen(name)
raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))

38
gnu/packages/python.scm

@ -4210,23 +4210,53 @@ support for Python 3 and PyPy. It is based on cffi.")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"1rk2dvy3fxrga6bvvxc2fi5lbaynm5h4a0w0aaxyn3bc77rszjg9"))))
"1rk2dvy3fxrga6bvvxc2fi5lbaynm5h4a0w0aaxyn3bc77rszjg9"))
(patches (search-patches "python-cairocffi-dlopen-path.patch"))))
(build-system python-build-system)
(outputs '("out" "doc"))
(inputs
`(("gdk-pixbuf" ,gdk-pixbuf)
("cairo" ,cairo)))
`(("glib" ,glib)
("gtk+" ,gtk+)
("gdk-pixbuf" ,gdk-pixbuf)
("cairo" ,cairo)
("pango" ,pango)))
(native-inputs
`(("pkg-config" ,pkg-config)
("python-pytest" ,python-pytest)
("python-sphinx" ,python-sphinx)
("python-docutils" ,python-docutils)))
(propagated-inputs
`(("python-xcffib" ,python-xcffib))) ; used at run time
(arguments
`(;; FIXME: Tests cannot find 'libcairo.so.2'.
#:tests? #f
#:tests? #t
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* (find-files "." "\\.py$")
(("dlopen\\(ffi, 'cairo'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "cairo")
"/lib/libcairo.so.2'"))
(("dlopen\\(ffi, 'gdk-3'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "gtk+")
"/lib/libgtk-3.so.0'"))
(("dlopen\\(ffi, 'gdk_pixbuf-2.0'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "gdk-pixbuf")
"/lib/libgdk_pixbuf-2.0.so.0'"))
(("dlopen\\(ffi, 'glib-2.0'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "glib")
"/lib/libglib-2.0.so.0'"))
(("dlopen\\(ffi, 'gobject-2.0'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "glib")
"/lib/libgobject-2.0.so.0'"))
(("dlopen\\(ffi, 'pangocairo-1.0'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "pango")
"/lib/libpangocairo-1.0.so.0'"))
(("dlopen\\(ffi, 'pango-1.0'")
(string-append "dlopen(ffi, '" (assoc-ref inputs "pango")
"/lib/libpango-1.0.so.0'")))
#t))
(add-after 'install 'install-doc
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((data (string-append (assoc-ref outputs "doc") "/share"))

Loading…
Cancel
Save