gnu: a2ps: Use 'modify-phases'.
[jackhill/guix/guix.git] / gnu / packages / textutils.scm
CommitLineData
7939e70a
TUBK
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
c8d969b5 3;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
a64a8c46 4;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
e522d840 5;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
2d8cf0b3 6;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
f17a5447 7;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
7939e70a
TUBK
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages textutils)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system gnu)
c8d969b5 30 #:use-module (guix build-system cmake)
f17a5447 31 #:use-module (guix build-system trivial)
f571e1c3 32 #:use-module (gnu packages autotools)
f17a5447
AG
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages zip))
7939e70a
TUBK
35
36(define-public recode
37 (package
38 (name "recode")
39 ;; Last beta release (3.7-beta2) is from 2008; last commit from Feb 2014.
40 ;; So we use that commit instead.
41 (version "3.7.0.201402")
42 (source
43 (origin
44 (method git-fetch)
45 (uri (git-reference
46 (url "https://github.com/pinard/Recode.git")
47 (commit "2d7092a9999194fc0e9449717a8048c8d8e26c18")))
48 (sha256
6f323b07
TUBK
49 (base32 "1wssv8z6g3ryrw33sksz4rjhlnhgvvdqszw1ggl4rcwks34n86zm"))
50 (file-name (string-append name "-" version "-checkout"))))
7939e70a
TUBK
51 (build-system gnu-build-system)
52 (native-inputs `(("python" ,python-2)))
53 (arguments
54 '(#:phases
55 (alist-cons-before
fee4693e 56 'check 'pre-check
7939e70a
TUBK
57 (lambda _
58 (substitute* "tests/setup.py"
59 (("([[:space:]]*)include_dirs=.*" all space)
fee4693e
SB
60 (string-append all space "library_dirs=['../src/.libs'],\n")))
61 ;; The test extension 'Recode.so' lacks RUNPATH for 'librecode.so'.
62 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/src/.libs")))
7939e70a
TUBK
63 %standard-phases)))
64 (home-page "https://github.com/pinard/Recode")
65 (synopsis "Text encoding converter")
66 (description "The Recode library converts files between character sets and
67usages. It recognises or produces over 200 different character sets (or about
68300 if combined with an iconv library) and transliterates files between almost
69any pair. When exact transliteration are not possible, it gets rid of
70offending characters or falls back on approximations. The recode program is a
71handy front-end to the library.")
72 (license license:gpl2+)))
688fe865
TUBK
73
74(define-public enca
75 (package
76 (name "enca")
77 (version "1.16")
78 (source
79 (origin
80 (method url-fetch)
81 (uri (string-append
82 "https://github.com/nijel/enca/archive/" version ".tar.gz"))
83 (sha256
bbee7bd7
TUBK
84 (base32 "1xik00x0yvhswsw2isnclabhv536xk1s42cf5z54gfbpbhc7ni8l"))
85 (file-name (string-append name "-" version ".tar.gz"))))
688fe865
TUBK
86 (build-system gnu-build-system)
87 (inputs `(("recode" ,recode)))
6795b8d8
LC
88
89 ;; Both 'test-convert-64.sh' and 'test-convert-filter.sh' manipulate a
90 ;; 'test.tmp' file, so they have to run in sequence.
91 (arguments '(#:parallel-tests? #f))
92
688fe865
TUBK
93 (home-page "https://github.com/nijel/enca")
94 (synopsis "Text encoding detection tool")
95 (description "Enca (Extremely Naive Charset Analyser) consists of libenca,
96an encoding detection library, and enca, a command line frontend, integrating
97libenca and several charset conversion libraries and tools.")
98 (license license:gpl2)))
cd15ad82
RW
99
100(define-public utf8proc
101 (package
102 (name "utf8proc")
f1e3a8ae 103 (version "1.3.1")
cd15ad82
RW
104 (source
105 (origin
106 (method url-fetch)
107 (uri (string-append
108 "https://github.com/JuliaLang/utf8proc/archive/v"
109 version ".tar.gz"))
110 (file-name (string-append name "-" version ".tar.gz"))
111 (sha256
f1e3a8ae 112 (base32 "1k48as5kjkar4yj3dwxyll8ykj4k723ib5a6mnw1g86q3zi0zdl3"))))
cd15ad82
RW
113 (build-system gnu-build-system)
114 (arguments
115 '(#:tests? #f ;no "check" target
f1e3a8ae
RW
116 #:make-flags (list "CC=gcc"
117 (string-append "prefix=" (assoc-ref %outputs "out")))
cd15ad82 118 #:phases
f1e3a8ae
RW
119 (modify-phases %standard-phases
120 (delete 'configure))))
cd15ad82
RW
121 (home-page "http://julialang.org/utf8proc/")
122 (synopsis "C library for processing UTF-8 Unicode data")
123 (description "utf8proc is a small C library that provides Unicode
124normalization, case-folding, and other operations for data in the UTF-8
125encoding, supporting Unicode version 7.0.")
126 (license license:expat)))
f571e1c3
RW
127
128(define-public libgtextutils
129 (package
130 (name "libgtextutils")
131 (version "0.7")
132 (source
133 (origin
134 (method url-fetch)
135 (uri (string-append
136 "https://github.com/agordon/libgtextutils/releases/download/"
137 version "/libgtextutils-" version ".tar.gz"))
138 (sha256
139 (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
140 (build-system gnu-build-system)
141 (arguments
142 '(#:phases
143 (alist-cons-after
144 'unpack 'autoreconf
145 (lambda _ (zero? (system* "autoreconf" "-vif")))
146 %standard-phases)))
147 (native-inputs
148 `(("autoconf" ,autoconf)
149 ("automake" ,automake)
150 ("libtool" ,libtool)))
151 (home-page "https://github.com/agordon/libgtextutils")
152 (synopsis "Gordon's text utils library")
153 (description
154 "libgtextutils is a text utilities library used by the fastx toolkit from
155the Hannon Lab.")
156 (license license:agpl3+)))
aae2b445
BW
157
158(define-public cityhash
a64a8c46 159 (let ((commit "8af9b8c"))
aae2b445
BW
160 (package
161 (name "cityhash")
a64a8c46 162 (version (string-append "1.1-2." commit))
aae2b445
BW
163 (source (origin
164 (method git-fetch)
165 (uri (git-reference
166 (url "https://github.com/google/cityhash.git")
167 (commit commit)))
168 (file-name (string-append name "-" version ".tar.gz"))
169 (sha256
170 (base32
171 "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
a64a8c46
BW
172 (build-system gnu-build-system)
173 (arguments
174 '(#:make-flags (list "CXXFLAGS=-g -O3")
175 #:phases
176 (modify-phases %standard-phases
177 ;; citycrc is not installed by default but is used by some
178 ;; programs.
179 (add-after 'install 'install-citycrc
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let* ((out (assoc-ref outputs "out"))
182 (include (string-append out "/include")))
183 (install-file "src/citycrc.h" include))
184 #t)))))
185 (home-page "https://github.com/google/cityhash")
186 (synopsis "C++ hash functions for strings")
187 (description
188 "CityHash provides hash functions for strings. The functions mix the
aae2b445 189input bits thoroughly but are not suitable for cryptography.")
a64a8c46 190 (license license:expat))))
e522d840 191
9128db21
RW
192(define-public ustr
193 (package
194 (name "ustr")
195 (version "1.0.4")
196 (source (origin
197 (method url-fetch)
198 (uri (string-append "http://www.and.org/ustr/" version
199 "/ustr-" version ".tar.bz2"))
200 (sha256
201 (base32
202 "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))))
203 (build-system gnu-build-system)
204 (arguments
205 `(#:make-flags
206 (list "CC=gcc"
207 "HIDE="
208 ;; Override "/sbin/ldconfig" with "echo" because we don't need
209 ;; "ldconfig".
210 "LDCONFIG=echo"
211 (string-append "prefix=" (assoc-ref %outputs "out"))
212 "all-shared")
213 #:phases
214 (modify-phases %standard-phases
215 (add-after 'unpack 'disable-check-for-stdint
216 (lambda _
217 ;; Of course we have stdint.h, just not in /usr/include
218 (substitute* '("Makefile"
219 "ustr-import.in")
220 (("-f \"/usr/include/stdint.h\"") "-z \"\""))
221 #t))
222 ;; No configure script
223 (delete 'configure))))
224 (home-page "http://www.and.org/ustr/")
225 (synopsis "String library with very low memory overhead")
226 (description
227 "Ustr is a string library for C with very low memory overhead.")
228 ;; Quoted from the home page: "The License for the code is MIT, new-BSD,
229 ;; LGPL, etc. ... if you need another license to help compatibility, just
230 ;; ask for it. It's basically public domain, without all the legal
231 ;; problems for everyone that trying to make something public domain
232 ;; entails."
233 (license license:public-domain)))
234
e522d840
RJ
235(define-public libconfig
236 (package
237 (name "libconfig")
238 (version "1.5")
239 (source (origin
240 (method url-fetch)
241 (uri (string-append "http://www.hyperrealm.com/libconfig/"
242 "libconfig-" version ".tar.gz"))
243 (sha256
244 (base32
245 "1xh3hzk63v4y8815lc5209m3s6ms2cpgw4h5hg462i4f1lwsl7g3"))))
246 (build-system gnu-build-system)
247 (home-page "http://www.hyperrealm.com/libconfig/")
248 (synopsis "C/C++ configuration file library")
249 (description
250 "Libconfig is a simple library for manipulating structured configuration
251files. This file format is more compact and more readable than XML. And
252unlike XML, it is type-aware, so it is not necessary to do string parsing in
253application code.")
254 (license license:lgpl2.1+)))
c8d969b5
PP
255
256(define-public pfff
257 (package
258 (name "pfff")
259 (version "1.0")
260 (source (origin
261 (method url-fetch)
262 (uri (string-append "https://github.com/pfff/pfff/archive/v"
263 version ".tar.gz"))
264 (file-name (string-append name "-" version ".tar.gz"))
265 (sha256
266 (base32
267 "00m553aa277iarxj6dalmklyb64r7ias49bfwzbacsfg8h3kar8m"))))
268 (build-system cmake-build-system)
269 (home-page "http://biit.cs.ut.ee/pfff/")
270 (synopsis "Probabilistic fast file fingerprinting tool")
271 (description
272 "pfff is a tool for calculating a compact digital fingerprint of a file
273by sampling randomly from the file instead of reading it in full.
274Consequently, the computation has a flat performance characteristic,
275correlated with data variation rather than file size. pfff can be as reliable
276as existing hashing techniques, with provably negligible risk of collisions.")
277 (license license:bsd-3)))
2d8cf0b3
JL
278
279(define-public oniguruma
280 (package
281 (name "oniguruma")
282 (version "5.9.6")
283 (source (origin
284 (method url-fetch)
285 (uri (string-append "https://github.com/kkos/"
286 "oniguruma/releases/download/v" version
287 "/onig-" version ".tar.gz"))
288 (sha256
289 (base32
290 "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m"))))
291 (build-system gnu-build-system)
292 (home-page "https://github.com/kkos/oniguruma")
293 (synopsis "Regular expression library")
294 (description "Oniguruma is a regular expressions library. The special
295characteristic of this library is that different character encoding for every
296regular expression object can be specified.")
297 (license license:bsd-2)))
1b90e57e
RW
298
299(define-public antiword
300 (package
301 (name "antiword")
302 (version "0.37")
303 (source (origin
304 (method url-fetch)
305 (uri (string-append "http://www.winfield.demon.nl/linux"
306 "/antiword-" version ".tar.gz"))
307 (sha256
308 (base32
309 "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))))
310 (build-system gnu-build-system)
311 (arguments
312 `(#:tests? #f ; There are no tests
313 #:make-flags
314 (list "-f" "Makefile.Linux"
315 (string-append "GLOBAL_INSTALL_DIR="
316 (assoc-ref %outputs "out") "/bin")
317 (string-append "GLOBAL_RESOURCES_DIR="
318 (assoc-ref %outputs "out") "/share/antiword"))
319 #:phases
320 (modify-phases %standard-phases
321 (delete 'configure)
322 (replace 'install
323 (lambda* (#:key make-flags #:allow-other-keys)
324 (zero? (apply system* "make" `("global_install" ,@make-flags))))))))
325 (home-page "http://www.winfield.demon.nl/")
326 (synopsis "Microsoft Word document reader")
327 (description "Antiword is an application for displaying Microsoft Word
328documents. It can also convert the document to PostScript or XML. Only
329documents made by MS Word version 2 and version 6 or later are supported. The
330name comes from: \"The antidote against people who send Microsoft Word files
331to everybody, because they believe that everybody runs Windows and therefore
332runs Word\".")
333 (license license:gpl2+)))
f17a5447
AG
334
335(define-public utfcpp
336 (package
337 (name "utfcpp")
338 (version "2.3.4")
339 (source (origin
340 (method url-fetch)
341 (uri
342 (string-append
343 "mirror://sourceforge/project/utfcpp/utf8cpp_2x/Release%20"
344 version "/utf8_v"
345 (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
346 ".zip"))
347 (file-name (string-append name "-" version ".zip"))
348 (sha256
349 (base32
350 "1vqhs0aipcvvdrwcs7h3jsryg6mgbmc4s34n5cm6d36q4nxwwwrk"))))
351 (build-system trivial-build-system)
352 (arguments
353 `(#:modules ((guix build utils))
354 #:builder
355 (begin
356 (use-modules (guix build utils))
357 (let ((source (assoc-ref %build-inputs "source"))
358 (out (assoc-ref %outputs "out"))
359 (unzip (string-append (assoc-ref %build-inputs "unzip")
360 "/bin/unzip")))
361 (mkdir-p out)
362 (with-directory-excursion out
363 (system* unzip source)
364 (mkdir-p "share/doc")
365 (rename-file "doc" "share/doc/utfcpp")
366 (rename-file "source" "include"))))))
367 (native-inputs `(("unzip" ,unzip)))
368 (home-page "https://github.com/nemtrif/utfcpp")
369 (synopsis "Portable C++ library for handling UTF-8")
370 (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
371in a portable way.")
372 (license license:boost1.0)))