summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2019-01-21 10:52:10 +0100
committerMathieu Othacehe <m.othacehe@gmail.com>2019-01-21 10:56:24 +0100
commitb65b78ff386978ea4f29ddf2c913ed0fe3d582d0 (patch)
tree388372b6137aedc7d15771f4e18f10b2dc59bcbb
parent26e4203be1044f6aa2004289864f5e1a421d7c88 (diff)
downloadguix-b65b78ff386978ea4f29ddf2c913ed0fe3d582d0.tar.gz
gnu: calibre: Fix PDF to EPUB conversion.
When trying to convert a PDF to EPUB, the following error occurs:

File "/gnu/store/kz6bgqw9z7akj11zh20wkx14cgq0s3n2-calibre-3.35.0/lib/calibre/calibre/ebooks/pdf/pdftohtml.py", line 76, in pdftohtml
    _('Could not find pdftohtml, check it is in your PATH'))

Hardcode pdftohtml binary path by patching pdftohtml.py.

* gnu/packages/ebook.scm (calibre)[arguments]: Patch pdftohtml.py in
'configure phase to set hardcode pdftohtml binary path.
-rw-r--r--gnu/packages/ebook.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 285925866c..0ab482c428 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -177,6 +177,10 @@
                   (pyqt (assoc-ref inputs "python2-pyqt")))
               (substitute* "setup/build_environment.py"
                 (("sys.prefix") (string-append "'" pyqt "'")))
+              (substitute* "src/calibre/ebooks/pdf/pdftohtml.py"
+                (("PDFTOHTML = 'pdftohtml'")
+                 (string-append "PDFTOHTML = \"" (assoc-ref inputs "poppler")
+                  "/bin/pdftohtml\"")))
               (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo"))
               (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib"))
               #t)))