GNU bug report logs - #42885
[PATCH 0/4] gnu: calibre: Update to 4.22.0.

Previous Next

Package: guix-patches;

Reported by: Brendan Tildesley <mail <at> brendan.scot>

Date: Sun, 16 Aug 2020 06:56:02 UTC

Severity: normal

Tags: patch

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 42885 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 42885 <at> debbugs.gnu.org
Subject: [PATCH 4/4] gnu: calibre: Add wrap phase for qtwebengine.
Date: Sun, 16 Aug 2020 17:03:18 +1000
* gnu/packages/ebook.scm (calibre): [arguments]: Copy the wrap phase
from Anki to wrap QTWEBENGINEPROCESS_PATH. This fixes the 'Could not
find QtWebEngineProcess error' when opening a book with the
ebook-viewer.
---
 gnu/packages/ebook.scm | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index a434f56bc1..31864a0786 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -165,7 +165,10 @@
        ("qtwebengine" ,qtwebengine)
        ("sqlite" ,sqlite)))
     (arguments
-     `(#:python ,python-2
+     `(#:modules ((guix build python-build-system)
+                  (guix build utils)
+                  (ice-9 match))
+       #:python ,python-2
        ;; Calibre is using setuptools by itself, but the setup.py is not
        ;; compatible with the shim wrapper (taken from pip) we are using.
        #:use-setuptools? #f
@@ -252,6 +255,35 @@
               "man-pages"
               (string-append (assoc-ref outputs "out") "/share/man"))
              #t))
+         ;; wrap phase copied from anki package.
+         (add-after 'install 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+                   ;; List of paths to the site-packages directories of Python
+                   ;; library inputs.
+                   (site-packages
+                    (map (lambda (pyinput)
+                           (string-append
+                            (cdr pyinput)
+                            "/lib/python2.7/site-packages"))
+                         (filter (match-lambda
+                                   ((label . _)
+                                    (string-prefix? "python2-" label)))
+                                 inputs)))
+                   (qtwebengineprocess
+                    (string-append (assoc-ref inputs "qtwebengine")
+                                   "/lib/qt5/libexec/QtWebEngineProcess")))
+               ;; The program fails to find the QtWebEngineProcess program, so
+               ;; we set QTWEBENGINEPROCESS_PATH to help it.  PYTHONPATH is
+               ;; wrapped to avoid declaring Python libraries as propagated
+               ;; inputs.
+               (for-each (lambda (program)
+                           (wrap-program program
+                             `("QTWEBENGINEPROCESS_PATH" =
+                               (,qtwebengineprocess))
+                             `("PYTHONPATH" = ,site-packages)))
+                         (find-files bin ".")))
+             #t))
          ;; The font TTF files are used in some miscellaneous tests, so we
          ;; unbundle them here to avoid patching the tests.
          (add-after 'install 'unbundle-font-liberation
-- 
2.28.0





This bug report was last modified 4 years and 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.