summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-11-27 17:07:06 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-11-29 14:02:46 -0500
commit4035c2e402eb7ff42ecceacd927f34997367cdf5 (patch)
tree32f761418adc72dbb95e2bdd48893f76c9fc15c1
parent1726dad3cc55041099491550ead0e772eea02df3 (diff)
downloadguix-4035c2e402eb7ff42ecceacd927f34997367cdf5.tar.gz
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.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/python-cairocffi-dlopen-path.patch10
-rw-r--r--gnu/packages/python-xyz.scm77
3 files changed, 44 insertions, 44 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 8f9ed312bb..0fd2f788c0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -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	\
diff --git a/gnu/packages/patches/python-cairocffi-dlopen-path.patch b/gnu/packages/patches/python-cairocffi-dlopen-path.patch
deleted file mode 100644
index e7a7fe3737..0000000000
--- a/gnu/packages/patches/python-cairocffi-dlopen-path.patch
+++ /dev/null
@@ -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))
- 
- 
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 30dacdc8af..931786846a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -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))))))