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