gnu: Add Pfff.
[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 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
5 ;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages textutils)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system cmake)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages python))
31
32 (define-public recode
33 (package
34 (name "recode")
35 ;; Last beta release (3.7-beta2) is from 2008; last commit from Feb 2014.
36 ;; So we use that commit instead.
37 (version "3.7.0.201402")
38 (source
39 (origin
40 (method git-fetch)
41 (uri (git-reference
42 (url "https://github.com/pinard/Recode.git")
43 (commit "2d7092a9999194fc0e9449717a8048c8d8e26c18")))
44 (sha256
45 (base32 "1wssv8z6g3ryrw33sksz4rjhlnhgvvdqszw1ggl4rcwks34n86zm"))
46 (file-name (string-append name "-" version "-checkout"))))
47 (build-system gnu-build-system)
48 (native-inputs `(("python" ,python-2)))
49 (arguments
50 '(#:phases
51 (alist-cons-before
52 'check 'pre-check
53 (lambda _
54 (substitute* "tests/setup.py"
55 (("([[:space:]]*)include_dirs=.*" all space)
56 (string-append all space "library_dirs=['../src/.libs'],\n")))
57 ;; The test extension 'Recode.so' lacks RUNPATH for 'librecode.so'.
58 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/src/.libs")))
59 %standard-phases)))
60 (home-page "https://github.com/pinard/Recode")
61 (synopsis "Text encoding converter")
62 (description "The Recode library converts files between character sets and
63 usages. It recognises or produces over 200 different character sets (or about
64 300 if combined with an iconv library) and transliterates files between almost
65 any pair. When exact transliteration are not possible, it gets rid of
66 offending characters or falls back on approximations. The recode program is a
67 handy front-end to the library.")
68 (license license:gpl2+)))
69
70 (define-public enca
71 (package
72 (name "enca")
73 (version "1.16")
74 (source
75 (origin
76 (method url-fetch)
77 (uri (string-append
78 "https://github.com/nijel/enca/archive/" version ".tar.gz"))
79 (sha256
80 (base32 "1xik00x0yvhswsw2isnclabhv536xk1s42cf5z54gfbpbhc7ni8l"))
81 (file-name (string-append name "-" version ".tar.gz"))))
82 (build-system gnu-build-system)
83 (inputs `(("recode" ,recode)))
84
85 ;; Both 'test-convert-64.sh' and 'test-convert-filter.sh' manipulate a
86 ;; 'test.tmp' file, so they have to run in sequence.
87 (arguments '(#:parallel-tests? #f))
88
89 (home-page "https://github.com/nijel/enca")
90 (synopsis "Text encoding detection tool")
91 (description "Enca (Extremely Naive Charset Analyser) consists of libenca,
92 an encoding detection library, and enca, a command line frontend, integrating
93 libenca and several charset conversion libraries and tools.")
94 (license license:gpl2)))
95
96 (define-public utf8proc
97 (package
98 (name "utf8proc")
99 (version "1.3.1")
100 (source
101 (origin
102 (method url-fetch)
103 (uri (string-append
104 "https://github.com/JuliaLang/utf8proc/archive/v"
105 version ".tar.gz"))
106 (file-name (string-append name "-" version ".tar.gz"))
107 (sha256
108 (base32 "1k48as5kjkar4yj3dwxyll8ykj4k723ib5a6mnw1g86q3zi0zdl3"))))
109 (build-system gnu-build-system)
110 (arguments
111 '(#:tests? #f ;no "check" target
112 #:make-flags (list "CC=gcc"
113 (string-append "prefix=" (assoc-ref %outputs "out")))
114 #:phases
115 (modify-phases %standard-phases
116 (delete 'configure))))
117 (home-page "http://julialang.org/utf8proc/")
118 (synopsis "C library for processing UTF-8 Unicode data")
119 (description "utf8proc is a small C library that provides Unicode
120 normalization, case-folding, and other operations for data in the UTF-8
121 encoding, supporting Unicode version 7.0.")
122 (license license:expat)))
123
124 (define-public libgtextutils
125 (package
126 (name "libgtextutils")
127 (version "0.7")
128 (source
129 (origin
130 (method url-fetch)
131 (uri (string-append
132 "https://github.com/agordon/libgtextutils/releases/download/"
133 version "/libgtextutils-" version ".tar.gz"))
134 (sha256
135 (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
136 (build-system gnu-build-system)
137 (arguments
138 '(#:phases
139 (alist-cons-after
140 'unpack 'autoreconf
141 (lambda _ (zero? (system* "autoreconf" "-vif")))
142 %standard-phases)))
143 (native-inputs
144 `(("autoconf" ,autoconf)
145 ("automake" ,automake)
146 ("libtool" ,libtool)))
147 (home-page "https://github.com/agordon/libgtextutils")
148 (synopsis "Gordon's text utils library")
149 (description
150 "libgtextutils is a text utilities library used by the fastx toolkit from
151 the Hannon Lab.")
152 (license license:agpl3+)))
153
154 (define-public cityhash
155 (let ((commit "8af9b8c")
156 (revision "1"))
157 (package
158 (name "cityhash")
159 (version (string-append "1.1." revision "." commit))
160 (source (origin
161 (method git-fetch)
162 (uri (git-reference
163 (url "https://github.com/google/cityhash.git")
164 (commit commit)))
165 (file-name (string-append name "-" version ".tar.gz"))
166 (sha256
167 (base32
168 "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
169 (build-system gnu-build-system)
170 (home-page "https://github.com/google/cityhash")
171 (synopsis "C++ hash functions for strings")
172 (description
173 "CityHash provides hash functions for strings. The functions mix the
174 input bits thoroughly but are not suitable for cryptography.")
175 (license license:expat))))
176
177 (define-public libconfig
178 (package
179 (name "libconfig")
180 (version "1.5")
181 (source (origin
182 (method url-fetch)
183 (uri (string-append "http://www.hyperrealm.com/libconfig/"
184 "libconfig-" version ".tar.gz"))
185 (sha256
186 (base32
187 "1xh3hzk63v4y8815lc5209m3s6ms2cpgw4h5hg462i4f1lwsl7g3"))))
188 (build-system gnu-build-system)
189 (home-page "http://www.hyperrealm.com/libconfig/")
190 (synopsis "C/C++ configuration file library")
191 (description
192 "Libconfig is a simple library for manipulating structured configuration
193 files. This file format is more compact and more readable than XML. And
194 unlike XML, it is type-aware, so it is not necessary to do string parsing in
195 application code.")
196 (license license:lgpl2.1+)))
197
198 (define-public pfff
199 (package
200 (name "pfff")
201 (version "1.0")
202 (source (origin
203 (method url-fetch)
204 (uri (string-append "https://github.com/pfff/pfff/archive/v"
205 version ".tar.gz"))
206 (file-name (string-append name "-" version ".tar.gz"))
207 (sha256
208 (base32
209 "00m553aa277iarxj6dalmklyb64r7ias49bfwzbacsfg8h3kar8m"))))
210 (build-system cmake-build-system)
211 (home-page "http://biit.cs.ut.ee/pfff/")
212 (synopsis "Probabilistic fast file fingerprinting tool")
213 (description
214 "pfff is a tool for calculating a compact digital fingerprint of a file
215 by sampling randomly from the file instead of reading it in full.
216 Consequently, the computation has a flat performance characteristic,
217 correlated with data variation rather than file size. pfff can be as reliable
218 as existing hashing techniques, with provably negligible risk of collisions.")
219 (license license:bsd-3)))