gnu: dealii: Update to 8.5.0.
[jackhill/guix/guix.git] / gnu / packages / textutils.scm
index f6735a4..e8ae30c 100644 (file)
@@ -1,9 +1,17 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
-;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
+;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
+;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2017 Kei Kebreau <kei@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix build-system ant)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system trivial)
+  #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages java)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages slang))
+
+(define-public dos2unix
+  (package
+    (name "dos2unix")
+    (version "7.3.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://waterlan.home.xs4all.nl/" name "/"
+                           name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1i9hbxn0br7xa18z4bjpkdv7mrzmbfxhm44mzpd07yd2qnxsgkcc"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:make-flags (list "CC=gcc"
+                          (string-append "prefix=" (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)))) ; no configure script
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("perl" ,perl)))
+    (home-page "https://waterlan.home.xs4all.nl/dos2unix.html")
+    (synopsis "DOS/Mac to Unix and vice versa text file format converter")
+    (description
+     "dos2unix is a tool to convert line breaks in a text file from Unix format
+to DOS format and vice versa.")
+    (license license:bsd-2)))
 
 (define-public recode
   (package
@@ -97,7 +144,7 @@ libenca and several charset conversion libraries and tools.")
 (define-public utf8proc
   (package
     (name "utf8proc")
-    (version "1.3.1")
+    (version "2.1.0")
     (source
      (origin
        (method url-fetch)
@@ -106,20 +153,43 @@ libenca and several charset conversion libraries and tools.")
              version ".tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "1k48as5kjkar4yj3dwxyll8ykj4k723ib5a6mnw1g86q3zi0zdl3"))))
+        (base32 "0q1jhdkk4f9b0zb8s2ql3sba3br5nvjsmbsaybmgj064k9hwbk15"))))
     (build-system gnu-build-system)
+    (inputs                  ;test data that is otherwise downloaded with curl
+     `(("NormalizationTest.txt"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
+                               "NormalizationTest.txt"))
+           (sha256
+            (base32 "1fxrz0bilsbwl685336aqi88k62i6nqhm62rvy4zhg3bcm4dhj1d"))))
+       ("GraphemeBreakTest.txt"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
+                               "auxiliary/GraphemeBreakTest.txt"))
+           (sha256
+            (base32 "0qbhyhmf0778lc2hcwlpizrvmdxwpk959v2q2wb8abv09ba7wvn7"))))))
     (arguments
-     '(#:tests? #f ;no "check" target
-       #:make-flags (list "CC=gcc"
+     '(#:make-flags (list "CC=gcc"
                           (string-append "prefix=" (assoc-ref %outputs "out")))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure))))
+         (delete 'configure)
+         (add-before 'check 'check-data
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each (lambda (i)
+                         (copy-file (assoc-ref inputs i)
+                                    (string-append "data/" i)))
+                       '("NormalizationTest.txt" "GraphemeBreakTest.txt"))
+             (substitute* "data/GraphemeBreakTest.txt"
+               (("÷") "/")
+               (("×") "+")))))))
     (home-page "http://julialang.org/utf8proc/")
     (synopsis "C library for processing UTF-8 Unicode data")
     (description "utf8proc is a small C library that provides Unicode
 normalization, case-folding, and other operations for data in the UTF-8
-encoding, supporting Unicode version 7.0.")
+encoding, supporting Unicode version 9.0.0.")
     (license license:expat)))
 
 (define-public libgtextutils
@@ -196,7 +266,8 @@ input bits thoroughly but are not suitable for cryptography.")
                                   "/ustr-" version ".tar.bz2"))
               (sha256
                (base32
-                "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))))
+                "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))
+              (patches (search-patches "ustr-fix-build-with-gcc-5.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags
@@ -303,7 +374,8 @@ regular expression object can be specified.")
                                   "/antiword-" version ".tar.gz"))
               (sha256
                (base32
-                "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))))
+                "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))
+              (patches (search-patches "antiword-CVE-2014-8123.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ; There are no tests
@@ -328,3 +400,225 @@ name comes from: \"The antidote against people who send Microsoft Word files
 to everybody, because they believe that everybody runs Windows and therefore
 runs Word\".")
     (license license:gpl2+)))
+
+(define-public catdoc
+  (package
+    (name "catdoc")
+    (version "0.95")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://ftp.wagner.pp.ru/pub/catdoc/"
+                                  "catdoc-" version ".tar.gz"))
+              (sha256
+               (base32
+                "15h7v3bmwfk4z8r78xs5ih6vd0pskn0rj90xghvbzdjj0cc88jji"))))
+    (build-system gnu-build-system)
+    ;; TODO: Also build `wordview` which requires `tk` – make a separate
+    ;; package for this.
+    (arguments
+     '(#:tests? #f ; There are no tests
+       #:configure-flags '("--disable-wordview")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'fix-install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (mkdir-p (string-append out "/share/man/man1"))))))))
+    (home-page "http://www.wagner.pp.ru/~vitus/software/catdoc/")
+    (synopsis "MS-Word to TeX or plain text converter")
+    (description "@command{catdoc} extracts text from MS-Word files, trying to
+preserve as many special printable characters as possible.  It supports
+everything up to Word-97. Also supported are MS Write documents and RTF files.
+
+@command{catdoc} does not preserve complex word formatting, but it can
+translate some non-ASCII characters into TeX escape codes.  It's goal is to
+extract plain text and allow you to read it and, probably, reformat with TeX,
+according to TeXnical rules.
+
+This package also provides @command{xls2csv}, which extracts data from Excel
+spreadsheets and outputs it in comma-separated-value format, and
+@command{catppt}, which extracts data from PowerPoint presentations.")
+    (license license:gpl2+)))
+
+(define-public utfcpp
+  (package
+    (name "utfcpp")
+    (version "2.3.4")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append
+                "mirror://sourceforge/utfcpp/utf8cpp_2x/Release%20"
+                version "/utf8_v"
+                (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
+                ".zip"))
+              (file-name (string-append name "-" version ".zip"))
+              (sha256
+               (base32
+                "1vqhs0aipcvvdrwcs7h3jsryg6mgbmc4s34n5cm6d36q4nxwwwrk"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let ((source (assoc-ref %build-inputs "source"))
+               (out    (assoc-ref %outputs "out"))
+               (unzip  (string-append (assoc-ref %build-inputs "unzip")
+                                      "/bin/unzip")))
+           (mkdir-p out)
+           (with-directory-excursion out
+             (system* unzip source)
+             (mkdir-p "share/doc")
+             (rename-file "doc" "share/doc/utfcpp")
+             (rename-file "source" "include"))))))
+    (native-inputs `(("unzip" ,unzip)))
+    (home-page "https://github.com/nemtrif/utfcpp")
+    (synopsis "Portable C++ library for handling UTF-8")
+    (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
+in a portable way.")
+    (license license:boost1.0)))
+
+(define-public dbacl
+  (package
+    (name "dbacl")
+    (version "1.14")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://www.lbreyer.com/gpl/"
+                           name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0224g6x71hyvy7jikfxmgcwww1r5lvk0jx36cva319cb9nmrbrq7"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (list
+        (string-append "-I" (assoc-ref %build-inputs "slang")
+                       "/include/slang")
+        (string-append "-I" (assoc-ref %build-inputs "ncurses")
+                       "/include/ncurses"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'delete-sample6-and-japanese
+           (lambda _
+             (substitute* "doc/Makefile.am"
+               (("sample6.txt") "")
+               (("japanese.txt") ""))
+             (delete-file "doc/sample6.txt")
+             (delete-file "doc/japanese.txt")
+             (substitute* (list "src/tests/Makefile.am"
+                                "src/tests/Makefile.in")
+               (("dbacl-jap.shin") "")
+               (("dbacl-jap.sh") ""))
+             #t))
+         (add-after 'unpack 'delete-test
+           ;; See comments about the license.
+           (lambda _
+             (delete-file "src/tests/dbacl-jap.shin")))
+         (add-after 'delete-sample6-and-japanese 'autoreconf
+           (lambda _
+             (zero? (system* "autoreconf" "-vif"))))
+         (add-after 'unpack 'fix-test-files
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (substitute* (find-files "src/tests/" "\\.shin$")
+                 (("PATH=/bin:/usr/bin")
+                  "#PATH=/bin:/usr/bin")
+                 (("diff") (string-append (which "diff")))
+                 (("tr") (string-append (which "tr"))))
+               #t))))))
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("perl" ,perl)
+       ("readline" ,readline)
+       ("slang" ,slang)))
+    (native-inputs
+     `(("libtool" ,libtool)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://www.lbreyer.com/dbacl.html")
+    (synopsis "Bayesian text and email classifier")
+    (description
+     "dbacl is a fast Bayesian text and email classifier.  It builds a variety
+of language models using maximum entropy (minimum divergence) principles, and
+these can then be used to categorize input data automatically among multiple
+categories.")
+    ;; The software is licensed as GPLv3 or later, but
+    ;; includes various sample texts in the doc dir:
+    ;; - sample1.txt, sample3 and sampe5.txt are in the public domain,
+    ;;   by Mark Twain.
+    ;; - sample2.txt, sample4.txt are in the public domain, by Aristotle.
+    ;; - sample6.txt is a forwarded email, copyright unknown.
+    ;;   Guix does exclude sample6.txt.
+    ;; - japanese.txt is a Japanese unoffical translation of the
+    ;;   GNU General Public License, (c) by the Free Software Foundation.
+    ;;   Guix excludes this file.
+    (license (list license:gpl3+ license:public-domain))))
+
+(define-public dotconf
+  (package
+    (name "dotconf")
+    (version "1.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/williamh/dotconf/archive/v"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0lsnh0yaw44psmx59hq94cj1932gscp5h8d3cnh05l0svr0cy7kz"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; FIXME maketest.sh does not work.
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoreconf
+           (lambda _
+             (zero? (system* "autoreconf" "-vif")))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (home-page "https://github.com/williamh/dotconf")
+    (synopsis "Configuration file parser library")
+    (description
+     "C library for creating and parsing configuration files.")
+    (license (list license:lgpl2.1         ; Main distribution.
+                   license:asl1.1))))      ; src/readdir.{c,h}
+
+(define-public java-rsyntaxtextarea
+  (package
+    (name "java-rsyntaxtextarea")
+    (version "2.6.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/bobbylight/"
+                                  "RSyntaxTextArea/archive/"
+                                  version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0c5mqg2klj5rvf8fhycrli8rf6s37l9p7a8knw9gpp65r1c120q2"))))
+    (build-system ant-build-system)
+    (arguments
+     `(;; FIXME: some tests fail because locale resources cannot be found.
+       ;; Even when I add them to the class path,
+       ;; RSyntaxTextAreaEditorKitDumbCompleteWordActionTest fails.
+       #:tests? #f
+       #:jar-name "rsyntaxtextarea.jar"))
+    (native-inputs
+     `(("java-junit" ,java-junit)
+       ("java-hamcrest-core" ,java-hamcrest-core)))
+    (home-page "https://bobbylight.github.io/RSyntaxTextArea/")
+    (synopsis "Syntax highlighting text component for Java Swing")
+    (description "RSyntaxTextArea is a syntax highlighting, code folding text
+component for Java Swing.  It extends @code{JTextComponent} so it integrates
+completely with the standard @code{javax.swing.text} package.  It is fast and
+efficient, and can be used in any application that needs to edit or view
+source code.")
+    (license license:bsd-3)))