guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: calibre: Clean up 'wrap phase.


From: guix-commits
Subject: branch master updated: gnu: calibre: Clean up 'wrap phase.
Date: Fri, 18 Sep 2020 09:21:28 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new d9dec14  gnu: calibre: Clean up 'wrap phase.
d9dec14 is described below

commit d9dec1473d676dd22285e84552d4a8e0a879f0d4
Author: Prafulla Giri <pratheblackdiamond@gmail.com>
AuthorDate: Tue Sep 15 17:13:36 2020 +0545

    gnu: calibre: Clean up 'wrap phase.
    
    Based on the suggestion of the author, this commit cleans up the
    changes introduced by fd3eac4dd774597d493e6d8aae7b1c2653070bc7
    
    For more information, see: https://issues.guix.gnu.org/43249
    
    * gnu/packages/e-book.scm (calibre):
    [arguments]: Remove the manual 'wrap phase replacement and add a
    'wrap-program phase after standard 'wrap phase to make the runtime
    dependency QtWebEngineProcess available to the binaries.
    
    Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 gnu/packages/ebook.scm | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index a8212df..922a524 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -252,29 +252,7 @@
                      "--path-to-mathjax" (string-append
                                           (assoc-ref inputs "js-mathjax")
                                           "/share/javascript/mathjax"))
-             (invoke "python2" "setup.py" "rapydscript")))
-         (replace 'wrap
-           ;; Here we wrap PYTHONPATH exactly as it would be in
-           ;; python-build-system, plus the addition of
-           ;; QTWEBENGINEPROCESS_PATH, fixing a bug where Calibre would not
-           ;; find Qtwebengine.
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin"))
-                    (python (assoc-ref inputs "python"))
-                    (site-packages
-                     (cons (string-append out "/lib/python"
-                                          (python-version python)
-                                          "/site-packages")
-                           (search-path-as-string->list (getenv 
"PYTHONPATH"))))
-                    (qtwebengineprocess
-                     (string-append (assoc-ref inputs "qtwebengine")
-                                    "/lib/qt5/libexec/QtWebEngineProcess")))
-               (for-each (lambda (program)
-                           (wrap-program program
-                                 `("QTWEBENGINEPROCESS_PATH" = 
(,qtwebengineprocess))
-                                 `("PYTHONPATH" prefix ,site-packages)))
-                         (find-files bin ".")))
+             (invoke "python2" "setup.py" "rapydscript")
              #t))
          (add-after 'install 'install-man-pages
            (lambda* (#:key outputs #:allow-other-keys)
@@ -292,6 +270,28 @@
                                             "/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")))))
+                  ;; Wrap all the binaries shipping with the package, except
+                  ;; for the wrappings created during the 'wrap standard
+                  ;; phase.  This extends existing .calibre-real wrappers
+                  ;; rather than create ..calibre-real-real-s.  For more
+                  ;; information see: https://issues.guix.gnu.org/43249.
+                  (find-files "." (lambda (file stat)
+                                    (not (wrapper? file)))))))
              #t)))))
     (home-page "https://calibre-ebook.com/";)
     (synopsis "E-book library management software")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]