gnu: Add python-pyshp.
[jackhill/guix/guix.git] / gnu / packages / pdf.scm
index 3063aa1..9298332 100644 (file)
@@ -177,7 +177,7 @@ information.")
      `(("python-pypdf2" ,python-pypdf2)
        ("python-pyqt" ,python-pyqt)
        ("python-poppler-qt5" ,python-poppler-qt5)
-       ("qtbase" ,qtbase)))
+       ("qtbase" ,qtbase-5)))
     (home-page "http://crazy-compilers.com/flyer-composer")
     (synopsis "Rearrange PDF pages to print as flyers on one sheet")
     (description "@command{flyer-composer} can be used to prepare one- or
@@ -299,31 +299,24 @@ When present, Poppler is able to correctly render CJK and Cyrillic text.")
     (license (list license:bsd-3
                    license:gpl2))))
 
-(define-public poppler-qt4
-  (package/inherit poppler
-   (name "poppler-qt4")
-   (inputs `(("qt-4" ,qt-4)
-             ,@(package-inputs poppler)))
-   (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
-
 (define-public poppler-qt5
   (package/inherit poppler
    (name "poppler-qt5")
-   (inputs `(("qtbase" ,qtbase)
+   (inputs `(("qtbase" ,qtbase-5)
              ,@(package-inputs poppler)))
    (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
 
 (define-public python-poppler-qt5
   (package
     (name "python-poppler-qt5")
-    (version "0.24.2")
+    (version "21.1.0")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "python-poppler-qt5" version))
         (sha256
          (base32
-          "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
+          "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd"))))
     (build-system python-build-system)
     (arguments
      `(;; There are no tests.  The check phase just causes a rebuild.
@@ -346,10 +339,10 @@ When present, Poppler is able to correctly render CJK and Cyrillic text.")
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
-     `(("python-sip" ,python-sip)
+     `(("python-sip" ,python-sip-4)
        ("python-pyqt" ,python-pyqt)
        ("poppler-qt5" ,poppler-qt5)
-       ("qtbase" ,qtbase)))
+       ("qtbase" ,qtbase-5)))
     (home-page "https://pypi.org/project/python-poppler-qt5/")
     (synopsis "Python bindings for Poppler-Qt5")
     (description
@@ -396,47 +389,21 @@ reading and editing of existing PDF files.")
 (define-public xpdf
   (package
    (name "xpdf")
-   (version "4.02")
+   (version "4.03")
    (source
     (origin
       (method url-fetch)
-      (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
-                          version "4.02.tar.gz"))
+      (uri (string-append "https://dl.xpdfreader.com/xpdf-" version ".tar.gz"))
       (sha256
-       (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
-   (build-system gnu-build-system)
-   (inputs `(("freetype" ,freetype)
-             ("gs-fonts" ,gs-fonts)
-             ("lesstif" ,lesstif)
-             ("libpaper" ,libpaper)
-             ("libx11" ,libx11)
-             ("libxext" ,libxext)
-             ("libxp" ,libxp)
-             ("libxpm" ,libxpm)
-             ("libxt" ,libxt)
+       (base32 "0ip81c9vy0igjnasl9iv2lz214fb01vvvdzbvjmgwc63fi1jgr0g"))))
+   (build-system cmake-build-system)
+   (inputs `(("cups" ,cups)
+             ("freetype" ,freetype)
              ("libpng" ,libpng)
+             ("qtbase" ,qtbase-5)
              ("zlib" ,zlib)))
    (arguments
-    `(#:tests? #f                     ; there is no check target
-      #:parallel-build? #f            ; build fails randomly on 8-way machines
-      #:configure-flags
-        (list (string-append "--with-freetype2-includes="
-                             (assoc-ref %build-inputs "freetype")
-                             "/include/freetype2"))
-      #:phases
-      (modify-phases %standard-phases
-        (replace 'install
-          (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
-            (let* ((install (assoc-ref %standard-phases 'install))
-                   (out (assoc-ref outputs "out"))
-                   (xpdfrc (string-append out "/etc/xpdfrc"))
-                   (gs-fonts (assoc-ref inputs "gs-fonts")))
-              (apply install args)
-              (substitute* xpdfrc
-                (("/usr/local/share/ghostscript/fonts")
-                 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
-                (("#fontFile") "fontFile")))
-            #t)))))
+    `(#:tests? #f))                   ; there is no check target
    (synopsis "Viewer for PDF files based on the Motif toolkit")
    (description
     "Xpdf is a viewer for Portable Document Format (PDF) files.")
@@ -750,7 +717,8 @@ extracting content or merging files.")
                            "mupdf-" version "-source.tar.xz"))
        (sha256
         (base32 "16m5sksil22sshxy70xkslsb2qhvcqb1d95i9savnhds1xn4ybar"))
-       (patches (search-patches "mupdf-fix-linkage.patch"))
+       (patches (search-patches "mupdf-fix-linkage.patch"
+                                "mupdf-CVE-2021-3407.patch"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -879,7 +847,7 @@ program capable of converting PDF into other formats.")
        ("djvulibre" ,djvulibre)
        ("libspectre" ,libspectre)
        ("poppler-qt5" ,poppler-qt5)
-       ("qtbase" ,qtbase)
+       ("qtbase" ,qtbase-5)
        ("qtsvg" ,qtsvg)))
     (arguments
      `(#:imported-modules ((guix build qt-build-system)
@@ -1133,13 +1101,13 @@ the PDF pages.")
 (define-public img2pdf
   (package
     (name "img2pdf")
-    (version "0.4.0")
+    (version "0.4.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "img2pdf" version))
        (sha256
-        (base32 "1jdhmpzgj8815bhargb3xp3ydlqxwkz0mcadrflx2ga0p056kvpa"))))
+        (base32 "0ljmxp7myxccfdy4kxpn4jzq35qs4pbmmmnih9vis8abm2f2589q"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-pikepdf" ,python-pikepdf)
@@ -1167,7 +1135,7 @@ information for every pixel as the input.")
                 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-FHS-file-names
            (lambda _
@@ -1176,7 +1144,7 @@ information for every pixel as the input.")
                (("/sbin/ldconfig -p") "echo lib")) #t))
          (delete 'configure))
         #:tests? #f
-        #:make-flags (list "CC=gcc"
+        #:make-flags (list ,(string-append "CC=" (cc-for-target))
                            (string-append "prefix=" (assoc-ref %outputs "out")))))
     (inputs `(("libjpeg" ,libjpeg-turbo)
               ("curl" ,curl)
@@ -1301,7 +1269,7 @@ python-pypdf2 instead.")
 (define-public pdfarranger
   (package
     (name "pdfarranger")
-    (version "1.7.0")
+    (version "1.7.1")
     (source
      (origin
        (method git-fetch)
@@ -1310,7 +1278,7 @@ python-pypdf2 instead.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0dmgmvpghsm938iznalbg8h8k17a5h3q466yfc67mcll428n4nx3"))))
+        (base32 "1c2mafnz8pv32wzkc2wx4q8y2x7xffpn6ag12dj7ga5n772fb6s3"))))
     (build-system python-build-system)
     (arguments
      '(#:tests? #f                      ;no tests