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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
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")
42 (url "https://github.com/pinard/Recode.git")
43 (commit "2d7092a9999194fc0e9449717a8048c8d8e26c18")))
45 (base32 "1wssv8z6g3ryrw33sksz4rjhlnhgvvdqszw1ggl4rcwks34n86zm"))
46 (file-name (string-append name "-" version "-checkout"))))
47 (build-system gnu-build-system)
48 (native-inputs `(("python" ,python-2)))
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")))
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+)))
78 "https://github.com/nijel/enca/archive/" version ".tar.gz"))
80 (base32 "1xik00x0yvhswsw2isnclabhv536xk1s42cf5z54gfbpbhc7ni8l"))
81 (file-name (string-append name "-" version ".tar.gz"))))
82 (build-system gnu-build-system)
83 (inputs `(("recode" ,recode)))
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))
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)))
96 (define-public utf8proc
104 "https://github.com/JuliaLang/utf8proc/archive/v"
106 (file-name (string-append name "-" version ".tar.gz"))
108 (base32 "1k48as5kjkar4yj3dwxyll8ykj4k723ib5a6mnw1g86q3zi0zdl3"))))
109 (build-system gnu-build-system)
111 '(#:tests? #f ;no "check" target
112 #:make-flags (list "CC=gcc"
113 (string-append "prefix=" (assoc-ref %outputs "out")))
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)))
124 (define-public libgtextutils
126 (name "libgtextutils")
132 "https://github.com/agordon/libgtextutils/releases/download/"
133 version "/libgtextutils-" version ".tar.gz"))
135 (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
136 (build-system gnu-build-system)
141 (lambda _ (zero? (system* "autoreconf" "-vif")))
144 `(("autoconf" ,autoconf)
145 ("automake" ,automake)
146 ("libtool" ,libtool)))
147 (home-page "https://github.com/agordon/libgtextutils")
148 (synopsis "Gordon's text utils library")
150 "libgtextutils is a text utilities library used by the fastx toolkit from
152 (license license:agpl3+)))
154 (define-public cityhash
155 (let ((commit "8af9b8c")
159 (version (string-append "1.1." revision "." commit))
163 (url "https://github.com/google/cityhash.git")
165 (file-name (string-append name "-" version ".tar.gz"))
168 "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
169 (build-system gnu-build-system)
170 (home-page "https://github.com/google/cityhash")
171 (synopsis "C++ hash functions for strings")
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))))
177 (define-public libconfig
183 (uri (string-append "http://www.hyperrealm.com/libconfig/"
184 "libconfig-" version ".tar.gz"))
187 "1xh3hzk63v4y8815lc5209m3s6ms2cpgw4h5hg462i4f1lwsl7g3"))))
188 (build-system gnu-build-system)
189 (home-page "http://www.hyperrealm.com/libconfig/")
190 (synopsis "C/C++ configuration file library")
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
196 (license license:lgpl2.1+)))
204 (uri (string-append "https://github.com/pfff/pfff/archive/v"
206 (file-name (string-append name "-" version ".tar.gz"))
209 "00m553aa277iarxj6dalmklyb64r7ias49bfwzbacsfg8h3kar8m"))))
210 (build-system cmake-build-system)
211 (home-page "http://biit.cs.ut.ee/pfff/")
212 (synopsis "Probabilistic fast file fingerprinting tool")
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)))