diff mbox series

[bug#42885,24/27] gnu: calibre: Patch some paths.

Message ID 20210310090053.21612-24-mail@brendan.scot
State Accepted
Headers show
Series [bug#42885,01/27] gnu: python-sip: Update to 5.5.0. Add python-sip-4 | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Brendan Tildesley March 10, 2021, 9 a.m. UTC
* gnu/packages/ebook.scm (calibre):
[inputs]: Add libjpeg and libjxz.
[arguments]: substitute Calibre's weird get_exe_path procedure that looks
in poppler's output directory for binaries with direct paths to
jpegtran, cjpeg, optipng, and JxrDecApp.
---
 gnu/packages/ebook.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 124fcda4df..be367a5245 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -161,6 +161,8 @@ 
        ("icu4c" ,icu4c)
        ("libmtp" ,libmtp)
        ("libpng" ,libpng)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libjxr" ,libjxr)
        ("libusb" ,libusb)
        ("openssl" ,openssl)
        ("optipng" ,optipng)
@@ -246,7 +248,12 @@  sip-include-dirs = [\"" pyqt "/share/sip" "\"]")))
                 (("PDFTOHTML = 'pdftohtml'")
                  (string-append "PDFTOHTML = \"" (assoc-ref inputs "poppler")
                                 "/bin/pdftohtml\"")))
-
+              ;; get_exe_path looks in poppler's output for these binaries.
+              (substitute* "src/calibre/utils/img.py"
+                (("get_exe_path..jpegtran..") (string-append "'" (which "jpegtran") "'"))
+                (("get_exe_path..cjpeg..") (string-append "'" (which "cjpeg") "'"))
+                (("get_exe_path..optipng..") (string-append "'" (which "optipng") "'"))
+                (("get_exe_path..JxrDecApp..") (string-append "'" (which "JxrDecApp") "'")))
               ;; Calibre thinks we are installing desktop files into a home
               ;; directory, but here we butcher the script in to installing
               ;; to calibres /share directory.