Subject: [PATCH 08/12] gnu: Add mupdf/tesseract.

From: David Elsing <[email-masked]>
Date: Wed, 26 Jun 2024 19:27:01 +0000

* gnu/packages/pdf.scm (mupdf/tesseract): New variable.
---
 gnu/packages/pdf.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 232cafcbf1..9e10264fad 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -966,6 +966,20 @@ (define-public mupdf
                    license:silofl1.1    ;resources/fonts/{han,noto,sil,urw}
                    license:asl2.0)))) ; resources/fonts/droid
 
+(define-public mupdf/tesseract
+  (package/inherit mupdf
+    (name (string-append (package-name mupdf) "-with-tesseract"))
+    (inputs (modify-inputs (package-inputs mupdf)
+              (prepend leptonica tesseract-ocr)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments mupdf)
+       ((#:make-flags flags)
+        #~(cons*
+           "tesseract=yes"
+           "USE_SYSTEM_LEPTONICA=yes"
+           "USE_SYSTEM_TESSERACT=yes"
+           #$flags))))))
+
 (define-public qpdf
   (package
     (name "qpdf")
-- 
2.45.1