Merge branch 'origin/core-updates-next' into core-updates
[jackhill/guix/guix.git] / gnu / packages / pdf.scm
index a528b7a..a215fce 100644 (file)
@@ -4,15 +4,16 @@
 ;;; Copyright © 2014, 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
-;;; Coypright © 2016 ng0 <ng0@we.make.ritual.n0.is>
-;;; Coypright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
-;;; Coypright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Coypright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
-;;; Coypright © 2016 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
+;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +44,7 @@
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
@@ -58,6 +60,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages javascript)
   #:use-module (gnu packages lesstif)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
 (define-public poppler
   (package
    (name "poppler")
-   (version "0.59.0")
+   (version "0.64.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://poppler.freedesktop.org/poppler-"
                                 version ".tar.xz"))
             (sha256
              (base32
-              "0hcnghliyr8pr887qza18qfgaclw5jr889g1cjcglkni9jr2dmm3"))))
-   (build-system gnu-build-system)
+              "1cb4gz3h7cfqyphhx71qc9mp417bdphchbfghmvhcy4zm4ngj7dj"))))
+   (build-system cmake-build-system)
    ;; FIXME:
    ;;  use libcurl:        no
    (inputs `(("fontconfig" ,fontconfig)
@@ -93,7 +96,7 @@
              ("libpng" ,libpng)
              ("libtiff" ,libtiff)
              ("lcms" ,lcms)
-             ("openjpeg-1" ,openjpeg-1) ; prefers openjpeg-1
+             ("openjpeg" ,openjpeg)
              ("zlib" ,zlib)
 
              ;; To build poppler-glib (as needed by Evince), we need Cairo and
    (arguments
     `(#:tests? #f ; no test data provided with the tarball
       #:configure-flags
-      '("--enable-xpdf-headers" ; to install header files
-        "--enable-zlib"
-
-        ;; Saves 8 MiB of .a files.
-        "--disable-static")
-      #:phases
-      (modify-phases %standard-phases
-        (add-before 'configure 'setenv
-          (lambda _
-            (setenv "CPATH"
-                    (string-append (assoc-ref %build-inputs "openjpeg-1")
-                                   "/include/openjpeg-1.5"
-                                   ":" (or (getenv "CPATH") "")))
-            #t)))))
+      (let* ((out (assoc-ref %outputs "out"))
+             (lib (string-append out "/lib")))
+        (list "-DENABLE_XPDF_HEADERS=ON" ; to install header files
+              "-DENABLE_ZLIB=ON"
+              (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
+              (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
    (synopsis "PDF rendering library")
    (description
     "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
    (license license:gpl2+)
    (home-page "https://poppler.freedesktop.org/")))
 
+(define-public poppler-data
+  (package
+    (name "poppler-data")
+    (version "0.4.9")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://poppler.freedesktop.org/poppler-data"
+                                  "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f ; no test suite
+       #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         ;; The package only provides some data files, so there is nothing to
+         ;; build.
+         (delete 'configure)
+         (delete 'build))))
+    (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
+    (description "This package provides optional encoding files for Poppler.
+When present, Poppler is able to correctly render CJK and Cyrillic text.")
+    (home-page (package-home-page poppler))
+    ;; See COPYING in the source distribution for more information about
+    ;; the licensing.
+    (license (list license:bsd-3
+                   license:gpl2))))
+
 (define-public poppler-qt4
   (package (inherit poppler)
    (name "poppler-qt4")
    (name "poppler-qt5")
    (inputs `(("qtbase" ,qtbase)
              ,@(package-inputs poppler)))
-   (arguments
-    (substitute-keyword-arguments (package-arguments poppler)
-     ((#:configure-flags flags)
-       `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
    (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
 
 (define-public python-poppler-qt4
@@ -322,7 +343,7 @@ reading and editing of existing PDF files.")
 (define-public zathura-cb
   (package
     (name "zathura-cb")
-    (version "0.1.6")
+    (version "0.1.7")
     (source (origin
               (method url-fetch)
               (uri
@@ -330,11 +351,9 @@ reading and editing of existing PDF files.")
                               version ".tar.gz"))
               (sha256
                (base32
-                "1fim4mpm8l2g3msj1vg70ks3c9lrwllv3yh4jv8l9f8k3r19b3l8"))))
+                "0r4viisycj39kaz4281cmkr7n9w5q96dmlf7nf45n8zq8qy2npw3"))))
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (propagated-inputs `(("girara" ,girara)))
     (inputs `(("libarchive" ,libarchive)
-              ("gtk+" ,gtk+)
               ("zathura" ,zathura)))
     (build-system gnu-build-system)
     (arguments
@@ -353,7 +372,7 @@ using libarchive.")
 (define-public zathura-ps
   (package
     (name "zathura-ps")
-    (version "0.2.4")
+    (version "0.2.5")
     (source (origin
               (method url-fetch)
               (uri
@@ -361,11 +380,9 @@ using libarchive.")
                               version ".tar.gz"))
               (sha256
                (base32
-                "1nxbl0glnzpan78fhdfzhkcd0cikcvrkzf9m56mb0pvnwzlwg7zv"))))
+                "1x4knqja8pw2a5cb3y2209nr3iddj1z8nwasy48v5nprj61fdxqj"))))
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (propagated-inputs `(("girara" ,girara)))
     (inputs `(("libspectre" ,libspectre)
-              ("gtk+" ,gtk+)
               ("zathura" ,zathura)))
     (build-system gnu-build-system)
     (arguments
@@ -384,7 +401,7 @@ using libspectre.")
 (define-public zathura-djvu
   (package
     (name "zathura-djvu")
-    (version "0.2.6")
+    (version "0.2.7")
     (source (origin
               (method url-fetch)
               (uri
@@ -392,12 +409,10 @@ using libspectre.")
                               version ".tar.gz"))
               (sha256
                (base32
-                "0py0ra44f65cg064xzds0qr6vnglj2a5bwhnbwa0dyh2nyizdzmf"))))
+                "1sbfdsyp50qc85xc4458sn4w1rv1qbygdwmcr5kjlfpsmdq98vhd"))))
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (propagated-inputs `(("girara" ,girara)))
     (inputs
      `(("djvulibre" ,djvulibre)
-       ("gtk+" ,gtk+)
        ("zathura" ,zathura)))
     (build-system gnu-build-system)
     (arguments
@@ -416,7 +431,7 @@ using the DjVuLibre library.")
 (define-public zathura-pdf-mupdf
   (package
     (name "zathura-pdf-mupdf")
-    (version "0.3.1")
+    (version "0.3.2")
     (source (origin
               (method url-fetch)
               (uri
@@ -424,12 +439,10 @@ using the DjVuLibre library.")
                               "/download/zathura-pdf-mupdf-" version ".tar.gz"))
               (sha256
                (base32
-                "06zqn8z6a0hfsx3s1kzqvqzb73afgcl6z5r062sxv7kv570fvffr"))))
+                "0xkajc3is7ncmb2fmymbzfgrran2bz12i7zsm1vvxhxds728h7ck"))))
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (propagated-inputs `(("girara" ,girara)))
     (inputs
-     `(("gtk+" ,gtk+)
-       ("jbig2dec" ,jbig2dec)
+     `(("jbig2dec" ,jbig2dec)
        ("libjpeg" ,libjpeg)
        ("mupdf" ,mupdf)
        ("openjpeg" ,openjpeg)
@@ -451,7 +464,7 @@ by using the @code{mupdf} rendering library.")
 (define-public zathura-pdf-poppler
   (package
     (name "zathura-pdf-poppler")
-    (version "0.2.7")
+    (version "0.2.8")
     (source (origin
               (method url-fetch)
               (uri
@@ -459,14 +472,11 @@ by using the @code{mupdf} rendering library.")
                               version ".tar.gz"))
               (sha256
                (base32
-                "1h43sgxpsbrsnn5z19661642plzhpv6b0y3f4kyzshv1rr6lwplq"))))
+                "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2"))))
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (propagated-inputs `(("girara" ,girara)))
     (inputs
      `(("poppler" ,poppler)
-       ("gtk+" ,gtk+)
-       ("zathura" ,zathura)
-       ("cairo" ,cairo)))
+       ("zathura" ,zathura)))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags (list (string-append "PREFIX=" %output)
@@ -484,7 +494,7 @@ by using the poppler rendering engine.")
 (define-public zathura
   (package
     (name "zathura")
-    (version "0.3.7")
+    (version "0.3.8")
     (source (origin
               (method url-fetch)
               (uri
@@ -492,14 +502,20 @@ by using the poppler rendering engine.")
                               version ".tar.gz"))
               (sha256
                (base32
-                "1w0g74dq4z2vl3f99s2gkaqrb5pskgzig10qhbxj4gq9yj4zzbr2"))
+                "0dz5pky3vmf3s2cp2rv1c099gb1s49p9xlgm3ghyy4pzyxc8bgs6"))
               (patches (search-patches
                         "zathura-plugindir-environment-variable.patch"))))
     (native-inputs `(("pkg-config" ,pkg-config)
-                     ("gettext" ,gettext-minimal)))
-    (inputs `(("girara" ,girara)
-              ("sqlite" ,sqlite)
-              ("gtk+" ,gtk+)))
+                     ("gettext" ,gettext-minimal)
+                     ("glib:bin" ,glib "bin")
+
+                     ;; For tests.
+                     ("check" ,check)
+                     ("xorg-server" ,xorg-server-1.19.3)))
+    (inputs `(("sqlite" ,sqlite)))
+    ;; Listed in 'Requires.private' of 'zathura.pc'.
+    (propagated-inputs `(("cairo" ,cairo)
+                         ("girara" ,girara)))
     (native-search-paths
      (list (search-path-specification
             (variable "ZATHURA_PLUGIN_PATH")
@@ -509,10 +525,25 @@ by using the poppler rendering engine.")
      `(#:make-flags
        `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
          "CC=gcc" "COLOR=0")
-       #:tests? #f ; Tests fail: "Gtk cannot open display".
        #:test-target "test"
-       #:phases
-       (modify-phases %standard-phases (delete 'configure))))
+       #:disallowed-references (,xorg-server-1.19.3)
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-before 'check 'start-xserver
+                    ;; Tests require a running X server.
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (let ((xorg-server (assoc-ref inputs "xorg-server"))
+                            (display ":1"))
+                        (setenv "DISPLAY" display)
+
+                        ;; On busy machines, tests may take longer than
+                        ;; the default of four seconds.
+                        (setenv "CK_DEFAULT_TIMEOUT" "20")
+
+                        ;; Don't fail due to missing '/etc/machine-id'.
+                        (setenv "DBUS_FATAL_WARNINGS" "0")
+                        (zero? (system (string-append xorg-server "/bin/Xvfb "
+                                                      display " &")))))))))
     (home-page "https://pwmt.org/projects/zathura/")
     (synopsis "Lightweight keyboard-driven PDF viewer")
     (description "Zathura is a customizable document viewer.  It provides a
@@ -566,43 +597,28 @@ extracting content or merging files.")
 (define-public mupdf
   (package
     (name "mupdf")
-    (version "1.11")
+    (version "1.13.0")
     (source
       (origin
         (method url-fetch)
         (uri (string-append "https://mupdf.com/downloads/archive/"
-                            name "-" version "-source.tar.gz"))
+                            name "-" version "-source.tar.xz"))
         (sha256
          (base32
-          "02phamcchgsmvjnb3ir7r5sssvx9fcrscn297z73b82n1jl79510"))
-        (patches (search-patches "mupdf-build-with-openjpeg-2.1.patch"
-                                 "mupdf-CVE-2017-14685.patch"
-                                 "mupdf-CVE-2017-14686.patch"
-                                 "mupdf-CVE-2017-14687.patch"
-                                 "mupdf-CVE-2017-15587.patch"))
+          "0129k92bav692l6lyw10ryldx7h2f9khjpgnp3f3n4fdsph9hrkl"))
         (modules '((guix build utils)))
-        (snippet
-            ;; Delete all the bundled libraries except for mujs, which is
-            ;; developed by the same team as mupdf and has no releases.
-            ;; TODO Package mujs and don't use the bundled copy.
-            '(for-each delete-file-recursively
-                       '("thirdparty/curl"
-                         "thirdparty/freetype"
-                         "thirdparty/glfw"
-                         "thirdparty/harfbuzz"
-                         "thirdparty/jbig2dec"
-                         "thirdparty/libjpeg"
-                         "thirdparty/openjpeg"
-                         "thirdparty/zlib")))))
+        (snippet '(begin (delete-file-recursively "thirdparty") #t))))
     (build-system gnu-build-system)
     (inputs
       `(("curl" ,curl)
+        ("freeglut" ,freeglut)
         ("freetype" ,freetype)
         ("harfbuzz" ,harfbuzz)
         ("jbig2dec" ,jbig2dec)
         ("libjpeg" ,libjpeg)
         ("libx11" ,libx11)
         ("libxext" ,libxext)
+        ("mujs" ,mujs)
         ("openjpeg" ,openjpeg)
         ("openssl" ,openssl)
         ("zlib" ,zlib)))
@@ -643,12 +659,14 @@ line tools for batch rendering @command{pdfdraw}, rewriting files
             (snippet
              ;; Replace shebang with the bi-lingual shell/Perl trick to remove
              ;; dependency on Perl.
-             '(substitute* "qpdf/fix-qdf"
-                (("#!/usr/bin/env perl")
-                 "\
+             '(begin
+                (substitute* "qpdf/fix-qdf"
+                  (("#!/usr/bin/env perl")
+                   "\
 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
   & eval 'exec perl -wS \"$0\" $argv:q'
-    if 0;\n")))))
+    if 0;\n"))
+                #t))))
    (build-system gnu-build-system)
    (arguments
     `(#:disallowed-references (,perl)
@@ -662,7 +680,8 @@ eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
             (substitute* (append
                           '("qtest/bin/qtest-driver")
                           (find-files "." "\\.test"))
-              (("/usr/bin/env") (which "env"))))))))
+              (("/usr/bin/env") (which "env")))
+            #t)))))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("perl" ,perl)))
@@ -683,7 +702,7 @@ program capable of converting PDF into other formats.")
 (define-public xournal
   (package
     (name "xournal")
-    (version "0.4.8")
+    (version "0.4.8.2016")
     (source
      (origin
        (method url-fetch)
@@ -691,7 +710,7 @@ program capable of converting PDF into other formats.")
                            "/xournal-" version ".tar.gz"))
        (sha256
         (base32
-         "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
+         "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
     (build-system gnu-build-system)
     (inputs
      `(("gtk" ,gtk+-2)
@@ -711,13 +730,13 @@ using a stylus.")
 (define-public python-reportlab
   (package
     (name "python-reportlab")
-    (version "3.3.0")
+    (version "3.4.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "reportlab" version))
               (sha256
                (base32
-                "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
+                "0hy304pzsz9lblmk7mrbk2682bi911lxgvzx2kcfpmfzb5gg7sjv"))))
     (build-system python-build-system)
     (arguments
      '(;; FIXME: There is one test failure, but it does not cause the
@@ -725,7 +744,7 @@ using a stylus.")
        #:test-target "tests"))
     (propagated-inputs
      `(("python-pillow" ,python-pillow)))
-    (home-page "http://www.reportlab.com")
+    (home-page "https://www.reportlab.com")
     (synopsis "Python library for generating PDFs and graphics")
     (description "This is the ReportLab PDF Toolkit.  It allows rapid creation
 of rich PDF documents, and also creation of charts in a variety of bitmap and
@@ -966,7 +985,7 @@ PDF.  Indeed @command{pdfposter} was inspired by @command{poster}.")
 (define-public pdfgrep
   (package
     (name "pdfgrep")
-    (version "2.0.1")
+    (version "2.1.1")
     (source
      (origin
        (method url-fetch)
@@ -974,7 +993,7 @@ PDF.  Indeed @command{pdfposter} was inspired by @command{poster}.")
                            name "-" version ".tar.gz"))
        (sha256
         (base32
-         "07llkrkcfjwd3ybai9ad10ybhr0biffcplmy7lw4fb87nd2dfw03"))))
+         "02qcl5kmr5qzjfc99qpbpfb1890bxlrq3r208gnding51zrmb09c"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))