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 python-xyz)
43 #:use-module (gnu packages web)
44 #:use-module (gnu packages xdisorg)
45 #:use-module (gnu packages xml))
51 ;; Note: When updating Xapian, remember to update xapian-bindings below.
54 (uri (string-append "https://oligarchy.co.uk/xapian/" version
55 "/xapian-core-" version ".tar.xz"))
57 (base32 "1f4vf1w1yvsn9mn462q6snc8wkmfpifp8wrlzs4aqi45w0kr6rk8"))))
58 (build-system gnu-build-system)
59 (inputs `(("zlib" ,zlib)
60 ("util-linux" ,util-linux)))
63 (modify-phases %standard-phases
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.
76 (synopsis "Search Engine Library")
78 "Xapian is a highly adaptable toolkit which allows developers to easily
79 add advanced indexing and search facilities to their own applications. It
80 supports the Probabilistic Information Retrieval model and also supports a
81 rich set of boolean query operators.")
82 (home-page "https://xapian.org/")
83 (license (list gpl2+ bsd-3 x11))))
85 (define-public python-xapian-bindings
86 (package (inherit xapian)
87 (name "python-xapian-bindings")
88 (version (package-version xapian))
91 (uri (string-append "https://oligarchy.co.uk/xapian/" version
92 "/xapian-bindings-" version ".tar.xz"))
95 "0zqx5gcwm2mhx41fnfx30z9c31x96g5pskyrmx3c556mnklfpask"))))
96 (build-system gnu-build-system)
98 `(#:configure-flags '("--with-python3")
100 (list (string-append "pkgpylibdir="
101 (assoc-ref %outputs "out")
102 "/lib/python" ,(version-major+minor
103 (package-version python))
104 "/site-packages/xapian"))))
107 ("python-sphinx" ,python-sphinx) ; for documentation
110 (synopsis "Python bindings for the Xapian search engine library")
113 (define-public libtocc
120 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
121 "v" version "/tocc-" version ".tar.gz"))
124 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
125 (build-system gnu-build-system)
126 (native-inputs `(("catch" ,catch-framework)))
127 (inputs `(("unqlite" ,unqlite)))
129 `(#:phases (modify-phases %standard-phases
130 (add-before 'configure 'chdir-source
132 (chdir "libtocc/src")
136 (with-directory-excursion "../tests"
137 (invoke "./configure"
138 (string-append "CONFIG_SHELL="
140 (string-append "SHELL="
144 "LDFLAGS=-L../src/.libs "
145 "-Wl,-rpath=../src/.libs"))
147 (invoke "./libtocctests")))))))
148 (home-page "https://t-o-c-c.com/")
149 (synopsis "Tool for Obsessive Compulsive Classifiers")
151 "libtocc is the engine of the Tocc project, a tag-based file management
152 system. The goal of Tocc is to provide a better system for classifying files
153 that is more flexible than classic file systems that are based on a tree of
154 files and directories.")
160 (version (package-version libtocc))
161 (source (package-source libtocc))
162 (build-system gnu-build-system)
164 `(("libtocc" ,libtocc)
165 ("unqlite" ,unqlite)))
167 `(#:tests? #f ;No tests
168 #:phases (modify-phases %standard-phases
170 'unpack 'chdir-source
171 (lambda _ (chdir "cli/src"))))))
172 (home-page "https://t-o-c-c.com/")
173 (synopsis "Command-line interface to libtocc")
175 "Tocc is a tag-based file management system. This package contains the
176 command line tool for interacting with libtocc.")
186 (uri (string-append "mirror://gnu/bool/bool-"
190 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
191 (build-system gnu-build-system)
192 (home-page "https://www.gnu.org/software/bool/")
193 (synopsis "Finding text and HTML files that match boolean expressions")
195 "GNU Bool is a utility to perform text searches on files using Boolean
196 expressions. For example, a search for \"hello AND world\" would return a
197 file containing the phrase \"Hello, world!\". It supports both AND and OR
198 statements, as well as the NEAR statement to search for the occurrence of
199 words in close proximity to each other. It handles context gracefully,
200 accounting for new lines and paragraph changes. It also has robust support
201 for parsing HTML files.")
204 (define-public hyperestraier
206 (name "hyperestraier")
211 (uri (string-append "http://fallabs.com/" name "/"
212 name "-" version ".tar.gz"))
215 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
219 (build-system gnu-build-system)
221 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
222 (assoc-ref %outputs "out")
224 (home-page "http://fallabs.com/hyperestraier")
225 (synopsis "Full-text search system")
226 (description "Hyper Estraier can be used to integrate full-text
227 search into applications, using either the provided command line and CGI
228 interfaces, or a C API.")
231 (define-public mlocate
237 (uri (string-append "http://releases.pagure.org/mlocate/"
238 "mlocate-" version ".tar.xz"))
241 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
242 (build-system gnu-build-system)
243 (home-page "https://pagure.io/mlocate")
244 (synopsis "Locate files on the file system")
246 "mlocate is a locate/updatedb implementation. The 'm' stands for
247 \"merging\": @code{updatedb} reuses the existing database to avoid rereading
248 most of the file system, which makes it faster and does not trash the system
249 caches as much. The locate(1) utility is intended to be completely compatible
250 with slocate, and attempts to be compatible to GNU locate when it does not
251 conflict with slocate compatibility.")
254 (define-public swish-e
260 (uri (list (string-append
261 "https://web.archive.org/web/20160730145202/"
262 "http://swish-e.org/distribution/"
263 "swish-e-" version ".tar.gz")
264 (string-append "http://http.debian.net/debian/pool/"
265 "main/s/swish-e/swish-e_" version
267 (file-name (string-append name "-" version ".tar.gz"))
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,
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)))
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
290 (add-after 'install 'wrap-programs
291 (lambda* (#:key inputs outputs #:allow-other-keys)
292 (let* ((out (assoc-ref outputs "out")))
295 (wrap-program program
296 `("PERL5LIB" ":" prefix
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.
305 "perl-mime-types")))))
306 (list (string-append out "/lib/swish-e/swishspider")
307 (string-append out "/bin/swish-filter-test")))
309 (home-page (string-append "https://web.archive.org/web/20160730145202/"
310 "http://swish-e.org"))
311 (synopsis "Web indexing system")
313 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
314 can quickly and easily index directories of files or remote web sites and
315 search the generated indexes.")
316 (license gpl2+))) ;with exception
318 (define-public xapers
326 "https://finestructure.net/xapers/releases/xapers-"
330 "0ykz6hn3qj46w3c99d6q0pi5ncq2894simcl7vapv047zm3cylmd"))))
331 (build-system python-build-system)
333 `(("poppler" ,poppler)
334 ("python-urwid" ,python-urwid)
336 ("xdg-utils" ,xdg-utils)))
338 `(("python-latexcodec" ,python-latexcodec)
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)))
345 `(#:modules ((ice-9 rdelim)
346 (guix build python-build-system)
349 (modify-phases %standard-phases
350 (add-after 'install 'install-doc
351 (lambda* (#:key inputs outputs #:allow-other-keys)
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)
357 (begin (display (string-append line "\n") output)
358 (loop (read-line input))))))
359 (let* ((out (assoc-ref outputs "out"))
360 (bin (string-append out "/bin"))
361 (adder-out (string-append bin "/xapers-adder"))
362 (man1 (string-append out "/share/man/man1")))
363 (install-file "man/man1/xapers.1" man1)
364 (install-file "man/man1/xapers-adder.1" man1)
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"
375 (call-with-output-file adder-out
377 (purge-term-support input output)))))
378 (chmod adder-out #o555)))))))
379 (home-page "https://finestructure.net/xapers/")
380 (synopsis "Personal document indexing system")
382 "Xapers is a personal document indexing system,
383 geared towards academic journal articles build on the Xapian search engine.
384 Think of it as your own personal document search engine, or a local cache of
385 online libraries. It provides fast search of document text and
386 bibliographic data and simple document and bibtex retrieval.")
389 ;;; search.scm ends here