Merge remote-tracking branch 'signed/master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / textutils.scm
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, 2020 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, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Nikita <nikita@n0.is>
10 ;;; Copyright © 2016, 2020 Marius Bakke <marius@gnu.org>
11 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
12 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
13 ;;; Copyright © 2017,2019 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, 2019, 2020 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>
20 ;;; Copyright © 2019 Mădălin Ionel Patrașcu <madalinionel.patrascu@mdc-berlin.de>
21 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
22 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
23 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
24 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
25 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
26 ;;;
27 ;;; This file is part of GNU Guix.
28 ;;;
29 ;;; GNU Guix is free software; you can redistribute it and/or modify it
30 ;;; under the terms of the GNU General Public License as published by
31 ;;; the Free Software Foundation; either version 3 of the License, or (at
32 ;;; your option) any later version.
33 ;;;
34 ;;; GNU Guix is distributed in the hope that it will be useful, but
35 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 ;;; GNU General Public License for more details.
38 ;;;
39 ;;; You should have received a copy of the GNU General Public License
40 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42 (define-module (gnu packages textutils)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix build-system ant)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system go)
50 #:use-module (guix build-system cmake)
51 #:use-module (guix build-system python)
52 #:use-module (guix utils)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages base)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages golang)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages java)
61 #:use-module (gnu packages ncurses)
62 #:use-module (gnu packages pcre)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages python)
66 #:use-module (gnu packages python-build)
67 #:use-module (gnu packages python-xyz)
68 #:use-module (gnu packages readline)
69 #:use-module (gnu packages ruby)
70 #:use-module (gnu packages slang)
71 #:use-module (gnu packages web))
72
73 (define-public dos2unix
74 (package
75 (name "dos2unix")
76 (version "7.4.2")
77 (source
78 (origin
79 (method url-fetch)
80 (uri (string-append "https://waterlan.home.xs4all.nl/dos2unix/"
81 "dos2unix-" version ".tar.gz"))
82 (sha256
83 (base32 "00dfsf4rfyjb5j12gan8xjiirm0asshdz6dmd3l34a7ays6wadb0"))))
84 (build-system gnu-build-system)
85 (arguments
86 `(#:make-flags
87 (list (string-append "CC=" ,(cc-for-target))
88 (string-append "prefix=" (assoc-ref %outputs "out")))
89 #:phases
90 (modify-phases %standard-phases
91 (delete 'configure)))) ; no configure script
92 (native-inputs
93 `(("gettext" ,gettext-minimal)
94 ("perl" ,perl)))
95 (home-page "https://waterlan.home.xs4all.nl/dos2unix.html")
96 (synopsis "DOS/Mac to Unix and vice versa text file format converter")
97 (description
98 "dos2unix is a tool to convert line breaks in a text file from Unix format
99 to DOS format and vice versa.")
100 (license license:bsd-2)))
101
102 (define-public recode
103 (package
104 (name "recode")
105 (version "3.7.6")
106 (source
107 (origin
108 (method url-fetch)
109 (uri (string-append "https://github.com/rrthomas/recode/releases/"
110 "download/v" version "/recode-" version ".tar.gz"))
111 (sha256
112 (base32 "0m59sd1ca0zw1aydpc3m8sw03nc885knmccqryg7byzmqs585ia6"))))
113 (build-system gnu-build-system)
114 (native-inputs
115 `(("python" ,python)
116 ("python-cython" ,python-cython)))
117 (home-page "https://github.com/rrthomas/recode")
118 (synopsis "Text encoding converter")
119 (description "The Recode library converts files between character sets and
120 usages. It recognises or produces over 200 different character sets (or about
121 300 if combined with an iconv library) and transliterates files between almost
122 any pair. When exact transliteration are not possible, it gets rid of
123 offending characters or falls back on approximations. The recode program is a
124 handy front-end to the library.")
125 (license license:gpl3+)))
126
127 (define-public enca
128 (package
129 (name "enca")
130 (version "1.19")
131 (source
132 (origin
133 (method git-fetch)
134 (uri (git-reference
135 (url "https://github.com/nijel/enca")
136 (commit version)))
137 (file-name (git-file-name name version))
138 (sha256
139 (base32 "19q7cwwxmmk5j9438bsqdpjvdjawsd3zmw1zyqgi7s4m0rasr3ah"))))
140 (build-system gnu-build-system)
141 ;; enca-1.19 tests fail with recent recode.
142 ;(inputs `(("recode" ,recode)))
143 (home-page "https://github.com/nijel/enca")
144 (synopsis "Text encoding detection tool")
145 (description "Enca (Extremely Naive Charset Analyser) consists of libenca,
146 an encoding detection library, and enca, a command line frontend, integrating
147 libenca and several charset conversion libraries and tools.")
148 (license license:gpl2)))
149
150 (define-public utf8proc
151 (package
152 (name "utf8proc")
153 (version "2.5.0")
154 (source
155 (origin
156 (method git-fetch)
157 (uri (git-reference
158 (url "https://github.com/JuliaStrings/utf8proc")
159 (commit (string-append "v" version))))
160 (file-name (git-file-name name version))
161 (sha256
162 (base32 "1xlkazhdnja4lksn5c9nf4bln5gjqa35a8gwlam5r0728w0h83qq"))))
163 (build-system gnu-build-system)
164 (native-inputs
165 (let ((UNICODE_VERSION "13.0.0")) ; defined in data/Makefile
166 ;; Test data that is otherwise downloaded with curl.
167 `(("NormalizationTest.txt"
168 ,(origin
169 (method url-fetch)
170 (uri (string-append "https://www.unicode.org/Public/"
171 UNICODE_VERSION "/ucd/NormalizationTest.txt"))
172 (sha256
173 (base32 "07g0ya4f6zfzvpp24ccxkb2yq568kh83gls85rjl950nv5fya3nn"))))
174 ("GraphemeBreakTest.txt"
175 ,(origin
176 (method url-fetch)
177 (uri (string-append "https://www.unicode.org/Public/"
178 UNICODE_VERSION
179 "/ucd/auxiliary/GraphemeBreakTest.txt"))
180 (sha256
181 (base32 "07f8rrvcsq4pibdz6zxggxy8w7zjjqyw2ggclqlhalyv45yv7prj"))))
182
183 ;; For tests.
184 ("perl" ,perl))))
185 (arguments
186 '(#:make-flags (list "CC=gcc"
187 (string-append "prefix=" (assoc-ref %outputs "out")))
188 #:phases
189 (modify-phases %standard-phases
190 (delete 'configure)
191 (add-before 'check 'check-data
192 (lambda* (#:key inputs #:allow-other-keys)
193 (for-each (lambda (i)
194 (copy-file (assoc-ref inputs i)
195 (string-append "data/" i)))
196 '("NormalizationTest.txt" "GraphemeBreakTest.txt"))
197 (substitute* "data/GraphemeBreakTest.txt"
198 (("÷") "/")
199 (("×") "+"))
200 #t)))))
201 (home-page "https://juliastrings.github.io/utf8proc/")
202 (synopsis "C library for processing UTF-8 Unicode data")
203 (description "utf8proc is a small C library that provides Unicode
204 normalization, case-folding, and other operations for data in the UTF-8
205 encoding, supporting Unicode version 9.0.0.")
206 (license license:expat)))
207
208 (define-public utf8proc-2.6.1
209 (package
210 (inherit utf8proc)
211 (name "utf8proc")
212 (version "2.6.1")
213 (source
214 (origin
215 (method git-fetch)
216 (uri (git-reference
217 (url "https://github.com/JuliaStrings/utf8proc")
218 (commit (string-append "v" version))))
219 (file-name (git-file-name name version))
220 (sha256
221 (base32 "1zqc6airkzkssbjxanx5v8blfk90180gc9id0dx8ncs54f1ib8w7"))))
222 (arguments
223 (substitute-keyword-arguments (package-arguments utf8proc)
224 ((#:phases phases)
225 `(modify-phases ,phases
226 (replace 'check-data
227 (lambda* (#:key inputs native-inputs #:allow-other-keys)
228 (display native-inputs)
229 (for-each (lambda (i)
230 (copy-file (assoc-ref (or native-inputs inputs) i)
231 (string-append "data/" i)))
232 '("NormalizationTest.txt" "GraphemeBreakTest.txt"
233 "DerivedCoreProperties.txt"))))))))
234 (native-inputs
235 (append
236 (package-native-inputs utf8proc)
237 (let ((UNICODE_VERSION "13.0.0"))
238 `(("DerivedCoreProperties.txt"
239 ,(origin
240 (method url-fetch)
241 (uri (string-append "https://www.unicode.org/Public/"
242 UNICODE_VERSION "/ucd/DerivedCoreProperties.txt"))
243 (sha256
244 (base32 "0j12x112cd8fpgazkc8izxnhhpia44p1m36ff8yapslxndcmzm55"))))
245 ;; For tests
246 ("ruby" ,ruby)))))))
247
248 (define-public libconfuse
249 (package
250 (name "libconfuse")
251 (version "3.3")
252 (source
253 (origin
254 (method url-fetch)
255 (uri (string-append "https://github.com/martinh/libconfuse/"
256 "releases/download/v" version
257 "/confuse-" version ".tar.xz"))
258 (sha256
259 (base32 "043hqqykpprgrkw9s2hbdlxr308a7yxwsgxj4m8aadg1401hmm8x"))))
260 (build-system gnu-build-system)
261 (arguments
262 '(#:configure-flags '("--disable-static")))
263 (home-page "https://github.com/martinh/libconfuse")
264 (synopsis "Configuration file parser library")
265 (description "libconfuse is a configuration file parser library. It
266 supports sections and (lists of) values (strings, integers, floats, booleans
267 or other sections), as well as some other features (such as
268 single/double-quoted strings, environment variable expansion, functions and
269 nested include statements).")
270 (license license:isc)))
271
272 (define-public libgtextutils
273 (package
274 (name "libgtextutils")
275 (version "0.7")
276 (source
277 (origin
278 (method url-fetch)
279 (uri (string-append
280 "https://github.com/agordon/libgtextutils/releases/download/"
281 version "/libgtextutils-" version ".tar.gz"))
282 (sha256
283 (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
284 (build-system gnu-build-system)
285 (arguments
286 `(#:phases
287 (modify-phases %standard-phases
288 (replace 'bootstrap
289 (lambda _ (invoke "sh" "reconf")))
290 (add-after 'set-paths 'hide-default-gcc
291 (lambda* (#:key inputs #:allow-other-keys)
292 (let ((gcc (assoc-ref inputs "gcc")))
293 ;; Remove the default GCC from CPLUS_INCLUDE_PATH to prevent
294 ;; conflicts with the GCC 5 input.
295 (setenv "CPLUS_INCLUDE_PATH"
296 (string-join
297 (delete (string-append gcc "/include/c++")
298 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
299 ":"))
300 #t))))))
301 (native-inputs
302 `(("autoconf" ,autoconf)
303 ("automake" ,automake)
304 ("gcc@5" ,gcc-5) ; doesn't build with later versions
305 ("libtool" ,libtool)))
306 (home-page "https://github.com/agordon/libgtextutils")
307 (synopsis "Gordon's text utils library")
308 (description
309 "libgtextutils is a text utilities library used by the fastx toolkit from
310 the Hannon Lab.")
311 (license license:agpl3+)))
312
313 (define-public cityhash
314 (let ((commit "8af9b8c"))
315 (package
316 (name "cityhash")
317 (version (string-append "1.1-2." commit))
318 (source (origin
319 (method git-fetch)
320 (uri (git-reference
321 (url "https://github.com/google/cityhash")
322 (commit commit)))
323 (file-name (string-append name "-" version ".tar.gz"))
324 (sha256
325 (base32
326 "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
327 (build-system gnu-build-system)
328 (arguments
329 '(#:make-flags (list "CXXFLAGS=-g -O3")
330 #:phases
331 (modify-phases %standard-phases
332 ;; citycrc is not installed by default but is used by some
333 ;; programs.
334 (add-after 'install 'install-citycrc
335 (lambda* (#:key outputs #:allow-other-keys)
336 (let* ((out (assoc-ref outputs "out"))
337 (include (string-append out "/include")))
338 (install-file "src/citycrc.h" include))
339 #t)))))
340 (home-page "https://github.com/google/cityhash")
341 (synopsis "C++ hash functions for strings")
342 (description
343 "CityHash provides hash functions for strings. The functions mix the
344 input bits thoroughly but are not suitable for cryptography.")
345 (license license:expat))))
346
347 (define-public ustr
348 (package
349 (name "ustr")
350 (version "1.0.4")
351 (source (origin
352 (method url-fetch)
353 (uri (string-append "http://www.and.org/ustr/" version
354 "/ustr-" version ".tar.bz2"))
355 (sha256
356 (base32
357 "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))
358 (patches (search-patches "ustr-fix-build-with-gcc-5.patch"))))
359 (build-system gnu-build-system)
360 (arguments
361 `(#:make-flags
362 (list (string-append "CC=" ,(cc-for-target))
363 "HIDE="
364 ;; Override "/sbin/ldconfig" with "echo" because we don't need
365 ;; "ldconfig".
366 "LDCONFIG=echo"
367 (string-append "prefix=" (assoc-ref %outputs "out"))
368 "all-shared")
369 #:phases
370 (modify-phases %standard-phases
371 (add-after 'unpack 'fix-cross-compilation
372 ;; The Makefile contains more insults than cross-compilation support.
373 ;; It poorly reinvents autotools by compiling C programmes with $CC,
374 ;; then tries to run them during the build. Hard-code the results.
375 (lambda _
376 (substitute* "Makefile"
377 (("\\./autoconf_64b")
378 ,(if (target-64bit? (or (%current-target-system)
379 (%current-system)))
380 "echo 1"
381 "echo 0"))
382 (("\\./autoconf_vsnprintf") "echo 0"))))
383 (add-after 'unpack 'omit-static-libraries
384 ;; These are needed to build & test ustr, but don't install them.
385 (lambda _
386 (substitute* "Makefile"
387 ((".*install.*LIB_STATIC.*") ""))))
388 (add-after 'unpack 'disable-check-for-stdint
389 (lambda _
390 ;; Of course we have stdint.h, just not in /usr/include
391 (substitute* '("Makefile"
392 "ustr-import.in")
393 (("-f \"/usr/include/stdint.h\"") "-z \"\""))
394 #t))
395 ;; No configure script
396 (delete 'configure))))
397 (home-page "http://www.and.org/ustr/")
398 (synopsis "String library with very low memory overhead")
399 (description
400 "Ustr is a string library for C with very low memory overhead.")
401 ;; Quoted from the home page: "The License for the code is MIT, new-BSD,
402 ;; LGPL, etc. ... if you need another license to help compatibility, just
403 ;; ask for it. It's basically public domain, without all the legal
404 ;; problems for everyone that trying to make something public domain
405 ;; entails."
406 (license license:public-domain)))
407
408 (define-public ascii2binary
409 (package
410 (name "ascii2binary")
411 (version "2.14")
412 (source
413 (origin
414 (method url-fetch)
415 (uri (string-append "http://billposer.org/Software/Downloads/"
416 "ascii2binary-" version ".tar.bz2"))
417 (sha256
418 (base32 "0dc9fxcdmppbs9s06jvq61zbk552laxps0xyk098gj41697ihd96"))))
419 (build-system gnu-build-system)
420 (native-inputs
421 `(("gettext" ,gettext-minimal)))
422 (home-page "https://billposer.org/Software/a2b.html")
423 (synopsis "Convert between ASCII, hexadecimal and binary representations")
424 (description "The two programs are useful for generating test data, for
425 inspecting binary files, and for interfacing programs that generate textual
426 output to programs that require binary input and conversely. They can also be
427 useful when it is desired to reformat numbers.
428
429 @itemize
430
431 @item @command{ascii2binary} reads input consisting of ascii or hexadecimal
432 representation numbers separated by whitespace and produces as output
433 the binary equivalents. The type and precision of the binary output
434 is selected using command line flags.
435
436 @item @command{binary2ascii} reads input consisting of binary numbers
437 and converts them to their ascii or hexadecimal representation.
438 Command line flags specify the type and size of the binary numbers
439 and provide control over the format of the output.
440 Unsigned integers may be written out in binary, octal, decimal,
441 or hexadecimal.
442
443 Signed integers may be written out only in binary or decimal. Floating
444 point numbers may be written out only decimal, either in standard or
445 scientific notation. (If you want to examine the binary representation
446 of floating point numbers, just treat the input as a sequence of unsigned
447 characters.)
448
449 @end itemize")
450 (license license:gpl3)))
451
452 (define-public uniutils
453 (package
454 (name "uniutils")
455 (version "2.27")
456 (source
457 (origin
458 (method url-fetch)
459 (uri (string-append "http://billposer.org/Software/Downloads/"
460 "uniutils-" version ".tar.bz2"))
461 (sha256
462 (base32 "19w1510w87gx7n4qy3zsb0m467a4rn5scvh4ajajg7jh6x5xri08"))))
463 (build-system gnu-build-system)
464 (arguments
465 '(#:configure-flags '("--disable-dependency-tracking")
466 #:phases
467 (modify-phases %standard-phases
468 (add-after 'build 'fix-paths
469 (lambda* (#:key outputs inputs #:allow-other-keys)
470 (let ((out (assoc-ref outputs "out"))
471 (a2b (assoc-ref inputs "ascii2binary"))
472 (iconv (assoc-ref inputs "libiconv")))
473 (substitute* "utf8lookup"
474 (("^ascii2binary ") (string-append a2b "/bin/ascii2binary "))
475 (("^uniname ") (string-append out "/bin/uniname "))
476 (("^iconv ") (string-append iconv "/bin/iconv ")))
477 #t))))))
478 (inputs
479 `(("ascii2binary" ,ascii2binary)
480 ("libiconv" ,libiconv)))
481 (home-page "https://billposer.org/Software/unidesc.html")
482 (synopsis "Find out what is in a Unicode file")
483 (description "Useful tools when working with Unicode files when one
484 doesn't know the writing system, doesn't have the necessary font, needs to
485 inspect invisible characters, needs to find out whether characters have been
486 combined or in what order they occur, or needs statistics on which characters
487 occur.
488
489 @itemize
490
491 @item @command{uniname} defaults to printing the character offset of each
492 character, its byte offset, its hex code value, its encoding, the glyph
493 itself, and its name. It may also be used to validate UTF-8 input.
494
495 @item @command{unidesc} reports the character ranges to which different
496 portions of the text belong. It can also be used to identify Unicode encodings
497 (e.g. UTF-16be) flagged by magic numbers.
498
499 @item @command{unihist} generates a histogram of the characters in its input.
500
501 @item @command{ExplicateUTF8} is intended for debugging or for learning about
502 Unicode. It determines and explains the validity of a sequence of bytes as a
503 UTF8 encoding.
504
505 @item @command{utf8lookup} provides a handy way to look up Unicode characters
506 from the command line.
507
508 @item @command{unireverse} reverse each line of UTF-8 input
509 character-by-character.
510
511 @end itemize")
512 (license license:gpl3)))
513
514 (define-public libconfig
515 (package
516 (name "libconfig")
517 (version "1.7.3")
518 (home-page "https://hyperrealm.github.io/libconfig/")
519 (source (origin
520 (method url-fetch)
521 (uri (string-append home-page "/dist/libconfig-"
522 version ".tar.gz"))
523 (sha256
524 (base32
525 "1rqynfxl1zxwk4b42sniz9xlw285aidcrsfih51p8dy0rbb6clal"))))
526 (build-system gnu-build-system)
527 (synopsis "C/C++ configuration file library")
528 (description
529 "Libconfig is a simple library for manipulating structured configuration
530 files. This file format is more compact and more readable than XML. And
531 unlike XML, it is type-aware, so it is not necessary to do string parsing in
532 application code.")
533 (license license:lgpl2.1+)))
534
535 (define-public pfff
536 (package
537 (name "pfff")
538 (version "1.0")
539 (source (origin
540 (method git-fetch)
541 (uri (git-reference
542 (url "https://github.com/pfff/pfff")
543 (commit (string-append "v" version))))
544 (file-name (git-file-name name version))
545 (sha256
546 (base32
547 "1nxkfm7zliq3rmr7yp871sppwfnz71iz364m2sgazny71pzykggc"))))
548 (build-system cmake-build-system)
549 (home-page "https://biit.cs.ut.ee/pfff/")
550 (synopsis "Probabilistic fast file fingerprinting tool")
551 (description
552 "pfff is a tool for calculating a compact digital fingerprint of a file
553 by sampling randomly from the file instead of reading it in full.
554 Consequently, the computation has a flat performance characteristic,
555 correlated with data variation rather than file size. pfff can be as reliable
556 as existing hashing techniques, with provably negligible risk of collisions.")
557 (license license:bsd-3)))
558
559 (define-public oniguruma
560 (package
561 (name "oniguruma")
562 (version "6.9.5-rev1")
563 (source (origin
564 (method url-fetch)
565 (uri (string-append "https://github.com/kkos/"
566 "oniguruma/releases/download/v"
567 ;; If there is a "-" in the version, convert
568 ;; to underscore for this part of the URI.
569 (string-map (lambda (c) (if (char=? #\- c) #\_ c))
570 version)
571 "/onig-" version ".tar.gz"))
572 (sha256
573 (base32
574 "17m92k1n6bvza6m35fpd5g36zwpwm3hfz3478iwj5bvj2sfq8g6k"))))
575 (build-system gnu-build-system)
576 (arguments '(#:configure-flags '("--disable-static")))
577 (home-page "https://github.com/kkos/oniguruma")
578 (synopsis "Regular expression library")
579 (description "Oniguruma is a regular expressions library. The special
580 characteristic of this library is that different character encoding for every
581 regular expression object can be specified.")
582 (license license:bsd-2)))
583
584 (define-public antiword
585 (package
586 (name "antiword")
587 (version "0.37")
588 (source (origin
589 (method url-fetch)
590 (uri (string-append "http://www.winfield.demon.nl/linux"
591 "/antiword-" version ".tar.gz"))
592 (sha256
593 (base32
594 "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))
595 (patches (search-patches "antiword-CVE-2014-8123.patch"))))
596 (build-system gnu-build-system)
597 (arguments
598 `(#:tests? #f ; There are no tests
599 #:make-flags
600 (list "-f" "Makefile.Linux"
601 (string-append "GLOBAL_INSTALL_DIR="
602 (assoc-ref %outputs "out") "/bin")
603 (string-append "GLOBAL_RESOURCES_DIR="
604 (assoc-ref %outputs "out") "/share/antiword"))
605 #:phases
606 (modify-phases %standard-phases
607 (replace 'configure
608 (lambda* (#:key outputs #:allow-other-keys)
609 ;; Ensure that mapping files can be found in the actual package
610 ;; data directory.
611 (substitute* "antiword.h"
612 (("/usr/share/antiword")
613 (string-append (assoc-ref outputs "out") "/share/antiword")))
614 #t))
615 (replace 'install
616 (lambda* (#:key make-flags #:allow-other-keys)
617 (apply invoke "make" `("global_install" ,@make-flags)))))))
618 (home-page "http://www.winfield.demon.nl/")
619 (synopsis "Microsoft Word document reader")
620 (description "Antiword is an application for displaying Microsoft Word
621 documents. It can also convert the document to PostScript or XML. Only
622 documents made by MS Word version 2 and version 6 or later are supported. The
623 name comes from: \"The antidote against people who send Microsoft Word files
624 to everybody, because they believe that everybody runs Windows and therefore
625 runs Word\".")
626 (license license:gpl2+)))
627
628 (define-public catdoc
629 (package
630 (name "catdoc")
631 (version "0.95")
632 (source (origin
633 (method url-fetch)
634 (uri (string-append "http://ftp.wagner.pp.ru/pub/catdoc/"
635 "catdoc-" version ".tar.gz"))
636 (patches (search-patches "catdoc-CVE-2017-11110.patch"))
637 (sha256
638 (base32
639 "15h7v3bmwfk4z8r78xs5ih6vd0pskn0rj90xghvbzdjj0cc88jji"))))
640 (build-system gnu-build-system)
641 ;; TODO: Also build `wordview` which requires `tk` – make a separate
642 ;; package for this.
643 (arguments
644 '(#:tests? #f ; There are no tests
645 #:configure-flags '("--disable-wordview")
646 #:phases
647 (modify-phases %standard-phases
648 (add-before 'install 'fix-install
649 (lambda* (#:key outputs #:allow-other-keys)
650 (let ((out (assoc-ref outputs "out")))
651 (mkdir-p (string-append out "/share/man/man1"))))))))
652 (home-page "https://www.wagner.pp.ru/~vitus/software/catdoc/")
653 (synopsis "MS-Word to TeX or plain text converter")
654 (description "@command{catdoc} extracts text from MS-Word files, trying to
655 preserve as many special printable characters as possible. It supports
656 everything up to Word-97. Also supported are MS Write documents and RTF files.
657
658 @command{catdoc} does not preserve complex word formatting, but it can
659 translate some non-ASCII characters into TeX escape codes. It's goal is to
660 extract plain text and allow you to read it and, probably, reformat with TeX,
661 according to TeXnical rules.
662
663 This package also provides @command{xls2csv}, which extracts data from Excel
664 spreadsheets and outputs it in comma-separated-value format, and
665 @command{catppt}, which extracts data from PowerPoint presentations.")
666 (license license:gpl2+)))
667
668 (define-public utfcpp
669 (package
670 (name "utfcpp")
671 (version "2.3.5")
672 (source (origin
673 (method git-fetch)
674 (uri (git-reference
675 (url "https://github.com/nemtrif/utfcpp")
676 (commit (string-append "v" version))))
677 (file-name (git-file-name name version))
678 (sha256
679 (base32
680 "1gr98d826z6wa58r1s5i7rz7q2x3r31v7zj0pjjlrc7gfxwklr4s"))))
681 (build-system cmake-build-system)
682 (arguments
683 `(#:out-of-source? #f
684 #:phases
685 (modify-phases %standard-phases
686 (replace 'install ; no install target
687 (lambda* (#:key outputs #:allow-other-keys)
688 (let* ((out (assoc-ref outputs "out"))
689 (include (string-append out "/include"))
690 (doc (string-append out "/share/doc/" ,name)))
691 (copy-recursively "source" include)
692 (install-file "README.md" doc)
693 #t))))))
694 (home-page "https://github.com/nemtrif/utfcpp")
695 (synopsis "Portable C++ library for handling UTF-8")
696 (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
697 in a portable way.")
698 (license license:boost1.0)))
699
700 (define-public dbacl
701 (package
702 (name "dbacl")
703 (version "1.14.1")
704 (source
705 (origin
706 (method url-fetch)
707 (uri (string-append "mirror://sourceforge/dbacl/dbacl/" version "/"
708 "dbacl-" version ".tar.gz"))
709 (sha256
710 (base32 "1gas0112wqjvwn9qg3hxnawk7h3prr0w9b2h68f3p1ifd1kzn3gz"))
711 (patches (search-patches "dbacl-include-locale.h.patch"))))
712 (build-system gnu-build-system)
713 (arguments
714 `(#:make-flags
715 (list
716 (string-append "-I" (assoc-ref %build-inputs "slang")
717 "/include/slang")
718 (string-append "-I" (assoc-ref %build-inputs "ncurses")
719 "/include/ncurses"))
720 #:phases
721 (modify-phases %standard-phases
722 (add-after 'unpack 'delete-sample6-and-japanese
723 (lambda _
724 (substitute* "doc/Makefile.am"
725 (("sample6.txt") "")
726 (("japanese.txt") ""))
727 (delete-file "doc/sample6.txt")
728 (delete-file "doc/japanese.txt")
729 (substitute* (list "src/tests/Makefile.am"
730 "src/tests/Makefile.in")
731 (("dbacl-jap.shin") "")
732 (("dbacl-jap.sh") ""))
733 #t))
734 (add-after 'unpack 'delete-test
735 ;; See comments about the license.
736 (lambda _
737 (delete-file "src/tests/dbacl-jap.shin")
738 #t))
739 (add-after 'unpack 'fix-test-files
740 (lambda* (#:key inputs outputs #:allow-other-keys)
741 (let* ((out (assoc-ref outputs "out"))
742 (bin (string-append out "/bin")))
743 (substitute* (find-files "src/tests/" "\\.shin$")
744 (("PATH=/bin:/usr/bin")
745 "#PATH=/bin:/usr/bin")
746 (("diff") (string-append (which "diff")))
747 (("tr") (string-append (which "tr"))))
748 #t)))
749 (replace 'bootstrap
750 (lambda _
751 (invoke "autoreconf" "-vif")
752 #t)))))
753 (inputs
754 `(("ncurses" ,ncurses)
755 ("perl" ,perl)
756 ("readline" ,readline)
757 ("slang" ,slang)))
758 (native-inputs
759 `(("libtool" ,libtool)
760 ("autoconf" ,autoconf)
761 ("automake" ,automake)
762 ("pkg-config" ,pkg-config)))
763 (home-page "https://www.lbreyer.com/dbacl.html")
764 (synopsis "Bayesian text and email classifier")
765 (description
766 "dbacl is a fast Bayesian text and email classifier. It builds a variety
767 of language models using maximum entropy (minimum divergence) principles, and
768 these can then be used to categorize input data automatically among multiple
769 categories.")
770 ;; The software is licensed as GPLv3 or later, but
771 ;; includes various sample texts in the doc dir:
772 ;; - sample1.txt, sample3 and sampe5.txt are in the public domain,
773 ;; by Mark Twain.
774 ;; - sample2.txt, sample4.txt are in the public domain, by Aristotle.
775 ;; - sample6.txt is a forwarded email, copyright unknown.
776 ;; Guix does exclude sample6.txt.
777 ;; - japanese.txt is a Japanese unoffical translation of the
778 ;; GNU General Public License, (c) by the Free Software Foundation.
779 ;; Guix excludes this file.
780 (license (list license:gpl3+ license:public-domain))))
781
782 (define-public dotconf
783 (package
784 (name "dotconf")
785 (version "1.3")
786 (source (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/williamh/dotconf")
790 (commit (string-append "v" version))))
791 (file-name (git-file-name name version))
792 (sha256
793 (base32
794 "1sc95hw5k2xagpafny0v35filmcn05k1ds5ghkldfpf6xw4hakp7"))))
795 (build-system gnu-build-system)
796 (arguments `(#:tests? #f)) ; FIXME maketest.sh does not work.
797 (native-inputs
798 `(("autoconf" ,autoconf)
799 ("automake" ,automake)
800 ("libtool" ,libtool)))
801 (home-page "https://github.com/williamh/dotconf")
802 (synopsis "Configuration file parser library")
803 (description
804 "C library for creating and parsing configuration files.")
805 (license (list license:lgpl2.1 ; Main distribution.
806 license:asl1.1)))) ; src/readdir.{c,h}
807
808 (define-public drm-tools
809 (package
810 (name "drm-tools")
811 (version "1.1.33")
812 (source (origin
813 (method url-fetch)
814 (uri (string-append "mirror://sourceforge/drmtools/drm_tools-"
815 version ".tar.gz"))
816 (sha256
817 (base32
818 "187zbxw21zcg8gpyc13gxlycfw0n05a6rmqq6im5wr9zk1v1wj80"))))
819 (build-system cmake-build-system)
820 (arguments
821 `(#:tests? #f ;the test suite fails
822 #:phases (modify-phases %standard-phases
823 (add-after 'unpack 'set-install-prefixes
824 (lambda* (#:key outputs #:allow-other-keys)
825 (let* ((out (assoc-ref outputs "out")))
826 (substitute* "CMakeLists.txt"
827 (("tmp/testinstall")
828 (string-drop out 1))
829 (("/man/man1")
830 "/share/man/man1"))
831 #t)))
832 (add-after 'unpack 'adjust-test-paths
833 (lambda _
834 (substitute* '("test_extract_increment.sh"
835 "test_extract_features.sh"
836 "test_extract_features2.sh"
837 "test_dmath.sh")
838 (("\\./extract") "extract")
839 (("\\./dmath") "dmath")
840 (("/usr/local/bin/") "")
841 (("/bin/rm") "rm")
842 (("/bin/cp") "cp"))
843 #t))
844 (delete 'check)
845 ;; The produced binaries are written directly to %output/bin.
846 (delete 'install)
847 (add-after 'build 'check
848 (lambda* (#:key outputs tests? #:allow-other-keys)
849 (when tests?
850 (let* ((out (assoc-ref outputs "out"))
851 (bin (string-append out "/bin")))
852 (setenv "PATH" (string-append bin ":"
853 (getenv "PATH")))
854 (with-directory-excursion
855 (format #f "../drm_tools-~a" ,version)
856 (invoke "sh" "test_all.sh")))))))))
857 (native-inputs `(("which" ,which))) ;for tests
858 (inputs `(("pcre" ,pcre)))
859 (home-page "http://drmtools.sourceforge.net/")
860 (synopsis "Utilities to manipulate text and binary files")
861 (description "The drm_tools package contains the following commands:
862 @table @command
863 @item accudate
864 An extended version of the \"date\" program that has sub-second accuracy.
865 @item binformat
866 Format complex binary data into text.
867 @item binload
868 Load data into a binary file using simple commands from the input.
869 @item binorder
870 Sort, merge, search, retrieve or generate test data consisting of fixed size
871 binary records.
872 @item binreplace
873 Find or find/replace in binary files.
874 @item binsplit
875 Split test data consisting of fixed size binary records into one or more
876 output streams.
877 @item chardiff
878 Find changes between two files at the character level. Unlike \"diff\", it
879 lists just the characters that differ, so if the 40,000th character is
880 different only that one character will be shown, not the entire line.
881 @item columnadd
882 Add columns of integers, decimals, and/or times.
883 @item datasniffer
884 A utility for formatting binary data dumps.
885 @item dmath
886 Double precision interactive command line math calculator.
887 @item extract
888 Extract and emit data from text files based on character or token position.
889 @item execinput
890 A utility that reads from STDIN and executes each line as a command in a
891 sub-process.
892 @item indexed_text
893 A utility for rapid retrieval of text by line numbers, in any order, from a
894 text file.
895 @item mdump
896 Format binary data.
897 @item msgqueue
898 Create message queues and send/receive messages.
899 @item mbin
900 @itemx mbout
901 Multiple buffer in and out. Used for buffering a lot of data between a slow
902 device and a fast device. Mostly for buffering streaming tape drives for use
903 with slower network connections, so that streaming is maintained as much as
904 possible to minimize wear on the tape device.
905 @item pockmark
906 Corrupt data streams - useful for testing error correction and data recovery.
907 @item tarsieve
908 Filter, list, or split a tar file.
909 @end table")
910 (license license:gpl2+)))
911
912 (define-public java-rsyntaxtextarea
913 (package
914 (name "java-rsyntaxtextarea")
915 (version "2.6.1")
916 (source (origin
917 (method git-fetch)
918 (uri (git-reference
919 (url "https://github.com/bobbylight/RSyntaxTextArea")
920 (commit version)))
921 (file-name (git-file-name name version))
922 (sha256
923 (base32
924 "0dyflzvxq2wvs0rgqfyi5yzzrb6r4bzw2dm8cl304dakxk38ddys"))))
925 (build-system ant-build-system)
926 (arguments
927 `(;; FIXME: some tests fail because locale resources cannot be found.
928 ;; Even when I add them to the class path,
929 ;; RSyntaxTextAreaEditorKitDumbCompleteWordActionTest fails.
930 #:tests? #f
931 #:jar-name "rsyntaxtextarea.jar"))
932 (native-inputs
933 `(("java-junit" ,java-junit)
934 ("java-hamcrest-core" ,java-hamcrest-core)))
935 (home-page "https://bobbylight.github.io/RSyntaxTextArea/")
936 (synopsis "Syntax highlighting text component for Java Swing")
937 (description "RSyntaxTextArea is a syntax highlighting, code folding text
938 component for Java Swing. It extends @code{JTextComponent} so it integrates
939 completely with the standard @code{javax.swing.text} package. It is fast and
940 efficient, and can be used in any application that needs to edit or view
941 source code.")
942 (license license:bsd-3)))
943
944 ;; We use the sources from git instead of the tarball from pypi, because the
945 ;; latter does not include the Cython source file from which bycython.cpp is
946 ;; generated.
947 (define-public python-editdistance
948 (let ((commit "3ea84a7dd3258c76aa3be851ef3d50e59c886846")
949 (revision "1"))
950 (package
951 (name "python-editdistance")
952 (version (string-append "0.3.1-" revision "." (string-take commit 7)))
953 (source
954 (origin
955 (method git-fetch)
956 (uri (git-reference
957 (url "https://github.com/aflc/editdistance")
958 (commit commit)))
959 (file-name (git-file-name name version))
960 (sha256
961 (base32
962 "1l43svsv12crvzphrgi6x435z6xg8m086c64armp8wzb4l8ccm7g"))))
963 (build-system python-build-system)
964 (arguments
965 `(#:phases
966 (modify-phases %standard-phases
967 (add-after 'unpack 'build-cython-code
968 (lambda _
969 (with-directory-excursion "editdistance"
970 (delete-file "bycython.cpp")
971 (invoke "cython" "--cplus" "bycython.pyx")))))))
972 (native-inputs
973 `(("python-cython" ,python-cython)))
974 (home-page "https://www.github.com/aflc/editdistance")
975 (synopsis "Fast implementation of the edit distance (Levenshtein distance)")
976 (description
977 "This library simply implements Levenshtein distance algorithm with C++
978 and Cython.")
979 (license license:expat))))
980
981 (define-public go-github.com-mattn-go-runewidth
982 (let ((commit "703b5e6b11ae25aeb2af9ebb5d5fdf8fa2575211")
983 (version "0.0.4")
984 (revision "1"))
985 (package
986 (name "go-github.com-mattn-go-runewidth")
987 (version (git-version version revision commit))
988 (source
989 (origin
990 (method git-fetch)
991 (uri (git-reference
992 (url "https://github.com/mattn/runewidth")
993 (commit commit)))
994 (file-name (git-file-name name version))
995 (sha256
996 (base32
997 "0znpyz71gajx3g0j2zp63nhjj2c07g16885vxv4ykwnrfmzbgk4w"))))
998 (build-system go-build-system)
999 (arguments
1000 '(#:import-path "github.com/mattn/go-runewidth"))
1001 (synopsis "@code{runewidth} provides Go functions to work with string widths")
1002 (description
1003 "The @code{runewidth} library provides Go functions for padding,
1004 measuring and checking the width of strings, with support for East Asian
1005 text.")
1006 (home-page "https://github.com/mattn/runewidth")
1007 (license license:expat))))
1008
1009 (define-public docx2txt
1010 (package
1011 (name "docx2txt")
1012 (version "1.4")
1013 (source (origin
1014 (method url-fetch)
1015 (uri (string-append
1016 "mirror://sourceforge/docx2txt/docx2txt/v"
1017 version "/docx2txt-" version ".tgz"))
1018 (sha256
1019 (base32
1020 "06vdikjvpj6qdb41d8wzfnyj44jpnknmlgbhbr1w215420lpb5xj"))))
1021 (build-system gnu-build-system)
1022 (inputs
1023 `(("unzip" ,unzip)
1024 ("perl" ,perl)))
1025 (arguments
1026 `(#:tests? #f ; No tests.
1027 #:make-flags (list (string-append "BINDIR="
1028 (assoc-ref %outputs "out") "/bin")
1029 (string-append "CONFIGDIR="
1030 (assoc-ref %outputs "out") "/etc")
1031 ;; Makefile seems to be a bit dumb at guessing.
1032 (string-append "INSTALL=install")
1033 (string-append "PERL=perl"))
1034 #:phases
1035 (modify-phases %standard-phases
1036 (delete 'configure)
1037 (add-after 'install 'fix-install
1038 (lambda* (#:key outputs inputs #:allow-other-keys)
1039 (let* ((out (assoc-ref outputs "out"))
1040 (bin (string-append out "/bin"))
1041 (config (string-append out "/etc/docx2txt.config"))
1042 (unzip (assoc-ref inputs "unzip")))
1043 ;; According to INSTALL, the .sh wrapper can be skipped.
1044 (delete-file (string-append bin "/docx2txt.sh"))
1045 (rename-file (string-append bin "/docx2txt.pl")
1046 (string-append bin "/docx2txt"))
1047 (substitute* config
1048 (("config_unzip => '/usr/bin/unzip',")
1049 (string-append "config_unzip => '"
1050 unzip
1051 "/bin/unzip',")))
1052 ;; Makefile is wrong.
1053 (chmod config #o644)
1054 #t))))))
1055 (synopsis "Recover text from @file{.docx} files, with good formatting")
1056 (description
1057 "@command{docx2txt} is a Perl based command line utility to convert
1058 Microsoft Office @file{.docx} documents to equivalent text documents. Latest
1059 version supports following features during text extraction.
1060
1061 @itemize
1062 @item Character conversions; currency characters are converted to respective
1063 names like Euro.
1064 @item Capitalisation of text blocks.
1065 @item Center and right justification of text fitting in a line of
1066 (configurable) 80 columns.
1067 @item Horizontal ruler, line breaks, paragraphs separation, tabs.
1068 @item Indicating hyperlinked text along with the hyperlink (configurable).
1069 @item Handling (bullet, decimal, letter, roman) lists along with (attempt at)
1070 indentation.
1071 @end itemize\n")
1072 (home-page "http://docx2txt.sourceforge.net")
1073 (license license:gpl3+)))
1074
1075 (define-public html2text
1076 ;; Use commit directly to get the fixes to the installation phase
1077 ;; that are not in a release yet.
1078 (let ((commit "05364c1028026a87d6f45130a8e86e1ee67704d2")
1079 (revision "1"))
1080 (package
1081 (name "html2text")
1082 (version (git-version "2.0.1_pre" revision commit))
1083 (source
1084 (origin
1085 (method git-fetch)
1086 (uri (git-reference
1087 (url "https://github.com/grobian/html2text")
1088 (commit (string-append commit))))
1089 (file-name (git-file-name name version))
1090 (sha256
1091 (base32 "0n6pl0nijcn4z3p0dvf3gmvvpjq261pagnk84s9f78c4c55bw5cm"))))
1092 (build-system gnu-build-system)
1093 (arguments
1094 `(#:make-flags
1095 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1096 #:phases
1097 (modify-phases %standard-phases
1098 (replace 'configure
1099 ;; The configure script is not from autotools and does not accept
1100 ;; ‘--style’ options. There is no proper error handling.
1101 (lambda* (#:key outputs #:allow-other-keys)
1102 (invoke "./configure"
1103 (string-append "CXX=" ,(cxx-for-target))))))))
1104 (home-page "https://github.com/grobian/html2text")
1105 (synopsis "HTML to plain text converter")
1106 (description
1107 "@code{html2text} is a command line utility that converts HTML
1108 documents into plain text.")
1109 (license (list license:bsd-4 ; cmp_nocase.cpp & sgml.h
1110 license:gpl2+))))) ; everything else
1111
1112 (define-public odt2txt
1113 (package
1114 (name "odt2txt")
1115 (version "0.5")
1116 (source
1117 (origin
1118 (method git-fetch)
1119 (uri (git-reference
1120 (url "https://github.com/dstosberg/odt2txt/")
1121 (commit (string-append "v" version))))
1122 (file-name (git-file-name name version))
1123 (sha256
1124 (base32
1125 "0im3kzvhxkjlx57w6h13mc9584c74ma1dyymgvpq2y61av3gc35v"))))
1126 (build-system gnu-build-system)
1127 (arguments
1128 `(#:tests? #f ; no make check
1129 #:make-flags (list "CC=gcc"
1130 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
1131 #:phases
1132 (modify-phases %standard-phases
1133 ;; no configure script
1134 (delete 'configure))))
1135 (inputs
1136 `(("zlib" ,zlib)))
1137 (home-page "https://github.com/dstosberg/odt2txt/")
1138 (synopsis "Converter from OpenDocument Text to plain text")
1139 (description "odt2txt is a command-line tool which extracts the text out
1140 of OpenDocument Texts, as produced by OpenOffice.org, KOffice, StarOffice and
1141 others.
1142
1143 odt2txt can also extract text from some file formats similar to OpenDocument
1144 Text, such as OpenOffice.org XML (*.sxw), which was used by OpenOffice.org
1145 version 1.x and older StarOffice versions. To a lesser extent, odt2txt may be
1146 useful to extract content from OpenDocument spreadsheets (*.ods) and
1147 OpenDocument presentations (*.odp).")
1148 (license license:gpl2)))
1149
1150 (define-public opencc
1151 (package
1152 (name "opencc")
1153 (version "1.1.1")
1154 (source
1155 (origin
1156 (method git-fetch)
1157 (uri (git-reference
1158 (url "https://github.com/BYVoid/OpenCC")
1159 (commit (string-append "ver." version))))
1160 (file-name (git-file-name name version))
1161 (sha256
1162 (base32
1163 "07y0pvxjlmpcnym229j87qcfwnfm7vi10dad0a20xy6as55a9j3d"))
1164 (modules '((guix build utils)))
1165 (snippet
1166 '(begin
1167 ;; TODO: Unbundle tclap, darts-clone, gtest
1168 (delete-file-recursively "deps/rapidjson-1.1.0") #t))))
1169 (build-system cmake-build-system)
1170 (arguments
1171 ;; Required to locate the install script properly.
1172 `(#:out-of-source? #f
1173 #:parallel-build? #f ;occasionally failed.
1174 #:imported-modules
1175 (,@%cmake-build-system-modules
1176 (guix build python-build-system))
1177 #:modules ((guix build cmake-build-system)
1178 ((guix build python-build-system) #:prefix python:)
1179 (guix build utils))
1180 #:phases
1181 (modify-phases %standard-phases
1182 (add-after 'unpack 'prevent-rebuild-during-installation
1183 (lambda _
1184 (substitute* "python/setup.py"
1185 (("'build_py': BuildPyCommand,") ""))
1186 #t))
1187 (add-after 'unpack 'patch-3rd-party-references
1188 (lambda* (#:key inputs #:allow-other-keys)
1189 (let ((rapidjson (assoc-ref inputs "rapidjson")))
1190 (substitute* "src/CMakeLists.txt"
1191 (("../deps/rapidjson-1.1.0")
1192 (string-append rapidjson "/include/rapidjson")))
1193 #t)))
1194 (add-before 'configure 'patch-python-binding-installation
1195 (lambda* (#:key outputs inputs #:allow-other-keys)
1196 (let ((out (assoc-ref outputs "out")))
1197 (substitute* "python/opencc/__init__.py"
1198 (("(_libopenccfile =).*$" _ prefix)
1199 (format #f "~a os.path.join('~a/lib', _libopenccfilename)~%"
1200 prefix out))
1201 (("(_opencc_share_dir =).*$" _ prefix)
1202 (format #f "~a '~a/share/opencc'~%" prefix out))))
1203 #t))
1204 (add-after 'install 'install-python-binding
1205 (lambda* (#:key outputs inputs #:allow-other-keys)
1206 (let* ((out (assoc-ref outputs "out"))
1207 (dist (string-append
1208 out "/lib/python"
1209 ,(version-major+minor (package-version python))
1210 "/site-packages")))
1211 (chdir "python")
1212 (mkdir-p dist)
1213 (setenv "PYTHONPATH"
1214 (string-append dist ":" (getenv "GUIX_PYTHONPATH")))
1215 (invoke "python" "setup.py" "install"
1216 "--root=/" "--single-version-externally-managed"
1217 (string-append "--prefix=" out))
1218 #t)))
1219 (add-before 'install-python-binding 'enable-bytecode-determinism
1220 (assoc-ref python:%standard-phases 'enable-bytecode-determinism)))))
1221 (native-inputs
1222 `(("python" ,python-wrapper)
1223 ("rapidjson" ,rapidjson)
1224 ("python-setuptools" ,python-setuptools)
1225 ("python-wheel" ,python-wheel)))
1226 (home-page "https://github.com/BYVoid/OpenCC")
1227 (synopsis "Convert between Traditional Chinese and Simplified Chinese")
1228 (description "Open Chinese Convert (OpenCC) converts between Traditional
1229 Chinese and Simplified Chinese, supporting character-level conversion,
1230 phrase-level conversion, variant conversion, and regional idioms among
1231 Mainland China, Taiwan, and Hong-Kong.")
1232 (license license:asl2.0)))
1233
1234 (define-public nkf
1235 (let ((commit "08043eadf4abdddcf277842217e3c77a24740dc2")
1236 (revision "1"))
1237 (package
1238 (name "nkf")
1239 ;; The commits corresponding to specific versions are published
1240 ;; here:
1241 ;; https://ja.osdn.net/projects/nkf/scm/git/nkf/
1242 (version "2.1.5")
1243 (source (origin
1244 (method git-fetch)
1245 (uri (git-reference
1246 (url "https://github.com/nurse/nkf")
1247 (commit commit)))
1248 (file-name (git-file-name name version))
1249 (sha256
1250 (base32
1251 "0anw0knr1iy4p9w3d3b3pbwzh1c43p1i2q4c28kw9zviw8kx2rly"))))
1252 (build-system gnu-build-system)
1253 (arguments
1254 `(#:tests? #f ; test for perl module
1255 #:make-flags (list "CC=gcc" "CFLAGS=-O2 -Wall -pedantic"
1256 (string-append "prefix=" %output)
1257 "MKDIR=mkdir -p")
1258 #:phases
1259 (modify-phases %standard-phases
1260 (delete 'configure)))) ; No ./configure script
1261 (home-page "https://ja.osdn.net/projects/nkf/")
1262 (synopsis "Network Kanji Filter")
1263 (description "Nkf is yet another kanji code converter among networks,
1264 hosts and terminals. It converts input kanji code to designated kanji code
1265 such as ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8, UTF-16 or UTF-32.")
1266 (license license:zlib))))
1267
1268 (define-public python-pandocfilters
1269 (package
1270 (name "python-pandocfilters")
1271 (version "1.4.3")
1272 (source
1273 (origin
1274 (method url-fetch)
1275 (uri (pypi-uri "pandocfilters" version))
1276 (sha256
1277 (base32 "1sq675dg4barb5949xxz4d5gk2ly524hi1p1xgwb3d1l0nsznqxw"))))
1278 (build-system python-build-system)
1279 (home-page "https://github.com/jgm/pandocfilters")
1280 (synopsis "Python module for writing Pandoc filters")
1281 (description "Pandoc is a powerful utility to transform various
1282 input formats into a wide range of output formats. To alter the
1283 exported output document, Pandoc allows the usage of filters, which
1284 are pipes that read a JSON serialization of the Pandoc AST from stdin,
1285 transform it in some way, and write it to stdout. It allows therefore
1286 to alter the processing of Pandoc's supported input formats, for
1287 instance one can add new syntax elements to markdown, etc.
1288
1289 This package provides Python bindings.")
1290 (license license:bsd-3)))
1291
1292 (define-public aha
1293 (package
1294 (name "aha")
1295 (version "0.5.1")
1296 (source
1297 (origin
1298 (method git-fetch)
1299 (uri (git-reference
1300 (url "https://github.com/theZiz/aha")
1301 (commit version)))
1302 (sha256
1303 (base32 "1gywad0rvvz3c5balz8cxsnx0562hj2ngzqyr8zsy2mb4pn0lpgv"))
1304 (file-name (git-file-name name version))))
1305 (build-system gnu-build-system)
1306 (arguments
1307 `(#:phases
1308 (modify-phases %standard-phases
1309 (delete 'configure))
1310 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1311 (string-append "PREFIX="
1312 (assoc-ref %outputs "out")))
1313 #:tests? #f)) ; no test suite
1314 (home-page "https://github.com/theZiz/aha")
1315 (synopsis "Converts terminal escape sequences to HTML")
1316 (description "@command{aha} (Ansi Html Adapter) converts ANSI escape sequences
1317 of a Unix terminal to HTML code.")
1318 (license (list license:lgpl2.0+ license:mpl1.1))))
1319
1320 (define-public go-github-com-errata-ai-vale
1321 (package
1322 (name "go-github-com-errata-ai-vale")
1323 (version "2.4.0")
1324 (source
1325 (origin
1326 (method git-fetch)
1327 (uri (git-reference
1328 (url "https://github.com/errata-ai/vale")
1329 (commit (string-append "v" version))))
1330 (sha256
1331 (base32 "0d07fwha2220m8j24h527xl0gnl3svvyaywflgk5292d6g49ach2"))
1332 (file-name (git-file-name name version))))
1333 (build-system go-build-system)
1334 (native-inputs
1335 `(("github.com/sp13/afero" ,go-github-com-spf13-afero)
1336 ("github.com/urfave/cli" ,go-github-com-urfave-cli)
1337 ("github.com/olekukonko/tablewriter" ,go-github-com-olekukonko-tablewriter)
1338 ("github.com/mitchellh/mapstructure" ,go-github-com-mitchellh-mapstructure)))
1339 (arguments
1340 `(#:import-path "github.com/errata-ai/vale"
1341 #:install-source? #f))
1342 (home-page "https://github.com/errata-ai/vale")
1343 (synopsis "Fully customizable syntax-aware linter that focuses on your style")
1344 (description
1345 "Vale is a fully extensible linter that focuses on your own writing style
1346 by making use of rules in individual YAML files. It is syntax-aware on markup
1347 languages such as HTML, Markdown, Asciidoc, and reStructuredText. The community
1348 around it also has a list of style guides implemented with Vale in
1349 @url{https://github.com/errata-ai/styles, their styles repo}.")
1350 (license license:expat)))