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 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))
53 ;; Note: When updating Xapian, remember to update xapian-bindings below.
56 (uri (string-append "https://oligarchy.co.uk/xapian/" version
57 "/xapian-core-" version ".tar.xz"))
59 (base32 "01xwqljnp5afjf9097lyfbqc6x5bcqszfdkn9l1j86imwbrv45lz"))))
60 (build-system gnu-build-system)
61 (inputs `(("zlib" ,zlib)
62 ("util-linux" ,util-linux)))
65 (modify-phases %standard-phases
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.
78 (synopsis "Search Engine Library")
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))))
87 (define-public python-xapian-bindings
88 (package (inherit xapian)
89 (name "python-xapian-bindings")
90 (version (package-version xapian))
93 (uri (string-append "https://oligarchy.co.uk/xapian/" version
94 "/xapian-bindings-" version ".tar.xz"))
97 "13bi2vr5d39ys49nlwmsv64ik5pdwkz28bh08hyylrhanb45d8wx"))))
98 (build-system gnu-build-system)
100 `(#:configure-flags '("--with-python3")
102 (list (string-append "pkgpylibdir="
103 (assoc-ref %outputs "out")
104 "/lib/python" ,(version-major+minor
105 (package-version python))
106 "/site-packages/xapian"))))
109 ("python-sphinx" ,python-sphinx) ; for documentation
112 (synopsis "Python bindings for the Xapian search engine library")
115 (define-public perl-search-xapian
117 (name "perl-search-xapian")
122 (uri (string-append "mirror://cpan/authors/id/O/OL/OLLY/"
123 "Search-Xapian-" version ".tar.gz"))
126 "0hpa8gi38j0ibq8af6dy69lm1bl5jnq76nsa69dbrzbr88l5m594"))))
127 (build-system perl-build-system)
129 `(("perl-devel-leak" ,perl-devel-leak)))
131 `(("xapian" ,xapian)))
132 (home-page "https://metacpan.org/release/Search-Xapian")
133 (synopsis "Perl XS frontend to the Xapian C++ search library")
135 "Search::Xapian wraps most methods of most Xapian classes. The missing
136 classes and methods should be added in the future. It also provides a
137 simplified, more 'perlish' interface to some common operations.")
138 (license perl-license)))
140 (define-public libtocc
147 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
148 "v" version "/tocc-" version ".tar.gz"))
151 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
152 (build-system gnu-build-system)
153 (native-inputs `(("catch" ,catch-framework)))
154 (inputs `(("unqlite" ,unqlite)))
156 `(#:phases (modify-phases %standard-phases
157 (add-before 'configure 'chdir-source
159 (chdir "libtocc/src")
163 (with-directory-excursion "../tests"
164 (invoke "./configure"
165 (string-append "CONFIG_SHELL="
167 (string-append "SHELL="
171 "LDFLAGS=-L../src/.libs "
172 "-Wl,-rpath=../src/.libs"))
174 (invoke "./libtocctests")))))))
175 (home-page "https://t-o-c-c.com/")
176 (synopsis "Tool for Obsessive Compulsive Classifiers")
178 "libtocc is the engine of the Tocc project, a tag-based file management
179 system. The goal of Tocc is to provide a better system for classifying files
180 that is more flexible than classic file systems that are based on a tree of
181 files and directories.")
187 (version (package-version libtocc))
188 (source (package-source libtocc))
189 (build-system gnu-build-system)
191 `(("libtocc" ,libtocc)
192 ("unqlite" ,unqlite)))
194 `(#:tests? #f ;No tests
195 #:phases (modify-phases %standard-phases
197 'unpack 'chdir-source
198 (lambda _ (chdir "cli/src"))))))
199 (home-page "https://t-o-c-c.com/")
200 (synopsis "Command-line interface to libtocc")
202 "Tocc is a tag-based file management system. This package contains the
203 command line tool for interacting with libtocc.")
213 (uri (string-append "mirror://gnu/bool/bool-"
217 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
218 (build-system gnu-build-system)
219 (home-page "https://www.gnu.org/software/bool/")
220 (synopsis "Finding text and HTML files that match boolean expressions")
222 "GNU Bool is a utility to perform text searches on files using Boolean
223 expressions. For example, a search for \"hello AND world\" would return a
224 file containing the phrase \"Hello, world!\". It supports both AND and OR
225 statements, as well as the NEAR statement to search for the occurrence of
226 words in close proximity to each other. It handles context gracefully,
227 accounting for new lines and paragraph changes. It also has robust support
228 for parsing HTML files.")
231 (define-public hyperestraier
233 (name "hyperestraier")
238 (uri (string-append "http://fallabs.com/" name "/"
239 name "-" version ".tar.gz"))
242 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
246 (build-system gnu-build-system)
248 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
249 (assoc-ref %outputs "out")
251 (home-page "http://fallabs.com/hyperestraier")
252 (synopsis "Full-text search system")
253 (description "Hyper Estraier can be used to integrate full-text
254 search into applications, using either the provided command line and CGI
255 interfaces, or a C API.")
258 (define-public mlocate
264 (uri (string-append "http://releases.pagure.org/mlocate/"
265 "mlocate-" version ".tar.xz"))
268 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
269 (build-system gnu-build-system)
270 (home-page "https://pagure.io/mlocate")
271 (synopsis "Locate files on the file system")
273 "mlocate is a locate/updatedb implementation. The @code{m} stands for
274 \"merging\": @code{updatedb} reuses the existing database to avoid rereading
275 most of the file system, which makes it faster and does not trash the system
276 caches as much. The locate(1) utility is intended to be completely compatible
277 with slocate, and attempts to be compatible to GNU locate when it does not
278 conflict with slocate compatibility.")
281 (define-public swish-e
287 (uri (list (string-append
288 "https://web.archive.org/web/20160730145202/"
289 "http://swish-e.org/distribution/"
290 "swish-e-" version ".tar.gz")
291 (string-append "http://http.debian.net/debian/pool/"
292 "main/s/swish-e/swish-e_" version
294 (file-name (string-append name "-" version ".tar.gz"))
297 "0qkrk7z25yp9hynj21vxkyn7yi8gcagcfxnass5cgczcz0gm9pax"))
298 (patches (search-patches "swish-e-search.patch"
299 "swish-e-format-security.patch"))))
300 (build-system gnu-build-system)
301 ;; Several other packages and perl modules may be installed alongside
302 ;; swish-e to extend its features at runtime, but are not required for
303 ;; building: xpdf, catdoc, MP3::Tag, Spreadsheet::ParseExcel,
307 ("perl-uri" ,perl-uri)
308 ("perl-html-parser" ,perl-html-parser)
309 ("perl-html-tagset" ,perl-html-tagset)
310 ("perl-mime-types" ,perl-mime-types)))
312 `(;; XXX: This fails to build with zlib (API mismatch) and tests fail
313 ;; with libxml2, so disable both.
314 #:configure-flags (list (string-append "--without-zlib")
315 (string-append "--without-libxml2"))
316 #:phases (modify-phases %standard-phases
317 (add-after 'install 'wrap-programs
318 (lambda* (#:key inputs outputs #:allow-other-keys)
319 (let* ((out (assoc-ref outputs "out")))
322 (wrap-program program
323 `("PERL5LIB" ":" prefix
325 (string-append (assoc-ref inputs i)
326 "/lib/perl5/site_perl"))
327 ;; These perl modules have no propagated
328 ;; inputs, so no further analysis needed.
332 "perl-mime-types")))))
333 (list (string-append out "/lib/swish-e/swishspider")
334 (string-append out "/bin/swish-filter-test")))
336 (home-page (string-append "https://web.archive.org/web/20160730145202/"
337 "http://swish-e.org"))
338 (synopsis "Web indexing system")
340 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
341 can quickly and easily index directories of files or remote web sites and
342 search the generated indexes.")
343 (license gpl2+))) ;with exception
345 (define-public xapers
353 "https://finestructure.net/xapers/releases/xapers-"
357 "0ykz6hn3qj46w3c99d6q0pi5ncq2894simcl7vapv047zm3cylmd"))))
358 (build-system python-build-system)
360 `(("poppler" ,poppler)
361 ("python-urwid" ,python-urwid)
363 ("xdg-utils" ,xdg-utils)))
365 `(("python-latexcodec" ,python-latexcodec)
366 ("python-pybtex" ,python-pybtex)
367 ("python-pycurl" ,python-pycurl)
368 ("python-pyyaml" ,python-pyyaml)
369 ("python-six" ,python-six)
370 ("python-xapian-bindings" ,python-xapian-bindings)))
372 `(#:modules ((ice-9 rdelim)
373 (guix build python-build-system)
376 (modify-phases %standard-phases
377 (add-after 'install 'install-doc
378 (lambda* (#:key inputs outputs #:allow-other-keys)
379 (define (purge-term-support input output)
380 (let loop ((line (read-line input)))
381 (if (string-prefix? "if [[ \"$term\"" line)
382 (begin (display "eval \"$cmd\"\n" output)
384 (begin (display (string-append line "\n") output)
385 (loop (read-line input))))))
386 (let* ((out (assoc-ref outputs "out"))
387 (bin (string-append out "/bin"))
388 (adder-out (string-append bin "/xapers-adder"))
389 (man1 (string-append out "/share/man/man1")))
390 (install-file "man/man1/xapers.1" man1)
391 (install-file "man/man1/xapers-adder.1" man1)
392 ;; below is equivalent to setting --no-term option
393 ;; permanently on; this is desirable to avoid imposing
394 ;; an x-terminal installation on the user but breaks
395 ;; some potential xapers-adder uses like auto browser
396 ;; pdf handler, but user could instead still use
397 ;; e.g. "xterm -e xapers-adder %F" for same use.
398 ;; alternatively we could propagate xterm as an input
399 ;; and replace 'x-terminal-emulator' with 'xterm'
400 (call-with-input-file "bin/xapers-adder"
402 (call-with-output-file adder-out
404 (purge-term-support input output)))))
405 (chmod adder-out #o555)))))))
406 (home-page "https://finestructure.net/xapers/")
407 (synopsis "Personal document indexing system")
409 "Xapers is a personal document indexing system,
410 geared towards academic journal articles build on the Xapian search engine.
411 Think of it as your own personal document search engine, or a local cache of
412 online libraries. It provides fast search of document text and
413 bibliographic data and simple document and bibtex retrieval.")
416 ;;; search.scm ends here