me
/
guix
Archived
1
0
Fork 0

gnu: python-cairocffi: Update to 1.2.0.

* gnu/packages/python-xyz.scm (python-cairocffi): Update to 1.2.0.
[source]: Fetch from Git.
[patches]: Remove field.
[inputs]: Remove pango.
[native-inputs]: Remove pkg-config and python-docutils.  Add python-numpy and
python-sphinx-rtd-theme.
[phases]{patch-paths}: Adjust.  Fix the patching of gdk-3.
{disable-linters}: New phase.
{install-doc}: Adjust.  The license file is now installed by a build phase.
* gnu/packages/patches/python-cairocffi-dlopen-path.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): De-register it.
master
Maxim Cournoyer 2020-11-27 17:07:06 -05:00
parent 1726dad3cc
commit 4035c2e402
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
3 changed files with 44 additions and 44 deletions

View File

@ -1513,7 +1513,6 @@ dist_patch_DATA = \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
%D%/packages/patches/python-axolotl-AES-fix.patch \
%D%/packages/patches/python-cairocffi-dlopen-path.patch \
%D%/packages/patches/python-cross-compile.patch \
%D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
%D%/packages/patches/python-configobj-setuptools.patch \

View File

@ -1,10 +0,0 @@
--- 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))

View File

@ -6056,59 +6056,70 @@ support for Python 3 and PyPy. It is based on cffi.")
(define-public python-cairocffi
(package
(name "python-cairocffi")
(version "0.9.0")
(version "1.2.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "cairocffi" version))
;; The PyPI archive does not include the documentation, so use Git.
(method git-fetch)
(uri (git-reference
(url "https://github.com/Kozea/cairocffi")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0dq3k4zhqd8cwsf3nyjqvjqm8wkvrjn1wjf44rl3v0h8kqx6qf0m"))
(patches (search-patches "python-cairocffi-dlopen-path.patch"))))
"1ypw0c2lr43acn57hbmckk183zq4h477j7p4ig2zjvw0mcpvia50"))))
(build-system python-build-system)
(outputs '("out" "doc"))
(inputs
`(("glib" ,glib)
("gtk+" ,gtk+)
("gdk-pixbuf" ,gdk-pixbuf)
("cairo" ,cairo)
("pango" ,pango)))
("cairo" ,cairo)))
(native-inputs
`(("pkg-config" ,pkg-config)
`(("python-numpy" ,python-numpy)
("python-pytest" ,python-pytest)
("python-pytest-cov" ,python-pytest-cov)
("python-pytest-runner" ,python-pytest-runner)
("python-sphinx" ,python-sphinx)
("python-docutils" ,python-docutils)))
("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
(propagated-inputs
`(("python-xcffib" ,python-xcffib))) ; used at run time
(arguments
`(#: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'")))
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "cairocffi/__init__.py"
;; Hack the dynamic library loading mechanism.
(("find_library\\(library_name\\)")
"\"found\"")
(("filenames = \\(library_filename,\\) \\+ filenames")
"pass")
(("libcairo.so.2")
(string-append (assoc-ref inputs "cairo")
"/lib/libcairo.so.2")))
(substitute* "cairocffi/pixbuf.py"
(("libgdk_pixbuf-2.0.so.0")
(string-append (assoc-ref inputs "gdk-pixbuf")
"/lib/libgdk_pixbuf-2.0.so.0"))
(("libgobject-2.0.so.0")
(string-append (assoc-ref inputs "glib")
"/lib/libgobject-2.0.so.0"))
(("libglib-2.0.so.0")
(string-append (assoc-ref inputs "glib")
"/lib/libglib-2.0.so.0"))
(("libgdk-3.so.0")
(string-append (assoc-ref inputs "gtk+")
"/lib/libgdk-3.so.0")))
#t))
(add-after 'unpack 'disable-linters
;; Their check fails; none of our business.
(lambda _
(substitute* "setup.cfg"
((".*pytest-flake8.*") "")
((".*pytest-isort.*") "")
(("--flake8") "")
(("--isort") ""))
#t))
(add-after 'install 'install-doc
(lambda* (#:key inputs outputs #:allow-other-keys)
@ -6123,7 +6134,7 @@ support for Python 3 and PyPy. It is based on cffi.")
(for-each (lambda (file)
(copy-file (string-append "." file)
(string-append doc file)))
'("/README.rst" "/CHANGES" "/LICENSE"))
'("/README.rst" "/NEWS.rst"))
(system* "python" "setup.py" "build_sphinx")
(copy-recursively "docs/_build/html" html)
#t))))))