gnu: nnn: Don't use NAME in source URI.
[jackhill/guix/guix.git] / gnu / packages / search.scm
CommitLineData
98e7fc9b
MW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
b9b3440b 3;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
ff8b5a3a 4;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
423d2136 5;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
d840f6b9 6;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
f50bad80 7;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
98e7fc9b
MW
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 search)
25 #:use-module ((guix licenses)
ff8b5a3a 26 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 x11))
98e7fc9b
MW
27 #:use-module (guix packages)
28 #:use-module (guix download)
c3753f38 29 #:use-module (guix utils)
98e7fc9b 30 #:use-module (guix build-system gnu)
f50bad80 31 #:use-module (guix build-system python)
a2319d2c 32 #:use-module (gnu packages)
98e7fc9b 33 #:use-module (gnu packages compression)
065b7954
EB
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages databases)
e0f415b2 36 #:use-module (gnu packages freedesktop)
a2319d2c
EB
37 #:use-module (gnu packages linux)
38 #:use-module (gnu packages perl)
f50bad80 39 #:use-module (gnu packages pdf)
423d2136 40 #:use-module (gnu packages python)
f50bad80 41 #:use-module (gnu packages python-web)
44d10b1f 42 #:use-module (gnu packages python-xyz)
a2319d2c 43 #:use-module (gnu packages web)
e0f415b2 44 #:use-module (gnu packages xdisorg)
a2319d2c 45 #:use-module (gnu packages xml))
98e7fc9b
MW
46
47(define-public xapian
48 (package
49 (name "xapian")
208e8229 50 (version "1.4.9")
73b3eaf0 51 ;; Note: When updating Xapian, remember to update xapian-bindings below.
98e7fc9b
MW
52 (source (origin
53 (method url-fetch)
6de9dfce 54 (uri (string-append "https://oligarchy.co.uk/xapian/" version
98e7fc9b
MW
55 "/xapian-core-" version ".tar.xz"))
56 (sha256
208e8229 57 (base32 "1k7m7m9jld96k16ansfw2w3c354pvd8ibhnrb6dw012g06fw7sfd"))))
98e7fc9b
MW
58 (build-system gnu-build-system)
59 (inputs `(("zlib" ,zlib)
60 ("util-linux" ,util-linux)))
61 (arguments
16a23d4a
MB
62 `(#:phases
63 (modify-phases %standard-phases
6de9dfce
MB
64 (replace 'check
65 ;; As of Xapian 1.3.3, the TCP server implementation uses
66 ;; getaddrinfo(). This does not work in the build environment,
67 ;; so exclude those tests. See HACKING for the list of targets.
16a23d4a 68 (lambda _
d840f6b9
TGR
69 (invoke "make"
70 "check-inmemory"
71 "check-remoteprog"
72 ;"check-remotetcp"
73 "check-multi"
74 "check-glass"
75 "check-chert"))))))
98e7fc9b
MW
76 (synopsis "Search Engine Library")
77 (description
78 "Xapian is a highly adaptable toolkit which allows developers to easily
79add advanced indexing and search facilities to their own applications. It
80supports the Probabilistic Information Retrieval model and also supports a
81rich set of boolean query operators.")
6de9dfce 82 (home-page "https://xapian.org/")
98e7fc9b
MW
83 (license (list gpl2+ bsd-3 x11))))
84
423d2136
RW
85(define-public python-xapian-bindings
86 (package (inherit xapian)
87 (name "python-xapian-bindings")
88 (version (package-version xapian))
89 (source (origin
90 (method url-fetch)
91 (uri (string-append "https://oligarchy.co.uk/xapian/" version
92 "/xapian-bindings-" version ".tar.xz"))
93 (sha256
94 (base32
208e8229 95 "0ll3z3418r7bzxs4kyini2cbci5xl8i5scl3wyx88s2v4ak56bcz"))))
423d2136
RW
96 (build-system gnu-build-system)
97 (arguments
98 `(#:configure-flags '("--with-python3")
99 #:make-flags
100 (list (string-append "pkgpylibdir="
101 (assoc-ref %outputs "out")
c3753f38
MB
102 "/lib/python" ,(version-major+minor
103 (package-version python))
104 "/site-packages/xapian"))))
423d2136
RW
105 (inputs
106 `(("python" ,python)
107 ("python-sphinx" ,python-sphinx) ; for documentation
108 ("xapian" ,xapian)
109 ("zlib" ,zlib)))
110 (synopsis "Python bindings for the Xapian search engine library")
111 (license gpl2+)))
112
065b7954
EB
113(define-public libtocc
114 (package
115 (name "libtocc")
116 (version "1.0.1")
117 (source
118 (origin
119 (method url-fetch)
120 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
121 "v" version "/tocc-" version ".tar.gz"))
122 (sha256
123 (base32
124 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
125 (build-system gnu-build-system)
126 (native-inputs `(("catch" ,catch-framework)))
127 (inputs `(("unqlite" ,unqlite)))
128 (arguments
129 `(#:phases (modify-phases %standard-phases
9947dcd7
TGR
130 (add-before 'configure 'chdir-source
131 (lambda _
132 (chdir "libtocc/src")
133 #t))
134 (replace 'check
135 (lambda _
136 (with-directory-excursion "../tests"
137 (invoke "./configure"
138 (string-append "CONFIG_SHELL="
139 (which "sh"))
140 (string-append "SHELL="
141 (which "sh"))
142 "CPPFLAGS=-I../src"
143 (string-append
144 "LDFLAGS=-L../src/.libs "
145 "-Wl,-rpath=../src/.libs"))
146 (invoke "make")
147 (invoke "./libtocctests")))))))
cc7a4bbd 148 (home-page "https://t-o-c-c.com/")
065b7954
EB
149 (synopsis "Tool for Obsessive Compulsive Classifiers")
150 (description
151 "libtocc is the engine of the Tocc project, a tag-based file management
152system. The goal of Tocc is to provide a better system for classifying files
153that is more flexible than classic file systems that are based on a tree of
154files and directories.")
155 (license gpl3+)))
156
157(define-public tocc
158 (package
159 (name "tocc")
160 (version (package-version libtocc))
161 (source (package-source libtocc))
162 (build-system gnu-build-system)
163 (inputs
164 `(("libtocc" ,libtocc)
165 ("unqlite" ,unqlite)))
166 (arguments
167 `(#:tests? #f ;No tests
168 #:phases (modify-phases %standard-phases
169 (add-after
f8503e2b 170 'unpack 'chdir-source
065b7954 171 (lambda _ (chdir "cli/src"))))))
cc7a4bbd 172 (home-page "https://t-o-c-c.com/")
065b7954
EB
173 (synopsis "Command-line interface to libtocc")
174 (description
175 "Tocc is a tag-based file management system. This package contains the
176command line tool for interacting with libtocc.")
177 (license gpl3+)))
178
6ad2e17e
EB
179(define-public bool
180 (package
181 (name "bool")
182 (version "0.2.2")
183 (source
184 (origin
185 (method url-fetch)
186 (uri (string-append "mirror://gnu/bool/bool-"
187 version ".tar.xz"))
188 (sha256
189 (base32
190 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
191 (build-system gnu-build-system)
6fd52309 192 (home-page "https://www.gnu.org/software/bool/")
04bdcdb6 193 (synopsis "Finding text and HTML files that match boolean expressions")
6ad2e17e 194 (description
04bdcdb6
LC
195 "GNU Bool is a utility to perform text searches on files using Boolean
196expressions. For example, a search for \"hello AND world\" would return a
197file containing the phrase \"Hello, world!\". It supports both AND and OR
198statements, as well as the NEAR statement to search for the occurrence of
199words in close proximity to each other. It handles context gracefully,
200accounting for new lines and paragraph changes. It also has robust support
201for parsing HTML files.")
6ad2e17e
EB
202 (license gpl3+)))
203
ff8b5a3a
TD
204(define-public hyperestraier
205 (package
206 (name "hyperestraier")
207 (version "1.4.13")
208 (source
209 (origin
210 (method url-fetch)
211 (uri (string-append "http://fallabs.com/" name "/"
212 name "-" version ".tar.gz"))
213 (sha256
214 (base32
215 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
216 (inputs
217 `(("qdbm" ,qdbm)
218 ("zlib" ,zlib)))
219 (build-system gnu-build-system)
220 (arguments
221 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
222 (assoc-ref %outputs "out")
223 "/lib"))))
224 (home-page "http://fallabs.com/hyperestraier")
225 (synopsis "Full-text search system")
226 (description "Hyper Estraier can be used to integrate full-text
227search into applications, using either the provided command line and CGI
228interfaces, or a C API.")
229 (license lgpl2.1+)))
230
b9b3440b
EB
231(define-public mlocate
232 (package
233 (name "mlocate")
234 (version "0.26")
235 (source (origin
236 (method url-fetch)
dca96ad3
LC
237 (uri (string-append "http://releases.pagure.org/mlocate/"
238 "mlocate-" version ".tar.xz"))
b9b3440b
EB
239 (sha256
240 (base32
241 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
242 (build-system gnu-build-system)
dca96ad3 243 (home-page "https://pagure.io/mlocate")
8f65585b 244 (synopsis "Locate files on the file system")
b9b3440b
EB
245 (description
246 "mlocate is a locate/updatedb implementation. The 'm' stands for
247\"merging\": @code{updatedb} reuses the existing database to avoid rereading
248most of the file system, which makes it faster and does not trash the system
249caches as much. The locate(1) utility is intended to be completely compatible
250with slocate, and attempts to be compatible to GNU locate when it does not
251conflict with slocate compatibility.")
252 (license gpl2)))
253
a2319d2c
EB
254(define-public swish-e
255 (package
256 (name "swish-e")
257 (version "2.4.7")
258 (source (origin
259 (method url-fetch)
8a5a50a7
EB
260 (uri (list (string-append
261 "https://web.archive.org/web/20160730145202/"
262 "http://swish-e.org/distribution/"
263 "swish-e-" version ".tar.gz")
a2319d2c
EB
264 (string-append "http://http.debian.net/debian/pool/"
265 "main/s/swish-e/swish-e_" version
266 ".orig.tar.gz")))
267 (file-name (string-append name "-" version ".tar.gz"))
268 (sha256
269 (base32
270 "0qkrk7z25yp9hynj21vxkyn7yi8gcagcfxnass5cgczcz0gm9pax"))
271 (patches (search-patches "swish-e-search.patch"
272 "swish-e-format-security.patch"))))
273 (build-system gnu-build-system)
274 ;; Several other packages and perl modules may be installed alongside
275 ;; swish-e to extend its features at runtime, but are not required for
276 ;; building: xpdf, catdoc, MP3::Tag, Spreadsheet::ParseExcel,
277 ;; HTML::Entities.
278 (inputs
7bd65a63 279 `(("perl" ,perl)
a2319d2c
EB
280 ("perl-uri" ,perl-uri)
281 ("perl-html-parser" ,perl-html-parser)
282 ("perl-html-tagset" ,perl-html-tagset)
283 ("perl-mime-types" ,perl-mime-types)))
284 (arguments
7bd65a63
EJ
285 `(;; XXX: This fails to build with zlib (API mismatch) and tests fail
286 ;; with libxml2, so disable both.
287 #:configure-flags (list (string-append "--without-zlib")
288 (string-append "--without-libxml2"))
289 #:phases (modify-phases %standard-phases
a2319d2c
EB
290 (add-after 'install 'wrap-programs
291 (lambda* (#:key inputs outputs #:allow-other-keys)
292 (let* ((out (assoc-ref outputs "out")))
293 (for-each
294 (lambda (program)
295 (wrap-program program
296 `("PERL5LIB" ":" prefix
297 ,(map (lambda (i)
298 (string-append (assoc-ref inputs i)
299 "/lib/perl5/site_perl"))
300 ;; These perl modules have no propagated
301 ;; inputs, so no further analysis needed.
302 '("perl-uri"
303 "perl-html-parser"
304 "perl-html-tagset"
305 "perl-mime-types")))))
306 (list (string-append out "/lib/swish-e/swishspider")
307 (string-append out "/bin/swish-filter-test")))
308 #t))))))
8a5a50a7
EB
309 (home-page (string-append "https://web.archive.org/web/20160730145202/"
310 "http://swish-e.org"))
a2319d2c
EB
311 (synopsis "Web indexing system")
312 (description
313 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
314can quickly and easily index directories of files or remote web sites and
315search the generated indexes.")
316 (license gpl2+))) ;with exception
317
f50bad80
AM
318(define-public xapers
319 (package
320 (name "xapers")
321 (version "0.8.2")
322 (source
323 (origin
324 (method url-fetch)
325 (uri (string-append
326 "https://finestructure.net/xapers/releases/xapers-"
327 version ".tar.gz"))
328 (sha256
329 (base32
330 "0ykz6hn3qj46w3c99d6q0pi5ncq2894simcl7vapv047zm3cylmd"))))
331 (build-system python-build-system)
332 (propagated-inputs
f50bad80 333 `(("poppler" ,poppler)
e0f415b2
AM
334 ("python-urwid" ,python-urwid)
335 ("xclip" ,xclip)
336 ("xdg-utils" ,xdg-utils)))
337 (inputs
338 `(("python-latexcodec" ,python-latexcodec)
f50bad80
AM
339 ("python-pybtex" ,python-pybtex)
340 ("python-pycurl" ,python-pycurl)
341 ("python-pyyaml" ,python-pyyaml)
342 ("python-six" ,python-six)
343 ("python-xapian-bindings" ,python-xapian-bindings)))
344 (arguments
e0f415b2
AM
345 `(#:modules ((ice-9 rdelim)
346 (guix build python-build-system)
347 (guix build utils))
348 #:phases
f50bad80
AM
349 (modify-phases %standard-phases
350 (add-after 'install 'install-doc
351 (lambda* (#:key inputs outputs #:allow-other-keys)
e0f415b2
AM
352 (define (purge-term-support input output)
353 (let loop ((line (read-line input)))
354 (if (string-prefix? "if [[ \"$term\"" line)
355 (begin (display "eval \"$cmd\"\n" output)
356 #t)
357 (begin (display (string-append line "\n") output)
358 (loop (read-line input))))))
f50bad80
AM
359 (let* ((out (assoc-ref outputs "out"))
360 (bin (string-append out "/bin"))
e0f415b2 361 (adder-out (string-append bin "/xapers-adder"))
f50bad80 362 (man1 (string-append out "/share/man/man1")))
b357ccdd
AM
363 (install-file "man/man1/xapers.1" man1)
364 (install-file "man/man1/xapers-adder.1" man1)
e0f415b2
AM
365 ;; below is equivalent to setting --no-term option
366 ;; permanently on; this is desirable to avoid imposing
367 ;; an x-terminal installation on the user but breaks
368 ;; some potential xapers-adder uses like auto browser
369 ;; pdf handler, but user could instead still use
370 ;; e.g. "xterm -e xapers-adder %F" for same use.
371 ;; alternatively we could propagate xterm as an input
372 ;; and replace 'x-terminal-emulator' with 'xterm'
373 (call-with-input-file "bin/xapers-adder"
374 (lambda (input)
375 (call-with-output-file adder-out
376 (lambda (output)
377 (purge-term-support input output)))))
378 (chmod adder-out #o555)))))))
f50bad80
AM
379 (home-page "https://finestructure.net/xapers/")
380 (synopsis "Personal document indexing system")
381 (description
382 "Xapers is a personal document indexing system,
383geared towards academic journal articles build on the Xapian search engine.
384Think of it as your own personal document search engine, or a local cache of
385online libraries. It provides fast search of document text and
386bibliographic data and simple document and bibtex retrieval.")
387 (license gpl3+)))
388
98e7fc9b 389;;; search.scm ends here