Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / search.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
3 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
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 search)
23 #:use-module ((guix licenses)
24 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 x11))
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages databases)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages web)
37 #:use-module (gnu packages xml))
38
39 (define-public xapian
40 (package
41 (name "xapian")
42 (version "1.4.5")
43 ;; Note: When updating Xapian, remember to update xapian-bindings below.
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "https://oligarchy.co.uk/xapian/" version
47 "/xapian-core-" version ".tar.xz"))
48 (sha256
49 (base32 "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5"))))
50 (build-system gnu-build-system)
51 (inputs `(("zlib" ,zlib)
52 ("util-linux" ,util-linux)))
53 (arguments
54 `(#:phases
55 (modify-phases %standard-phases
56 (replace 'check
57 ;; As of Xapian 1.3.3, the TCP server implementation uses
58 ;; getaddrinfo(). This does not work in the build environment,
59 ;; so exclude those tests. See HACKING for the list of targets.
60 (lambda _
61 (zero? (system* "make"
62 "check-inmemory"
63 "check-remoteprog"
64 ;"check-remotetcp"
65 "check-multi"
66 "check-glass"
67 "check-chert")))))))
68 (synopsis "Search Engine Library")
69 (description
70 "Xapian is a highly adaptable toolkit which allows developers to easily
71 add advanced indexing and search facilities to their own applications. It
72 supports the Probabilistic Information Retrieval model and also supports a
73 rich set of boolean query operators.")
74 (home-page "https://xapian.org/")
75 (license (list gpl2+ bsd-3 x11))))
76
77 (define-public python-xapian-bindings
78 (package (inherit xapian)
79 (name "python-xapian-bindings")
80 (version (package-version xapian))
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "https://oligarchy.co.uk/xapian/" version
84 "/xapian-bindings-" version ".tar.xz"))
85 (sha256
86 (base32
87 "0cwx39764w24xd25w271had4w78lnw1dgz36yvlw1g3i19rqcy34"))))
88 (build-system gnu-build-system)
89 (arguments
90 `(#:configure-flags '("--with-python3")
91 #:make-flags
92 (list (string-append "pkgpylibdir="
93 (assoc-ref %outputs "out")
94 "/lib/python" ,(version-major+minor
95 (package-version python))
96 "/site-packages/xapian"))))
97 (inputs
98 `(("python" ,python)
99 ("python-sphinx" ,python-sphinx) ; for documentation
100 ("xapian" ,xapian)
101 ("zlib" ,zlib)))
102 (synopsis "Python bindings for the Xapian search engine library")
103 (license gpl2+)))
104
105 (define-public libtocc
106 (package
107 (name "libtocc")
108 (version "1.0.1")
109 (source
110 (origin
111 (method url-fetch)
112 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
113 "v" version "/tocc-" version ".tar.gz"))
114 (sha256
115 (base32
116 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
117 (build-system gnu-build-system)
118 (native-inputs `(("catch" ,catch-framework)))
119 (inputs `(("unqlite" ,unqlite)))
120 (arguments
121 `(#:phases (modify-phases %standard-phases
122 (add-before
123 'configure 'chdir-source
124 (lambda _ (chdir "libtocc/src")))
125 (replace
126 'check
127 (lambda _
128 (with-directory-excursion "../tests"
129 (and (zero? (system* "./configure"
130 (string-append "CONFIG_SHELL="
131 (which "sh"))
132 (string-append "SHELL="
133 (which "sh"))
134 "CPPFLAGS=-I../src"
135 (string-append
136 "LDFLAGS=-L../src/.libs "
137 "-Wl,-rpath=../src/.libs")))
138 (zero? (system* "make"))
139 (zero? (system* "./libtocctests")))))))))
140 (home-page "https://t-o-c-c.com/")
141 (synopsis "Tool for Obsessive Compulsive Classifiers")
142 (description
143 "libtocc is the engine of the Tocc project, a tag-based file management
144 system. The goal of Tocc is to provide a better system for classifying files
145 that is more flexible than classic file systems that are based on a tree of
146 files and directories.")
147 (license gpl3+)))
148
149 (define-public tocc
150 (package
151 (name "tocc")
152 (version (package-version libtocc))
153 (source (package-source libtocc))
154 (build-system gnu-build-system)
155 (inputs
156 `(("libtocc" ,libtocc)
157 ("unqlite" ,unqlite)))
158 (arguments
159 `(#:tests? #f ;No tests
160 #:phases (modify-phases %standard-phases
161 (add-after
162 'unpack 'chdir-source
163 (lambda _ (chdir "cli/src"))))))
164 (home-page "https://t-o-c-c.com/")
165 (synopsis "Command-line interface to libtocc")
166 (description
167 "Tocc is a tag-based file management system. This package contains the
168 command line tool for interacting with libtocc.")
169 (license gpl3+)))
170
171 (define-public bool
172 (package
173 (name "bool")
174 (version "0.2.2")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (string-append "mirror://gnu/bool/bool-"
179 version ".tar.xz"))
180 (sha256
181 (base32
182 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
183 (build-system gnu-build-system)
184 (home-page "https://www.gnu.org/software/bool/")
185 (synopsis "Finding text and HTML files that match boolean expressions")
186 (description
187 "GNU Bool is a utility to perform text searches on files using Boolean
188 expressions. For example, a search for \"hello AND world\" would return a
189 file containing the phrase \"Hello, world!\". It supports both AND and OR
190 statements, as well as the NEAR statement to search for the occurrence of
191 words in close proximity to each other. It handles context gracefully,
192 accounting for new lines and paragraph changes. It also has robust support
193 for parsing HTML files.")
194 (license gpl3+)))
195
196 (define-public hyperestraier
197 (package
198 (name "hyperestraier")
199 (version "1.4.13")
200 (source
201 (origin
202 (method url-fetch)
203 (uri (string-append "http://fallabs.com/" name "/"
204 name "-" version ".tar.gz"))
205 (sha256
206 (base32
207 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
208 (inputs
209 `(("qdbm" ,qdbm)
210 ("zlib" ,zlib)))
211 (build-system gnu-build-system)
212 (arguments
213 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
214 (assoc-ref %outputs "out")
215 "/lib"))))
216 (home-page "http://fallabs.com/hyperestraier")
217 (synopsis "Full-text search system")
218 (description "Hyper Estraier can be used to integrate full-text
219 search into applications, using either the provided command line and CGI
220 interfaces, or a C API.")
221 (license lgpl2.1+)))
222
223 (define-public mlocate
224 (package
225 (name "mlocate")
226 (version "0.26")
227 (source (origin
228 (method url-fetch)
229 (uri (string-append "http://releases.pagure.org/mlocate/"
230 "mlocate-" version ".tar.xz"))
231 (sha256
232 (base32
233 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
234 (build-system gnu-build-system)
235 (home-page "https://pagure.io/mlocate")
236 (synopsis "Locate files on the file system")
237 (description
238 "mlocate is a locate/updatedb implementation. The 'm' stands for
239 \"merging\": @code{updatedb} reuses the existing database to avoid rereading
240 most of the file system, which makes it faster and does not trash the system
241 caches as much. The locate(1) utility is intended to be completely compatible
242 with slocate, and attempts to be compatible to GNU locate when it does not
243 conflict with slocate compatibility.")
244 (license gpl2)))
245
246 (define-public swish-e
247 (package
248 (name "swish-e")
249 (version "2.4.7")
250 (source (origin
251 (method url-fetch)
252 (uri (list (string-append
253 "https://web.archive.org/web/20160730145202/"
254 "http://swish-e.org/distribution/"
255 "swish-e-" version ".tar.gz")
256 (string-append "http://http.debian.net/debian/pool/"
257 "main/s/swish-e/swish-e_" version
258 ".orig.tar.gz")))
259 (file-name (string-append name "-" version ".tar.gz"))
260 (sha256
261 (base32
262 "0qkrk7z25yp9hynj21vxkyn7yi8gcagcfxnass5cgczcz0gm9pax"))
263 (patches (search-patches "swish-e-search.patch"
264 "swish-e-format-security.patch"))))
265 (build-system gnu-build-system)
266 ;; Several other packages and perl modules may be installed alongside
267 ;; swish-e to extend its features at runtime, but are not required for
268 ;; building: xpdf, catdoc, MP3::Tag, Spreadsheet::ParseExcel,
269 ;; HTML::Entities.
270 (inputs
271 `(("perl" ,perl)
272 ("perl-uri" ,perl-uri)
273 ("perl-html-parser" ,perl-html-parser)
274 ("perl-html-tagset" ,perl-html-tagset)
275 ("perl-mime-types" ,perl-mime-types)))
276 (arguments
277 `(;; XXX: This fails to build with zlib (API mismatch) and tests fail
278 ;; with libxml2, so disable both.
279 #:configure-flags (list (string-append "--without-zlib")
280 (string-append "--without-libxml2"))
281 #:phases (modify-phases %standard-phases
282 (add-after 'install 'wrap-programs
283 (lambda* (#:key inputs outputs #:allow-other-keys)
284 (let* ((out (assoc-ref outputs "out")))
285 (for-each
286 (lambda (program)
287 (wrap-program program
288 `("PERL5LIB" ":" prefix
289 ,(map (lambda (i)
290 (string-append (assoc-ref inputs i)
291 "/lib/perl5/site_perl"))
292 ;; These perl modules have no propagated
293 ;; inputs, so no further analysis needed.
294 '("perl-uri"
295 "perl-html-parser"
296 "perl-html-tagset"
297 "perl-mime-types")))))
298 (list (string-append out "/lib/swish-e/swishspider")
299 (string-append out "/bin/swish-filter-test")))
300 #t))))))
301 (home-page (string-append "https://web.archive.org/web/20160730145202/"
302 "http://swish-e.org"))
303 (synopsis "Web indexing system")
304 (description
305 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
306 can quickly and easily index directories of files or remote web sites and
307 search the generated indexes.")
308 (license gpl2+))) ;with exception
309
310 ;;; search.scm ends here