Subject: bug#43249: closed (Re: bug#43151: Resolve Calibre run-time dependency)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 08 Sep 2020 20:13:03 +0000

Your bug report

#43249: Resolve Calibre run-time dependency

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
43249: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43249
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#43151: Resolve Calibre run-time dependency
From: Andreas Enge <[email-masked]>
To: Brendan Tildesley <[email-masked]>
Cc: [email-masked], [email-masked], Prafulla Giri <[email-masked]>, [email-masked]
Date: Tue, 8 Sep 2020 22:11:44 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

On Mon, Sep 07, 2020 at 06:15:15PM +1000, Brendan Tildesley wrote:
> Your patch also works I think but it will wrap the programs twice, so
> you will get calibre, .calibre-real, and ..calibre-real-real, etc for
> every program, which seems ugly. My patch reproduces the same PYTHONPATH
> that is set in python-build-system in addition to wrapping PYTHONPATH
> (unless I made a mistake), although at the cost of code duplication. I
> leave it to you and who ever is reviewing this to decide which way is
> more correct and push one, haha.

thanks to both of your for your patches! I just pushed Brendan's, which
wraps only once at the price of copy-pasting from another package. I confirm
that it works, also to click on an epub file from within calibre. Closing
the two bugs asking about qtwebengine.

Concerning the update, is mathjax a required input now, or could we just
leave it out and update nevertheless?

Andreas

Subject: Resolve Calibre run-time dependency
From: Prafulla Giri <[email-masked]>
To: [email-masked]
Date: Mon, 7 Sep 2020 00:17:23 +0545
List-Id: <debbugs-submit.debbugs.gnu.org>

Esteemed maintainers,

Currently, Calibre can't open .epub files unless `qtwebengine` package is
also available in one's $GUIX_PROFILE. Neither can the stand-alone
`ebook-viewer` program supplied with Calibre. It exits with the complaint:
"Could not find QtWebEngineProcess".

Attached is a patch to fix the issue. QtWebEngineProcess is now made
available to all Calibre binaries via QTWEBENGINE_PATH set during a new
'wrap-program phase introduced with the patch.

Thank you
From cec0d8adf456eff2201fd89bb1fde6cba9d6fa77 Mon Sep 17 00:00:00 2001
From: Prafulla Giri <[email-masked]>
Date: Sun, 6 Sep 2020 23:57:14 +0545
Subject: [PATCH] gnu: calibre: make QtWebEngineProcess available during
 runtime

* gnu/packages/ebook.scm [arguments]: Add new phase 'wrap-program
to make QtWebEngineProcess available to the binaries during run-
time with QTWEBENGINEPROCESS_PATH.
---
 gnu/packages/ebook.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index aab4155d3d..f63d284afb 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -262,6 +262,22 @@
                                             "/share/fonts/truetype")))
                (delete-file-recursively font-dest)
                (symlink font-src font-dest))
+             #t))
+         ;; Make run-time dependencies available to the binaries
+         (add-after 'wrap 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (qtwebengine (assoc-ref inputs "qtwebengine")))
+               (with-directory-excursion (string-append out "/bin")
+                 (for-each
+                  (lambda (binary)
+                    (wrap-program binary
+                      ;; Make QtWebEngineProcess available
+                      `("QTWEBENGINEPROCESS_PATH" ":" =
+                        ,(list (string-append
+                                qtwebengine
+                                "/lib/qt5/libexec/QtWebEngineProcess")))))
+                  (find-files "." "."))))
              #t)))))
     (home-page "https://calibre-ebook.com/")
     (synopsis "E-book library management software")
-- 
2.28.0