gnu: r-abaenrichment: Update to 1.14.0.
[jackhill/guix/guix.git] / gnu / packages / tex.scm
index 8854a93..c3ce80c 100644 (file)
@@ -3,13 +3,13 @@
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
        (base32
         "0khyi6h015r2zfqgg0a44a2j7vmr1cy42knw7jbss237yvakc07y"))
       (patches
-       (list
-        ;; This is required for compatibility with Poppler 0.64.0 and to fix a
-        ;; segmentation fault in dvipdfm-x from XeTeX, and also contains a fix
-        ;; for CVE-2018-17407.
-        (origin
-          (method url-fetch)
-          (uri (string-append "http://www.linuxfromscratch.org/patches/blfs/"
-                              "svn/texlive-" version "-source-upstream_fixes-2.patch"))
-          (file-name "texlive-poppler-compat.patch")
-          (sha256
-           (base32
-            "04sxy1qv9y575mxwyg3y7rx7mh540pfjqx7yni7ncb5wjbq9pq1a")))
-        (search-patch "texlive-bin-luatex-poppler-compat.patch")
-        (search-patch "texlive-bin-pdftex-poppler-compat.patch")
-        (search-patch "texlive-bin-xetex-poppler-compat.patch")))))
+       (let ((arch-patch
+              (lambda (name revision hash)
+                (origin
+                  (method url-fetch)
+                  (uri (string-append "https://git.archlinux.org/svntogit/packages.git"
+                                      "/plain/trunk/" name "?h=packages/texlive-bin"
+                                      "&id=" revision))
+                  (file-name (string-append "texlive-bin-" name))
+                  (sha256 (base32 hash)))))
+             (arch-revision "e1975bce0b9d270d7c9773c5beb7e87d61ee8f57"))
+         (append (search-patches  "texlive-bin-CVE-2018-17407.patch"
+                                  "texlive-bin-luatex-poppler-compat.patch")
+                 (list
+                  (arch-patch "pdftex-poppler0.72.patch" arch-revision
+                              "0p46b6xxxg2s3hx67r0wpz16g3qygx65hpc581xs3jz5pvsiq3y7")
+                  (arch-patch "xetex-poppler-fixes.patch" arch-revision
+                              "1jj1p5zkjljb7id9pjv29cw0cf8mwrgrh4ackgzz9c200vaqpsvx")))))))
    (build-system gnu-build-system)
    (inputs
     `(("texlive-extra-src" ,texlive-extra-src)
           ;; ps2eps.pl uses the "gswin32c" ghostscript executable on Windows,
           ;; and the "gs" ghostscript executable on Unix. It detects Unix by
           ;; checking for the existence of the /usr/bin directory. Since
-          ;; GuixSD does not have /usr/bin, it is also detected as Windows.
+          ;; Guix System does not have /usr/bin, it is also detected as Windows.
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "utils/ps2eps/ps2eps-src/bin/ps2eps.pl"
               (("gswin32c") "gs"))
             #t))
         (add-after 'unpack 'use-code-for-new-poppler
           (lambda _
-            (copy-file "texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc"
+            (copy-file "texk/web2c/pdftexdir/pdftoepdf-poppler0.72.0.cc"
                        "texk/web2c/pdftexdir/pdftoepdf.cc")
-            (copy-file "texk/web2c/pdftexdir/pdftosrc-newpoppler.cc"
+            (copy-file "texk/web2c/pdftexdir/pdftosrc-poppler0.72.0.cc"
                        "texk/web2c/pdftexdir/pdftosrc.cc")
             #t))
         (add-after 'unpack 'disable-failing-test
@@ -3416,8 +3418,8 @@ command.")
     (description
      "Identify areas of text to be marked with changebars with the
 @code{\\cbstart} and @code{\\cbend} commands; the bars may be coloured.  The
-package uses 'drivers' to place the bars; the available drivers can work with
-@code{dvitoln03}, @code{dvitops}, @code{dvips}, the emTeX and TeXtures DVI
+package uses @code{drivers} to place the bars; the available drivers can work
+with @code{dvitoln03}, @code{dvitops}, @code{dvips}, the emTeX and TeXtures DVI
 drivers, and VTeX and pdfTeX.")
     (license license:lppl)))
 
@@ -4064,6 +4066,141 @@ Adobe's basic set.")
     ;; No license version specified.
     (license license:gpl3+)))
 
+(define-public texlive-fonts-adobe-zapfding
+  (package
+    (name "texlive-fonts-adobe-zapfding")
+    (version (number->string %texlive-revision))
+    (source (origin
+              (method svn-fetch)
+              (uri (svn-reference
+                    (url (string-append "svn://www.tug.org/texlive/tags/"
+                                        %texlive-tag "/Master/texmf-dist/"
+                                        "/fonts/type1/urw/zapfding/"))
+                    (revision %texlive-revision)))
+              (file-name (string-append name "-" version "-checkout"))
+              (sha256
+               (base32
+                "1sp3jblg3khp0yj121blvhph6ib09919kyrsk5x2lg258yypqyis"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils)
+                  (ice-9 match))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (let ((root (string-append (assoc-ref %outputs "out")
+                                    "/share/texmf-dist/"))
+               (pkgs '(("source"      . "fonts/type1/urw/zapfding")
+                       ("zapf-afm"    . "fonts/afm/adobe/zapfding")
+                       ("zapf-tfm"    . "fonts/tfm/adobe/zapfding")
+                       ("urw-afm"     . "fonts/afm/urw/zapfding")
+                       ("urw35vf-tfm" . "fonts/tfm/urw35vf/zapfding")
+
+                       ("zapf-tex"    . "tex/latex/zapfding")
+                       ("dvips"       . "dvips/zapfding")
+                       ("fonts-map"   . "fonts/map/dvips/zapfding"))))
+           (for-each (match-lambda
+                       ((pkg . dir)
+                        (let ((target (string-append root dir)))
+                          (mkdir-p target)
+                          (copy-recursively (assoc-ref %build-inputs pkg)
+                                            target))))
+                     pkgs)
+           #t))))
+    (native-inputs
+     `(("zapf-afm"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/fonts/afm/adobe/zapfding"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-afm-" version "-checkout"))
+           (sha256
+            (base32
+             "0qvl4w1bfcpiakkd8rvkism46qnvzj9w7x4r8z9m0y7mspbkblyr"))))
+       ("zapf-tfm"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/fonts/tfm/adobe/zapfding"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-tfm-" version "-checkout"))
+           (sha256
+            (base32
+             "1i8mh9xsl8l4cgsg3nl4ha9q6m55j122riclaxsvkc5ka83432qm"))))
+       ("urw-afm"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/fonts/afm/urw/zapfding"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-urw-afm-" version "-checkout"))
+           (sha256
+            (base32
+             "0m4qndqh7ji723ff82c5c1q8ziqvblbaip7vx05vnl15fqbsnfx1"))))
+       ("urw35vf-tfm"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/fonts/tfm/urw35vf/zapfding"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-urw35vf-tfm-" version "-checkout"))
+           (sha256
+            (base32
+             "167g2x6mpjfqh0w1fhjbw14qcx6ridrj2zm1bd8bi0l2d7phj28m"))))
+       ("zapf-tex"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/tex/latex/zapfding"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-tex-" version "-checkout"))
+           (sha256
+            (base32
+             "0hp7i8f6nbrg7irrwc8fd7n1hrzjysa84d6iyivwlc65v9p7lmd0"))))
+       ("dvips"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/dvips/zapfding/"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-dvips-" version "-checkout"))
+           (sha256
+            (base32
+             "1f18sc4qwxykd786zhn6szcrycqvpvfhlcim71aamxmwghakd7fa"))))
+       ("fonts-map"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/fonts/map/dvips/zapfding/"))
+                 (revision %texlive-revision)))
+           (file-name (string-append name "-fonts-map-" version "-checkout"))
+           (sha256
+            (base32
+             "17kwxmdrgz2fb072hx57a3pidcrhbgayphx11zyld2hv9149pkyl"))))))
+    (home-page "https://ctan.org/pkg/urw-base35")
+    (synopsis "URW Base 35 font pack for LaTeX")
+    (description
+     "This package provides a drop-in replacements for the Zapfding font from
+Adobe's basic set.")
+    ;; No license version specified.
+    (license license:gpl3+)))
+
 (define-public texlive-fonts-rsfs
   (package
     (name "texlive-fonts-rsfs")
@@ -5322,14 +5459,14 @@ PDF documents.")
 (define-public texmaker
   (package
     (name "texmaker")
-    (version "5.0.2")
+    (version "5.0.3")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
                                   version ".tar.bz2"))
               (sha256
                (base32
-                "0y81mjm89b99pr9svcwpaf4iz2q9pc9hjas5kiwd1pbgl5vqskm9"))))
+                "0vrj9w5lk3vf6138n5bz8phmy3xp5kv4dq1rgirghcf4hbxdyx30"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -5358,13 +5495,12 @@ PDF documents.")
 develop documents with LaTeX, in a single application.")
     (license license:gpl2+)))
 
