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>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages search)
23 #:use-module ((guix licenses)
24 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 x11))
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages databases)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages web)
37 #:use-module (gnu packages xml))
43 ;; Note: When updating Xapian, remember to update xapian-bindings below.
46 (uri (string-append "https://oligarchy.co.uk/xapian/" version
47 "/xapian-core-" version ".tar.xz"))
49 (base32 "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5"))))
50 (build-system gnu-build-system)
51 (inputs `(("zlib" ,zlib)
52 ("util-linux" ,util-linux)))
55 (modify-phases %standard-phases
57 ;; As of Xapian 1.3.3, the TCP server implementation uses
58 ;; getaddrinfo(). This does not work in the build environment,
59 ;; so exclude those tests. See HACKING for the list of targets.
61 (zero? (system* "make"
68 (synopsis "Search Engine Library")
70 "Xapian is a highly adaptable toolkit which allows developers to easily
71 add advanced indexing and search facilities to their own applications. It
72 supports the Probabilistic Information Retrieval model and also supports a
73 rich set of boolean query operators.")
74 (home-page "https://xapian.org/")
75 (license (list gpl2+ bsd-3 x11))))
77 (define-public python-xapian-bindings
78 (package (inherit xapian)
79 (name "python-xapian-bindings")
80 (version (package-version xapian))
83 (uri (string-append "https://oligarchy.co.uk/xapian/" version
84 "/xapian-bindings-" version ".tar.xz"))
87 "0cwx39764w24xd25w271had4w78lnw1dgz36yvlw1g3i19rqcy34"))))
88 (build-system gnu-build-system)
90 `(#:configure-flags '("--with-python3")
92 (list (string-append "pkgpylibdir="
93 (assoc-ref %outputs "out")
94 "/lib/python" ,(version-major+minor
95 (package-version python))
96 "/site-packages/xapian"))))
99 ("python-sphinx" ,python-sphinx) ; for documentation
102 (synopsis "Python bindings for the Xapian search engine library")
105 (define-public libtocc
112 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
113 "v" version "/tocc-" version ".tar.gz"))
116 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
117 (build-system gnu-build-system)
118 (native-inputs `(("catch" ,catch-framework)))
119 (inputs `(("unqlite" ,unqlite)))
121 `(#:phases (modify-phases %standard-phases
123 'configure 'chdir-source
124 (lambda _ (chdir "libtocc/src")))
128 (with-directory-excursion "../tests"
129 (and (zero? (system* "./configure"
130 (string-append "CONFIG_SHELL="
132 (string-append "SHELL="
136 "LDFLAGS=-L../src/.libs "
137 "-Wl,-rpath=../src/.libs")))
138 (zero? (system* "make"))
139 (zero? (system* "./libtocctests")))))))))
140 (home-page "https://t-o-c-c.com/")
141 (synopsis "Tool for Obsessive Compulsive Classifiers")
143 "libtocc is the engine of the Tocc project, a tag-based file management
144 system. The goal of Tocc is to provide a better system for classifying files
145 that is more flexible than classic file systems that are based on a tree of
146 files and directories.")
152 (version (package-version libtocc))
153 (source (package-source libtocc))
154 (build-system gnu-build-system)
156 `(("libtocc" ,libtocc)
157 ("unqlite" ,unqlite)))
159 `(#:tests? #f ;No tests
160 #:phases (modify-phases %standard-phases
162 'unpack 'chdir-source
163 (lambda _ (chdir "cli/src"))))))
164 (home-page "https://t-o-c-c.com/")
165 (synopsis "Command-line interface to libtocc")
167 "Tocc is a tag-based file management system. This package contains the
168 command line tool for interacting with libtocc.")
178 (uri (string-append "mirror://gnu/bool/bool-"
182 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
183 (build-system gnu-build-system)
184 (home-page "https://www.gnu.org/software/bool/")
185 (synopsis "Finding text and HTML files that match boolean expressions")
187 "GNU Bool is a utility to perform text searches on files using Boolean
188 expressions. For example, a search for \"hello AND world\" would return a
189 file containing the phrase \"Hello, world!\". It supports both AND and OR
190 statements, as well as the NEAR statement to search for the occurrence of
191 words in close proximity to each other. It handles context gracefully,
192 accounting for new lines and paragraph changes. It also has robust support
193 for parsing HTML files.")
196 (define-public hyperestraier
198 (name "hyperestraier")
203 (uri (string-append "http://fallabs.com/" name "/"
204 name "-" version ".tar.gz"))
207 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
211 (build-system gnu-build-system)
213 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
214 (assoc-ref %outputs "out")
216 (home-page "http://fallabs.com/hyperestraier")
217 (synopsis "Full-text search system")
218 (description "Hyper Estraier can be used to integrate full-text
219 search into applications, using either the provided command line and CGI
220 interfaces, or a C API.")
223 (define-public mlocate
229 (uri (string-append "http://releases.pagure.org/mlocate/"
230 "mlocate-" version ".tar.xz"))
233 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
234 (build-system gnu-build-system)
235 (home-page "https://pagure.io/mlocate")
236 (synopsis "Locate files on the file system")
238 "mlocate is a locate/updatedb implementation. The 'm' stands for
239 \"merging\": @code{updatedb} reuses the existing database to avoid rereading
240 most of the file system, which makes it faster and does not trash the system
241 caches as much. The locate(1) utility is intended to be completely compatible
242 with slocate, and attempts to be compatible to GNU locate when it does not
243 conflict with slocate compatibility.")
246 (define-public swish-e
252 (uri (list (string-append
253 "https://web.archive.org/web/20160730145202/"
254 "http://swish-e.org/distribution/"
255 "swish-e-" version ".tar.gz")
256 (string-append "http://http.debian.net/debian/pool/"
257 "main/s/swish-e/swish-e_" version
259 (file-name (string-append name "-" version ".tar.gz"))
262 "0qkrk7z25yp9hynj21vxkyn7yi8gcagcfxnass5cgczcz0gm9pax"))
263 (patches (search-patches "swish-e-search.patch"
264 "swish-e-format-security.patch"))))
265 (build-system gnu-build-system)
266 ;; Several other packages and perl modules may be installed alongside
267 ;; swish-e to extend its features at runtime, but are not required for
268 ;; building: xpdf, catdoc, MP3::Tag, Spreadsheet::ParseExcel,
272 ("perl-uri" ,perl-uri)
273 ("perl-html-parser" ,perl-html-parser)
274 ("perl-html-tagset" ,perl-html-tagset)
275 ("perl-mime-types" ,perl-mime-types)))
277 `(;; XXX: This fails to build with zlib (API mismatch) and tests fail
278 ;; with libxml2, so disable both.
279 #:configure-flags (list (string-append "--without-zlib")
280 (string-append "--without-libxml2"))
281 #:phases (modify-phases %standard-phases
282 (add-after 'install 'wrap-programs
283 (lambda* (#:key inputs outputs #:allow-other-keys)
284 (let* ((out (assoc-ref outputs "out")))
287 (wrap-program program
288 `("PERL5LIB" ":" prefix
290 (string-append (assoc-ref inputs i)
291 "/lib/perl5/site_perl"))
292 ;; These perl modules have no propagated
293 ;; inputs, so no further analysis needed.
297 "perl-mime-types")))))
298 (list (string-append out "/lib/swish-e/swishspider")
299 (string-append out "/bin/swish-filter-test")))
301 (home-page (string-append "https://web.archive.org/web/20160730145202/"
302 "http://swish-e.org"))
303 (synopsis "Web indexing system")
305 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
306 can quickly and easily index directories of files or remote web sites and
307 search the generated indexes.")
308 (license gpl2+))) ;with exception
310 ;;; search.scm ends here