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 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
24 (define-module (gnu packages search)
25 #:use-module ((guix licenses)
26 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 x11))
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 python)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages databases)
36 #:use-module (gnu packages freedesktop)
37 #:use-module (gnu packages linux)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pdf)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages python-web)
42 #:use-module (gnu packages web)
43 #:use-module (gnu packages xdisorg)
44 #:use-module (gnu packages xml))
50 ;; Note: When updating Xapian, remember to update xapian-bindings below.
53 (uri (string-append "https://oligarchy.co.uk/xapian/" version
54 "/xapian-core-" version ".tar.xz"))
56 (base32 "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5"))))
57 (build-system gnu-build-system)
58 (inputs `(("zlib" ,zlib)
59 ("util-linux" ,util-linux)))
62 (modify-phases %standard-phases
64 ;; As of Xapian 1.3.3, the TCP server implementation uses
65 ;; getaddrinfo(). This does not work in the build environment,
66 ;; so exclude those tests. See HACKING for the list of targets.
75 (synopsis "Search Engine Library")
77 "Xapian is a highly adaptable toolkit which allows developers to easily
78 add advanced indexing and search facilities to their own applications. It
79 supports the Probabilistic Information Retrieval model and also supports a
80 rich set of boolean query operators.")
81 (home-page "https://xapian.org/")
82 (license (list gpl2+ bsd-3 x11))))
84 (define-public python-xapian-bindings
85 (package (inherit xapian)
86 (name "python-xapian-bindings")
87 (version (package-version xapian))
90 (uri (string-append "https://oligarchy.co.uk/xapian/" version
91 "/xapian-bindings-" version ".tar.xz"))
94 "0cwx39764w24xd25w271had4w78lnw1dgz36yvlw1g3i19rqcy34"))))
95 (build-system gnu-build-system)
97 `(#:configure-flags '("--with-python3")
99 (list (string-append "pkgpylibdir="
100 (assoc-ref %outputs "out")
101 "/lib/python" ,(version-major+minor
102 (package-version python))
103 "/site-packages/xapian"))))
106 ("python-sphinx" ,python-sphinx) ; for documentation
109 (synopsis "Python bindings for the Xapian search engine library")
112 (define-public libtocc
119 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
120 "v" version "/tocc-" version ".tar.gz"))
123 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
124 (build-system gnu-build-system)
125 (native-inputs `(("catch" ,catch-framework)))
126 (inputs `(("unqlite" ,unqlite)))
128 `(#:phases (modify-phases %standard-phases
130 'configure 'chdir-source
131 (lambda _ (chdir "libtocc/src")))
135 (with-directory-excursion "../tests"
136 (and (zero? (system* "./configure"
137 (string-append "CONFIG_SHELL="
139 (string-append "SHELL="
143 "LDFLAGS=-L../src/.libs "
144 "-Wl,-rpath=../src/.libs")))
145 (zero? (system* "make"))
146 (zero? (system* "./libtocctests")))))))))
147 (home-page "https://t-o-c-c.com/")
148 (synopsis "Tool for Obsessive Compulsive Classifiers")
150 "libtocc is the engine of the Tocc project, a tag-based file management
151 system. The goal of Tocc is to provide a better system for classifying files
152 that is more flexible than classic file systems that are based on a tree of
153 files and directories.")
159 (version (package-version libtocc))
160 (source (package-source libtocc))
161 (build-system gnu-build-system)
163 `(("libtocc" ,libtocc)
164 ("unqlite" ,unqlite)))
166 `(#:tests? #f ;No tests
167 #:phases (modify-phases %standard-phases
169 'unpack 'chdir-source
170 (lambda _ (chdir "cli/src"))))))
171 (home-page "https://t-o-c-c.com/")
172 (synopsis "Command-line interface to libtocc")
174 "Tocc is a tag-based file management system. This package contains the
175 command line tool for interacting with libtocc.")
185 (uri (string-append "mirror://gnu/bool/bool-"
189 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
190 (build-system gnu-build-system)
191 (home-page "https://www.gnu.org/software/bool/")
192 (synopsis "Finding text and HTML files that match boolean expressions")
194 "GNU Bool is a utility to perform text searches on files using Boolean
195 expressions. For example, a search for \"hello AND world\" would return a
196 file containing the phrase \"Hello, world!\". It supports both AND and OR
197 statements, as well as the NEAR statement to search for the occurrence of
198 words in close proximity to each other. It handles context gracefully,
199 accounting for new lines and paragraph changes. It also has robust support
200 for parsing HTML files.")
203 (define-public hyperestraier
205 (name "hyperestraier")
210 (uri (string-append "http://fallabs.com/" name "/"
211 name "-" version ".tar.gz"))
214 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
218 (build-system gnu-build-system)
220 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
221 (assoc-ref %outputs "out")
223 (home-page "http://fallabs.com/hyperestraier")
224 (synopsis "Full-text search system")
225 (description "Hyper Estraier can be used to integrate full-text
226 search into applications, using either the provided command line and CGI
227 interfaces, or a C API.")
230 (define-public mlocate
236 (uri (string-append "http://releases.pagure.org/mlocate/"
237 "mlocate-" version ".tar.xz"))
240 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
241 (build-system gnu-build-system)
242 (home-page "https://pagure.io/mlocate")
243 (synopsis "Locate files on the file system")
245 "mlocate is a locate/updatedb implementation. The 'm' stands for
246 \"merging\": @code{updatedb} reuses the existing database to avoid rereading
247 most of the file system, which makes it faster and does not trash the system
248 caches as much. The locate(1) utility is intended to be completely compatible
249 with slocate, and attempts to be compatible to GNU locate when it does not
250 conflict with slocate compatibility.")
253 (define-public swish-e
259 (uri (list (string-append
260 "https://web.archive.org/web/20160730145202/"
261 "http://swish-e.org/distribution/"
262 "swish-e-" version ".tar.gz")
263 (string-append "http://http.debian.net/debian/pool/"
264 "main/s/swish-e/swish-e_" version
266 (file-name (string-append name "-" version ".tar.gz"))
269 "0qkrk7z25yp9hynj21vxkyn7yi8gcagcfxnass5cgczcz0gm9pax"))
270 (patches (search-patches "swish-e-search.patch"
271 "swish-e-format-security.patch"))))
272 (build-system gnu-build-system)
273 ;; Several other packages and perl modules may be installed alongside
274 ;; swish-e to extend its features at runtime, but are not required for
275 ;; building: xpdf, catdoc, MP3::Tag, Spreadsheet::ParseExcel,
279 ("perl-uri" ,perl-uri)
280 ("perl-html-parser" ,perl-html-parser)
281 ("perl-html-tagset" ,perl-html-tagset)
282 ("perl-mime-types" ,perl-mime-types)))
284 `(;; XXX: This fails to build with zlib (API mismatch) and tests fail
285 ;; with libxml2, so disable both.
286 #:configure-flags (list (string-append "--without-zlib")
287 (string-append "--without-libxml2"))
288 #:phases (modify-phases %standard-phases
289 (add-after 'install 'wrap-programs
290 (lambda* (#:key inputs outputs #:allow-other-keys)
291 (let* ((out (assoc-ref outputs "out")))
294 (wrap-program program
295 `("PERL5LIB" ":" prefix
297 (string-append (assoc-ref inputs i)
298 "/lib/perl5/site_perl"))
299 ;; These perl modules have no propagated
300 ;; inputs, so no further analysis needed.
304 "perl-mime-types")))))
305 (list (string-append out "/lib/swish-e/swishspider")
306 (string-append out "/bin/swish-filter-test")))
308 (home-page (string-append "https://web.archive.org/web/20160730145202/"
309 "http://swish-e.org"))
310 (synopsis "Web indexing system")
312 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
313 can quickly and easily index directories of files or remote web sites and
314 search the generated indexes.")
315 (license gpl2+))) ;with exception
317 (define-public xapers
325 "https://finestructure.net/xapers/releases/xapers-"
329 "0ykz6hn3qj46w3c99d6q0pi5ncq2894simcl7vapv047zm3cylmd"))))
330 (build-system python-build-system)
332 `(("poppler" ,poppler)
333 ("python-urwid" ,python-urwid)
335 ("xdg-utils" ,xdg-utils)))
337 `(("python-latexcodec" ,python-latexcodec)
338 ("python-pybtex" ,python-pybtex)
339 ("python-pycurl" ,python-pycurl)
340 ("python-pyyaml" ,python-pyyaml)
341 ("python-six" ,python-six)
342 ("python-xapian-bindings" ,python-xapian-bindings)))
344 `(#:modules ((ice-9 rdelim)
345 (guix build python-build-system)
348 (modify-phases %standard-phases
349 (add-after 'install 'install-doc
350 (lambda* (#:key inputs outputs #:allow-other-keys)
351 (define (purge-term-support input output)
352 (let loop ((line (read-line input)))
353 (if (string-prefix? "if [[ \"$term\"" line)
354 (begin (display "eval \"$cmd\"\n" output)
356 (begin (display (string-append line "\n") output)
357 (loop (read-line input))))))
358 (let* ((out (assoc-ref outputs "out"))
359 (bin (string-append out "/bin"))
360 (adder-out (string-append bin "/xapers-adder"))
361 (man1 (string-append out "/share/man/man1")))
362 (install-file "man/man1/xapers.1" man1)
363 (install-file "man/man1/xapers-adder.1" man1)
364 ;; below is equivalent to setting --no-term option
365 ;; permanently on; this is desirable to avoid imposing
366 ;; an x-terminal installation on the user but breaks
367 ;; some potential xapers-adder uses like auto browser
368 ;; pdf handler, but user could instead still use
369 ;; e.g. "xterm -e xapers-adder %F" for same use.
370 ;; alternatively we could propagate xterm as an input
371 ;; and replace 'x-terminal-emulator' with 'xterm'
372 (call-with-input-file "bin/xapers-adder"
374 (call-with-output-file adder-out
376 (purge-term-support input output)))))
377 (chmod adder-out #o555)))))))
378 (home-page "https://finestructure.net/xapers/")
379 (synopsis "Personal document indexing system")
381 "Xapers is a personal document indexing system,
382 geared towards academic journal articles build on the Xapian search engine.
383 Think of it as your own personal document search engine, or a local cache of
384 online libraries. It provides fast search of document text and
385 bibliographic data and simple document and bibtex retrieval.")
388 ;;; search.scm ends here