-
 (define-public teximpatient
   (package
     (name "teximpatient")
     (version "2.4")
     (source (origin
-              (method url-fetch)
+              (method url-fetch/tarbomb)
               (uri (string-append "mirror://gnu/" name "/" name "-"
                                   version ".tar.gz"))
               (sha256
@@ -5372,25 +5508,28 @@ develop documents with LaTeX, in a single application.")
                 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
+     `(#:tests? #f ; there are none
+       #:phases
        (modify-phases %standard-phases
-         (delete 'check)
-         ;; Unfortunately some mistakes have been made in packaging.
-         ;; Work around them here ...
-         (replace 'unpack
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((srcdir "teximpatient-2.4"))
-               (system* "tar" "-xzf" (assoc-ref inputs "source")
-                        (string-append "--one-top-level=" srcdir))
-               (delete-file (string-append srcdir "/book.pdf"))
-               (install-file (car
-                              (find-files
-                               (assoc-ref inputs "automake")
-                               "^install-sh$"))
-                             srcdir)
-               (chdir srcdir)))))))
+         (add-after 'unpack 'fix-packaging-error
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; This file should have been part of the tarball.
+             (install-file (car
+                            (find-files
+                             (assoc-ref inputs "automake")
+                             "^install-sh$"))
+                           ".")
+             ;; Remove generated file.
+             (delete-file "book.pdf")
+             #t)))))
     (native-inputs
-     `(("texlive" ,texlive)
+     `(("texlive" ,(texlive-union (list texlive-latex-amsfonts
+                                        texlive-fonts-amsfonts
+                                        texlive-fonts-adobe-palatino
+                                        texlive-fonts-adobe-zapfding
+                                        texlive-fonts-knuth-lib
+                                        texlive-fonts-mflogo-font
+                                        texlive-generic-pdftex)))
        ("automake" ,automake)))
     (home-page "https://www.gnu.org/software/teximpatient/")
     (synopsis "Book on TeX, plain TeX and Eplain")
@@ -5402,20 +5541,20 @@ and Karl Berry.")
 (define-public lyx
   (package
     (name "lyx")
-    (version "2.2.3")
+    (version "2.3.2-2")
     (source (origin
-             (method url-fetch)
-             (uri (string-append "http://ftp.lyx.org/pub/lyx/stable/2.2.x/"
-                                 name "-" version ".tar.gz"))
-             (sha256
-              (base32
-               "0xvaz0i371nn2ndinc0d3ywj76ivb62649a4sdgwbivisiahd2fj"))
-             (patches (search-patches "lyx-2.2.3-fix-test.patch"))
-             (modules '((guix build utils)))
-             (snippet
-              '(begin
-                (delete-file-recursively "3rdparty")
-                #t))))
+              (method url-fetch)
+              (uri (string-append "http://ftp.lyx.org/pub/lyx/stable/"
+                                  (version-major+minor version) ".x/"
+                                  name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0vr0qwis6rhind6azfa270hqxci7rj8qb1kk5x6lm80mc34nvrqi"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "3rdparty")
+                  #t))))
     (build-system cmake-build-system)
     (arguments
      `(#:configure-flags `("-DLYX_USE_QT=QT5"
@@ -5425,56 +5564,68 @@ and Karl Berry.")
                            ,(string-append "-DLYX_INSTALL_PREFIX="
                                            (assoc-ref %outputs "out")
                                            ;; Exact name and level is necessary.
-                                           "/lyx2.2"))
+                                           "/lyx" ,(version-major+minor version)))
        #:phases
        (modify-phases %standard-phases
+         ;; See ;; https://www.lyx.org/trac/changeset/3a123b90af838b08680471d87170c38e56787df9/lyxgit
+         (add-after 'unpack 'fix-compilation-with-boost-1.69
+           (lambda _
+             (substitute* "src/support/FileName.cpp"
+               (("^template struct boost::detail::crc_table_t.*") ""))
+             #t))
          (add-after 'unpack 'patch-python
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* '("src/support/os.cpp")
-              (("\"python ")
-               (string-append "\""
-                              (assoc-ref inputs "python-2")
-                              "/bin/python ")))
-             #t))
-         (add-after 'patch-python 'patch-installer
-           (lambda* (#:key outputs #:allow-other-keys)
-             (substitute* "CMakeLists.txt"
-              (("/usr/local/man/man1")
-               (string-append (assoc-ref outputs "out")
-                              "/share/man/man1")))
+               (("\"python ")
+                (string-append "\""
+                               (assoc-ref inputs "python")
+                               "/bin/python ")))
              #t))
          (add-after 'patch-python 'patch-desktop-file
            (lambda* (#:key outputs #:allow-other-keys)
              (substitute* "lib/lyx.desktop.in"
-              (("Exec=")
-               (string-append "Exec="
-                              (assoc-ref outputs "out")
-                              "/")))
+               (("Exec=")
+                (string-append "Exec="
+                               (assoc-ref outputs "out")
+                               "/")))
              #t))
          (add-before 'check 'setenv-check
            (lambda _
-             (setenv "LYX_DIR_22x" (string-append (getcwd) "/../lyx-"
-                                                  ,version "/lib"))
+             ;; Create missing file that would cause tests to fail.
+             (with-output-to-file (string-append "../lyx-"
+                                                 ,version
+                                                 "/src/tests/check_layout.cmake")
+               (const #t))
+             (setenv (string-append "LYX_DIR_"
+                                    (string-join
+                                      (string-split
+                                        ,(version-major+minor version) #\-)) "x")
+                     (string-append (getcwd) "/../lyx-" ,version "/lib"))
              #t))
          (add-after 'install 'install-symlinks
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (mkdir-p (string-append out "/bin"))
-               (symlink "../lyx2.2/bin/lyx2.2"
-                (string-append out "/bin/lyx2.2"))
+               (symlink (string-append "../lyx" ,(version-major+minor version)
+                                       "/bin/lyx" ,(version-major+minor version))
+                        (string-append out "/bin/lyx" ,(version-major+minor version)))
                #t))))))
     (inputs
      `(("boost" ,boost)
-       ("hunspell" ,hunspell) ; Note: Could also use aspell instead.
+       ("hunspell" ,hunspell)           ; Note: Could also use aspell instead.
        ("libx11" ,libx11)
-       ("python-2" ,python-2)
+       ("mythes" ,mythes)
+       ("python" ,python-2)
        ("qtbase" ,qtbase)
        ("qtsvg" ,qtsvg)
        ("zlib" ,zlib)))
     (propagated-inputs
-     `(("texlive" ,texlive))) ; article.cls is in texmf-dist.
+     `(("texlive" ,(texlive-union (list texlive-fonts-ec)))))
+    ;; FIXME: Python 3.7.0 cannot be used because the test infrastructure
+    ;; "requires a bytes-like object, not 'str'".  This may be fixed with
+    ;; upgrades to Python.
     (native-inputs
-     `(("python-2" ,python-2)
+     `(("python" ,python-2)
        ("pkg-config" ,pkg-config)
        ("bc" ,bc)))
     (home-page "https://www.lyx.org/")
@@ -5871,7 +6022,7 @@ typearea (which are the main parts of the bundle).")
            (copy-recursively (assoc-ref %build-inputs "source") target)
            #t))))
     (home-page "https://www.ctan.org/pkg/listofitems")
-    (synopsis "Grab items in lists using user-specified seperation character")
+    (synopsis "Grab items in lists using user-specified separation character")
     (description
      "This package allows one to capture all the items of a list, for which
 the parsing character has been selected by the user, and to access any of
@@ -6311,3 +6462,77 @@ effects, varying slide transitions and animations.")
     ;; Code is dual licensed under GPLv2+ or LPPL1.3c+; documentation is
     ;; dual-licensed under either FDLv1.3+ or LPPL1.3c+.
     (license (list license:lppl1.3c+ license:gpl2+ license:fdl1.3+))))
+
+(define-public texlive-latex-xmpincl
+  (package
+    (name "texlive-latex-xmpincl")
+    (version (number->string %texlive-revision))
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (texlive-ref "latex" "xmpincl"))
+       (sha256
+        (base32
+         "0lq3dfb4fsw955gjwllnk7cg00ciq5mva64mlpbva6g2jz117734"))))
+    (build-system texlive-build-system)
+    (arguments '(#:tex-directory "latex/xmpincl"))
+    (home-page "http://www.ctan.org/pkg/xmpincl")
+    (synopsis "Include eXtensible Metadata Platform data in pdfLaTeX")
+    (description
+     "The XMP (eXtensible Metadata platform) is a framework to add metadata to
+digital material to enhance the workflow in publication.  The essence is that
+the metadata is stored in an XML file, and this XML stream is then embedded in
+the file to which it applies.")
+    (license license:gpl3+)))
+
+(define-public texlive-latex-pdfx
+  (package
+    (name "texlive-latex-pdfx")
+    (version (number->string %texlive-revision))
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (texlive-ref "latex" "pdfx"))
+       (sha256
+        (base32
+         "0ikxg8yzq78hy5b9x13d4nah46d0yvmwlqmdri06pygbx116dcac"))))
+    (build-system texlive-build-system)
+    (arguments
+     '(#:tex-directory "latex/pdfx"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-encoding
+           (lambda _
+             (substitute* "pdfx.dtx"
+               (("    .+umaczy") "umaczy"))
+             #t))
+         (add-before 'install 'install-tex-files
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((target (string-append (assoc-ref outputs "out")
+                                          "/share/texmf-dist/tex/latex/pdfx")))
+               (mkdir-p target)
+               (copy-recursively (assoc-ref inputs "texlive-tex-pdfx") target)
+               ;; Install the generated version in the "install" phase.
+               (delete-file (string-append target "/pdfx.sty"))
+               #t))))))
+    (propagated-inputs
+     `(("texlive-generic-pdftex" ,texlive-generic-pdftex)))
+    (native-inputs
+     `(("texlive-tex-pdfx"
+        ,(origin
+           (method svn-fetch)
+           (uri (svn-reference
+                 (url (string-append "svn://www.tug.org/texlive/tags/"
+                                     %texlive-tag "/Master/texmf-dist/"
+                                     "/tex/latex/pdfx"))
+                 (revision %texlive-revision)))
+           (file-name (string-append "texlive-tex-latex-pdfx-" version "-checkout"))
+           (sha256
+            (base32
+             "14j1zsvqc59ims3sk34v6km8db6cimks28y5fcxcr5mi2ykvj4vf"))))))
+    (home-page "https://www.ctan.org/pkg/pdfx")
+    (synopsis "PDF/X and PDF/A support for pdfTeX, LuaTeX and XeTeX")
+    (description
+     "This package helps LaTeX users to create PDF/X, PFD/A and other
+standards-compliant PDF documents with pdfTeX, LuaTeX and XeTeX.")
+    (license license:lppl1.2+)))