1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
5 ;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
6 ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
7 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 ng0 <ng0@n0.is>
10 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
11 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
12 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
13 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
16 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
18 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
19 ;;; Copyright © 2019 Yoshinori Arai <kumagusu08@gmail.com>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages textutils)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix build-system ant)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system go)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system python)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages java)
51 #:use-module (gnu packages ncurses)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages python-xyz)
56 #:use-module (gnu packages readline)
57 #:use-module (gnu packages slang)
58 #:use-module (gnu packages web))
60 (define-public dos2unix
67 (uri (string-append "https://waterlan.home.xs4all.nl/" name "/"
68 name "-" version ".tar.gz"))
70 (base32 "12h4c61g376bhq03y5g2xszkrkrj5hwd928rly3xsp6rvfmnbixs"))))
71 (build-system gnu-build-system)
73 '(#:make-flags (list "CC=gcc"
74 (string-append "prefix=" (assoc-ref %outputs "out")))
76 (modify-phases %standard-phases
77 (delete 'configure)))) ; no configure script
79 `(("gettext" ,gettext-minimal)
81 (home-page "https://waterlan.home.xs4all.nl/dos2unix.html")
82 (synopsis "DOS/Mac to Unix and vice versa text file format converter")
84 "dos2unix is a tool to convert line breaks in a text file from Unix format
85 to DOS format and vice versa.")
86 (license license:bsd-2)))
95 (uri (string-append "https://github.com/rrthomas/recode/releases/"
96 "download/v" version "/" name "-" version ".tar.gz"))
99 "0215hfj0rhlh0grg91qfx75pp6z09bpv8211qdxqihniw7y9a4fs"))
100 (modules '((guix build utils)))
102 (delete-file "tests/Recode.c")
104 (build-system gnu-build-system)
106 `(("python" ,python-2)
107 ("python2-cython" ,python2-cython)))
108 (home-page "https://github.com/rrthomas/recode")
109 (synopsis "Text encoding converter")
110 (description "The Recode library converts files between character sets and
111 usages. It recognises or produces over 200 different character sets (or about
112 300 if combined with an iconv library) and transliterates files between almost
113 any pair. When exact transliteration are not possible, it gets rid of
114 offending characters or falls back on approximations. The recode program is a
115 handy front-end to the library.")
116 (license license:gpl3+)))
126 "https://github.com/nijel/enca/archive/" version ".tar.gz"))
128 (base32 "099z526i7qgij7q1w3lvhl88iv3jc3nqxca2i09h6s08ghyrmzf4"))
129 (file-name (string-append name "-" version ".tar.gz"))))
130 (build-system gnu-build-system)
131 ;; enca-1.19 tests fail with recent recode.
132 ;(inputs `(("recode" ,recode)))
133 (home-page "https://github.com/nijel/enca")
134 (synopsis "Text encoding detection tool")
135 (description "Enca (Extremely Naive Charset Analyser) consists of libenca,
136 an encoding detection library, and enca, a command line frontend, integrating
137 libenca and several charset conversion libraries and tools.")
138 (license license:gpl2)))
140 (define-public utf8proc
148 "https://github.com/JuliaLang/utf8proc/archive/v"
150 (file-name (string-append name "-" version ".tar.gz"))
152 (base32 "1cnpigrazhslw65s4j1a56j7p6d7d61wsxxjf1218i9mkwv2yw17"))))
153 (build-system gnu-build-system)
154 (inputs ; test data that is otherwise downloaded with curl
155 `(("NormalizationTest.txt"
158 (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
159 "NormalizationTest.txt"))
161 (base32 "1fxrz0bilsbwl685336aqi88k62i6nqhm62rvy4zhg3bcm4dhj1d"))))
162 ("GraphemeBreakTest.txt"
165 (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
166 "auxiliary/GraphemeBreakTest.txt"))
168 (base32 "0qbhyhmf0778lc2hcwlpizrvmdxwpk959v2q2wb8abv09ba7wvn7"))))))
170 '(#:make-flags (list "CC=gcc"
171 (string-append "prefix=" (assoc-ref %outputs "out")))
173 (modify-phases %standard-phases
175 (add-before 'check 'check-data
176 (lambda* (#:key inputs #:allow-other-keys)
177 (for-each (lambda (i)
178 (copy-file (assoc-ref inputs i)
179 (string-append "data/" i)))
180 '("NormalizationTest.txt" "GraphemeBreakTest.txt"))
181 (substitute* "data/GraphemeBreakTest.txt"
184 (home-page "https://julialang.org/utf8proc/")
185 (synopsis "C library for processing UTF-8 Unicode data")
186 (description "utf8proc is a small C library that provides Unicode
187 normalization, case-folding, and other operations for data in the UTF-8
188 encoding, supporting Unicode version 9.0.0.")
189 (license license:expat)))
191 (define-public libconfuse
198 (uri (string-append "https://github.com/martinh/libconfuse/"
199 "releases/download/v" version
200 "/confuse-" version ".tar.xz"))
202 (base32 "02r1mmzik2m0iigbc2da3y754vj24i18r3ml5p2wzs027mjhn959"))))
203 (build-system gnu-build-system)
204 (home-page "https://github.com/martinh/libconfuse")
205 (synopsis "Configuration file parser library")
206 (description "libconfuse is a configuration file parser library. It
207 supports sections and (lists of) values (strings, integers, floats, booleans
208 or other sections), as well as some other features (such as
209 single/double-quoted strings, environment variable expansion, functions and
210 nested include statements).")
211 (license license:isc)))
213 (define-public libgtextutils
215 (name "libgtextutils")
221 "https://github.com/agordon/libgtextutils/releases/download/"
222 version "/libgtextutils-" version ".tar.gz"))
224 (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
225 (build-system gnu-build-system)
228 (modify-phases %standard-phases
230 (lambda _ (invoke "sh" "reconf"))))))
232 `(("autoconf" ,autoconf)
233 ("automake" ,automake)
234 ("libtool" ,libtool)))
235 (home-page "https://github.com/agordon/libgtextutils")
236 (synopsis "Gordon's text utils library")
238 "libgtextutils is a text utilities library used by the fastx toolkit from
240 (license license:agpl3+)))
242 (define-public cityhash
243 (let ((commit "8af9b8c"))
246 (version (string-append "1.1-2." commit))
250 (url "https://github.com/google/cityhash.git")
252 (file-name (string-append name "-" version ".tar.gz"))
255 "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
256 (build-system gnu-build-system)
258 '(#:make-flags (list "CXXFLAGS=-g -O3")
260 (modify-phases %standard-phases
261 ;; citycrc is not installed by default but is used by some
263 (add-after 'install 'install-citycrc
264 (lambda* (#:key outputs #:allow-other-keys)
265 (let* ((out (assoc-ref outputs "out"))
266 (include (string-append out "/include")))
267 (install-file "src/citycrc.h" include))
269 (home-page "https://github.com/google/cityhash")
270 (synopsis "C++ hash functions for strings")
272 "CityHash provides hash functions for strings. The functions mix the
273 input bits thoroughly but are not suitable for cryptography.")
274 (license license:expat))))
282 (uri (string-append "http://www.and.org/ustr/" version
283 "/ustr-" version ".tar.bz2"))
286 "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))
287 (patches (search-patches "ustr-fix-build-with-gcc-5.patch"))))
288 (build-system gnu-build-system)
293 ;; Override "/sbin/ldconfig" with "echo" because we don't need
296 (string-append "prefix=" (assoc-ref %outputs "out"))
299 (modify-phases %standard-phases
300 (add-after 'unpack 'disable-check-for-stdint
302 ;; Of course we have stdint.h, just not in /usr/include
303 (substitute* '("Makefile"
305 (("-f \"/usr/include/stdint.h\"") "-z \"\""))
307 ;; No configure script
308 (delete 'configure))))
309 (home-page "http://www.and.org/ustr/")
310 (synopsis "String library with very low memory overhead")
312 "Ustr is a string library for C with very low memory overhead.")
313 ;; Quoted from the home page: "The License for the code is MIT, new-BSD,
314 ;; LGPL, etc. ... if you need another license to help compatibility, just
315 ;; ask for it. It's basically public domain, without all the legal
316 ;; problems for everyone that trying to make something public domain
318 (license license:public-domain)))
320 (define-public libconfig
324 (home-page "https://hyperrealm.github.io/libconfig/")
327 (uri (string-append home-page "/dist/libconfig-"
331 "1ngs2qx3cx5cbwinc5mvadly0b5n7s86zsc68c404czzfff7lg3w"))))
332 (build-system gnu-build-system)
333 (synopsis "C/C++ configuration file library")
335 "Libconfig is a simple library for manipulating structured configuration
336 files. This file format is more compact and more readable than XML. And
337 unlike XML, it is type-aware, so it is not necessary to do string parsing in
339 (license license:lgpl2.1+)))
347 (uri (string-append "https://github.com/pfff/pfff/archive/v"
349 (file-name (string-append name "-" version ".tar.gz"))
352 "00m553aa277iarxj6dalmklyb64r7ias49bfwzbacsfg8h3kar8m"))))
353 (build-system cmake-build-system)
354 (home-page "http://biit.cs.ut.ee/pfff/")
355 (synopsis "Probabilistic fast file fingerprinting tool")
357 "pfff is a tool for calculating a compact digital fingerprint of a file
358 by sampling randomly from the file instead of reading it in full.
359 Consequently, the computation has a flat performance characteristic,
360 correlated with data variation rather than file size. pfff can be as reliable
361 as existing hashing techniques, with provably negligible risk of collisions.")
362 (license license:bsd-3)))
364 (define-public oniguruma
370 (uri (string-append "https://github.com/kkos/"
371 "oniguruma/releases/download/v" version
372 "/onig-" version ".tar.gz"))
375 "0slp4hpw9qxk4xhn7abyw7065sd355xwkyfq72glxczcjsqxsynv"))))
376 (build-system gnu-build-system)
377 (home-page "https://github.com/kkos/oniguruma")
378 (synopsis "Regular expression library")
379 (description "Oniguruma is a regular expressions library. The special
380 characteristic of this library is that different character encoding for every
381 regular expression object can be specified.")
382 (license license:bsd-2)))
384 ;; PHP < 7.3.0 requires this old version. Remove once no longer needed.
385 (define-public oniguruma-5
391 (uri (string-append "https://github.com/kkos/"
392 "oniguruma/releases/download/v" version
393 "/onig-" version ".tar.gz"))
396 "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m"))))))
398 (define-public antiword
404 (uri (string-append "http://www.winfield.demon.nl/linux"
405 "/antiword-" version ".tar.gz"))
408 "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))
409 (patches (search-patches "antiword-CVE-2014-8123.patch"))))
410 (build-system gnu-build-system)
412 `(#:tests? #f ; There are no tests
414 (list "-f" "Makefile.Linux"
415 (string-append "GLOBAL_INSTALL_DIR="
416 (assoc-ref %outputs "out") "/bin")
417 (string-append "GLOBAL_RESOURCES_DIR="
418 (assoc-ref %outputs "out") "/share/antiword"))
420 (modify-phases %standard-phases
422 (lambda* (#:key outputs #:allow-other-keys)
423 ;; Ensure that mapping files can be found in the actual package
425 (substitute* "antiword.h"
426 (("/usr/share/antiword")
427 (string-append (assoc-ref outputs "out") "/share/antiword")))
430 (lambda* (#:key make-flags #:allow-other-keys)
431 (apply invoke "make" `("global_install" ,@make-flags)))))))
432 (home-page "http://www.winfield.demon.nl/")
433 (synopsis "Microsoft Word document reader")
434 (description "Antiword is an application for displaying Microsoft Word
435 documents. It can also convert the document to PostScript or XML. Only
436 documents made by MS Word version 2 and version 6 or later are supported. The
437 name comes from: \"The antidote against people who send Microsoft Word files
438 to everybody, because they believe that everybody runs Windows and therefore
440 (license license:gpl2+)))
442 (define-public catdoc
448 (uri (string-append "http://ftp.wagner.pp.ru/pub/catdoc/"
449 "catdoc-" version ".tar.gz"))
450 (patches (search-patches "catdoc-CVE-2017-11110.patch"))
453 "15h7v3bmwfk4z8r78xs5ih6vd0pskn0rj90xghvbzdjj0cc88jji"))))
454 (build-system gnu-build-system)
455 ;; TODO: Also build `wordview` which requires `tk` – make a separate
458 '(#:tests? #f ; There are no tests
459 #:configure-flags '("--disable-wordview")
461 (modify-phases %standard-phases
462 (add-before 'install 'fix-install
463 (lambda* (#:key outputs #:allow-other-keys)
464 (let ((out (assoc-ref outputs "out")))
465 (mkdir-p (string-append out "/share/man/man1"))))))))
466 (home-page "http://www.wagner.pp.ru/~vitus/software/catdoc/")
467 (synopsis "MS-Word to TeX or plain text converter")
468 (description "@command{catdoc} extracts text from MS-Word files, trying to
469 preserve as many special printable characters as possible. It supports
470 everything up to Word-97. Also supported are MS Write documents and RTF files.
472 @command{catdoc} does not preserve complex word formatting, but it can
473 translate some non-ASCII characters into TeX escape codes. It's goal is to
474 extract plain text and allow you to read it and, probably, reformat with TeX,
475 according to TeXnical rules.
477 This package also provides @command{xls2csv}, which extracts data from Excel
478 spreadsheets and outputs it in comma-separated-value format, and
479 @command{catppt}, which extracts data from PowerPoint presentations.")
480 (license license:gpl2+)))
482 (define-public utfcpp
489 (string-append "https://github.com/nemtrif/utfcpp/archive/v"
491 (file-name (string-append name "-" version ".tar.gz"))
494 "0gcqcfw19kfim8xw29xdp91l310yfjyrqdj2zsx8xx02dkpy1zzk"))))
495 (build-system cmake-build-system)
497 `(#:out-of-source? #f
499 (modify-phases %standard-phases
500 (replace 'install ; no install target
501 (lambda* (#:key outputs #:allow-other-keys)
502 (let* ((out (assoc-ref outputs "out"))
503 (include (string-append out "/include"))
504 (doc (string-append out "/share/doc/" ,name)))
505 (copy-recursively "source" include)
506 (install-file "README.md" doc)
508 (home-page "https://github.com/nemtrif/utfcpp")
509 (synopsis "Portable C++ library for handling UTF-8")
510 (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
512 (license license:boost1.0)))
521 (uri (string-append "http://www.lbreyer.com/gpl/"
522 "dbacl-" version ".tar.gz"))
525 "0224g6x71hyvy7jikfxmgcwww1r5lvk0jx36cva319cb9nmrbrq7"))))
526 (build-system gnu-build-system)
530 (string-append "-I" (assoc-ref %build-inputs "slang")
532 (string-append "-I" (assoc-ref %build-inputs "ncurses")
535 (modify-phases %standard-phases
536 (add-after 'unpack 'delete-sample6-and-japanese
538 (substitute* "doc/Makefile.am"
540 (("japanese.txt") ""))
541 (delete-file "doc/sample6.txt")
542 (delete-file "doc/japanese.txt")
543 (substitute* (list "src/tests/Makefile.am"
544 "src/tests/Makefile.in")
545 (("dbacl-jap.shin") "")
546 (("dbacl-jap.sh") ""))
548 (add-after 'unpack 'delete-test
549 ;; See comments about the license.
551 (delete-file "src/tests/dbacl-jap.shin")
553 (add-after 'delete-sample6-and-japanese 'autoreconf
555 (invoke "autoreconf" "-vif")
557 (add-after 'unpack 'fix-test-files
558 (lambda* (#:key inputs outputs #:allow-other-keys)
559 (let* ((out (assoc-ref outputs "out"))
560 (bin (string-append out "/bin")))
561 (substitute* (find-files "src/tests/" "\\.shin$")
562 (("PATH=/bin:/usr/bin")
563 "#PATH=/bin:/usr/bin")
564 (("diff") (string-append (which "diff")))
565 (("tr") (string-append (which "tr"))))
568 `(("ncurses" ,ncurses)
570 ("readline" ,readline)
573 `(("libtool" ,libtool)
574 ("autoconf" ,autoconf)
575 ("automake" ,automake)
576 ("pkg-config" ,pkg-config)))
577 (home-page "https://www.lbreyer.com/dbacl.html")
578 (synopsis "Bayesian text and email classifier")
580 "dbacl is a fast Bayesian text and email classifier. It builds a variety
581 of language models using maximum entropy (minimum divergence) principles, and
582 these can then be used to categorize input data automatically among multiple
584 ;; The software is licensed as GPLv3 or later, but
585 ;; includes various sample texts in the doc dir:
586 ;; - sample1.txt, sample3 and sampe5.txt are in the public domain,
588 ;; - sample2.txt, sample4.txt are in the public domain, by Aristotle.
589 ;; - sample6.txt is a forwarded email, copyright unknown.
590 ;; Guix does exclude sample6.txt.
591 ;; - japanese.txt is a Japanese unoffical translation of the
592 ;; GNU General Public License, (c) by the Free Software Foundation.
593 ;; Guix excludes this file.
594 (license (list license:gpl3+ license:public-domain))))
596 (define-public dotconf
603 (url "https://github.com/williamh/dotconf.git")
604 (commit (string-append "v" version))))
605 (file-name (git-file-name name version))
608 "1sc95hw5k2xagpafny0v35filmcn05k1ds5ghkldfpf6xw4hakp7"))))
609 (build-system gnu-build-system)
610 (arguments `(#:tests? #f)) ; FIXME maketest.sh does not work.
612 `(("autoconf" ,autoconf)
613 ("automake" ,automake)
614 ("libtool" ,libtool)))
615 (home-page "https://github.com/williamh/dotconf")
616 (synopsis "Configuration file parser library")
618 "C library for creating and parsing configuration files.")
619 (license (list license:lgpl2.1 ; Main distribution.
620 license:asl1.1)))) ; src/readdir.{c,h}
622 (define-public java-rsyntaxtextarea
624 (name "java-rsyntaxtextarea")
628 (uri (string-append "https://github.com/bobbylight/"
629 "RSyntaxTextArea/archive/"
631 (file-name (string-append name "-" version ".tar.gz"))
634 "0c5mqg2klj5rvf8fhycrli8rf6s37l9p7a8knw9gpp65r1c120q2"))))
635 (build-system ant-build-system)
637 `(;; FIXME: some tests fail because locale resources cannot be found.
638 ;; Even when I add them to the class path,
639 ;; RSyntaxTextAreaEditorKitDumbCompleteWordActionTest fails.
641 #:jar-name "rsyntaxtextarea.jar"))
643 `(("java-junit" ,java-junit)
644 ("java-hamcrest-core" ,java-hamcrest-core)))
645 (home-page "https://bobbylight.github.io/RSyntaxTextArea/")
646 (synopsis "Syntax highlighting text component for Java Swing")
647 (description "RSyntaxTextArea is a syntax highlighting, code folding text
648 component for Java Swing. It extends @code{JTextComponent} so it integrates
649 completely with the standard @code{javax.swing.text} package. It is fast and
650 efficient, and can be used in any application that needs to edit or view
652 (license license:bsd-3)))
654 ;; We use the sources from git instead of the tarball from pypi, because the
655 ;; latter does not include the Cython source file from which bycython.cpp is
657 (define-public python-editdistance
658 (let ((commit "3ea84a7dd3258c76aa3be851ef3d50e59c886846")
661 (name "python-editdistance")
662 (version (string-append "0.3.1-" revision "." (string-take commit 7)))
667 (url "https://github.com/aflc/editdistance.git")
669 (file-name (git-file-name name version))
672 "1l43svsv12crvzphrgi6x435z6xg8m086c64armp8wzb4l8ccm7g"))))
673 (build-system python-build-system)
676 (modify-phases %standard-phases
677 (add-after 'unpack 'build-cython-code
679 (with-directory-excursion "editdistance"
680 (delete-file "bycython.cpp")
681 (invoke "cython" "--cplus" "bycython.pyx")))))))
683 `(("python-cython" ,python-cython)))
684 (home-page "https://www.github.com/aflc/editdistance")
685 (synopsis "Fast implementation of the edit distance (Levenshtein distance)")
687 "This library simply implements Levenshtein distance algorithm with C++
689 (license license:expat))))
691 (define-public go-github.com-mattn-go-runewidth
693 (name "go-github.com-mattn-go-runewidth")
698 (url "https://github.com/mattn/go-runewidth")
699 (commit (string-append "v" version))))
700 (file-name (git-file-name name version))
703 "0vkrfrz3fzn5n6ix4k8s0cg0b448459sldq8bp4riavsxm932jzb"))))
704 (build-system go-build-system)
706 '(#:import-path "github.com/mattn/go-runewidth"))
707 (synopsis "@code{runewidth} provides Go functions to work with string widths")
709 "The @code{runewidth} library provides Go functions for padding,
710 measuring and checking the width of strings, with support east asian text.")
711 (home-page "https://github.com/jessevdk/go-flags")
712 (license license:expat)))
714 (define-public docx2txt
721 "mirror://sourceforge/docx2txt/docx2txt/v"
722 version "/docx2txt-" version ".tgz"))
725 "06vdikjvpj6qdb41d8wzfnyj44jpnknmlgbhbr1w215420lpb5xj"))))
726 (build-system gnu-build-system)
731 `(#:tests? #f ; No tests.
732 #:make-flags (list (string-append "BINDIR="
733 (assoc-ref %outputs "out") "/bin")
734 (string-append "CONFIGDIR="
735 (assoc-ref %outputs "out") "/etc")
736 ;; Makefile seems to be a bit dumb at guessing.
737 (string-append "INSTALL=install")
738 (string-append "PERL=perl"))
740 (modify-phases %standard-phases
742 (add-after 'install 'fix-install
743 (lambda* (#:key outputs inputs #:allow-other-keys)
744 (let* ((out (assoc-ref outputs "out"))
745 (bin (string-append out "/bin"))
746 (config (string-append out "/etc/docx2txt.config"))
747 (unzip (assoc-ref inputs "unzip")))
748 ;; According to INSTALL, the .sh wrapper can be skipped.
749 (delete-file (string-append bin "/docx2txt.sh"))
750 (rename-file (string-append bin "/docx2txt.pl")
751 (string-append bin "/docx2txt"))
753 (("config_unzip => '/usr/bin/unzip',")
754 (string-append "config_unzip => '"
757 ;; Makefile is wrong.
760 (synopsis "Recover text from @file{.docx} files, with good formatting")
762 "@command{docx2txt} is a Perl based command line utility to convert
763 Microsoft Office @file{.docx} documents to equivalent text documents. Latest
764 version supports following features during text extraction.
767 @item Character conversions; currency characters are converted to respective
769 @item Capitalisation of text blocks.
770 @item Center and right justification of text fitting in a line of
771 (configurable) 80 columns.
772 @item Horizontal ruler, line breaks, paragraphs separation, tabs.
773 @item Indicating hyperlinked text along with the hyperlink (configurable).
774 @item Handling (bullet, decimal, letter, roman) lists along with (attempt at)
777 (home-page "http://docx2txt.sourceforge.net")
778 (license license:gpl3+)))
780 (define-public opencc
788 (url "https://github.com/BYVoid/OpenCC")
789 (commit (string-append "ver." version))))
790 (file-name (git-file-name name version))
793 "1pv5md225qwhbn8ql932zdg6gh1qlx3paiajaks8gfsa07yzvhr4"))
794 (modules '((guix build utils)))
797 ;; TODO: Unbundle tclap, darts-clone, gtest
798 (delete-file-recursively "deps/rapidjson-0.11") #t))))
799 (build-system cmake-build-system)
802 (modify-phases %standard-phases
803 (add-after 'unpack 'patch-3rd-party-references
804 (lambda* (#:key inputs #:allow-other-keys)
805 (let ((rapidjson (assoc-ref inputs "rapidjson")))
806 (substitute* "src/CMakeLists.txt"
807 (("../deps/rapidjson-0.11")
808 (string-append rapidjson "/include/rapidjson")))
811 `(("python" ,python-wrapper)
812 ("rapidjson" ,rapidjson)))
813 (home-page "https://github.com/BYVoid/OpenCC")
814 (synopsis "Convert between Traditional Chinese and Simplified Chinese")
815 (description "Open Chinese Convert (OpenCC) converts between Traditional
816 Chinese and Simplified Chinese, supporting character-level conversion,
817 phrase-level conversion, variant conversion, and regional idioms among
818 Mainland China, Taiwan, and Hong-Kong.")
819 (license license:asl2.0)))
822 (let ((commit "08043eadf4abdddcf277842217e3c77a24740dc2")
826 ;; The commits corresponding to specific versions are published
828 ;; https://ja.osdn.net/projects/nkf/scm/git/nkf/
833 (url "https://github.com/nurse/nkf.git")
835 (file-name (git-file-name name version))
838 "0anw0knr1iy4p9w3d3b3pbwzh1c43p1i2q4c28kw9zviw8kx2rly"))))
839 (build-system gnu-build-system)
841 `(#:tests? #f ; test for perl module
842 #:make-flags (list "CC=gcc" "CFLAGS=-O2 -Wall -pedantic"
843 (string-append "prefix=" %output)
846 (modify-phases %standard-phases
847 (delete 'configure)))) ; No ./configure script
848 (home-page "https://ja.osdn.net/projects/nkf/")
849 (synopsis "Network Kanji Filter")
850 (description "Nkf is yet another kanji code converter among networks,
851 hosts and terminals. It converts input kanji code to designated kanji code
852 such as ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8, UTF-16 or UTF-32.")
853 (license license:zlib))))
855 (define-public python-pandocfilters
857 (name "python-pandocfilters")
862 (uri (pypi-uri "pandocfilters" version))
865 "1a8d9b7s48gmq9zj0pmbyv2sivn5i7m6mybgpkk4jm5vd7hp1pdk"))))
866 (build-system python-build-system)
867 (home-page "https://github.com/jgm/pandocfilters")
868 (synopsis "Python module for writing Pandoc filters")
869 (description "Pandoc is a powerful utility to transform various
870 input formats into a wide range of output formats. To alter the
871 exported output document, Pandoc allows the usage of filters, which
872 are pipes that read a JSON serialization of the Pandoc AST from stdin,
873 transform it in some way, and write it to stdout. It allows therefore
874 to alter the processing of Pandoc's supported input formats, for
875 instance one can add new syntax elements to markdown, etc.
877 This package provides Python bindings.")
878 (license license:bsd-3)))