gnu: Use invoke and return #t from all builders.
[jackhill/guix/guix.git] / gnu / packages / search.scm
CommitLineData
98e7fc9b
MW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
b9b3440b 3;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
ff8b5a3a 4;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
423d2136 5;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
98e7fc9b
MW
6;;;
7;;; This file is part of GNU Guix.
8;;;
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.
13;;;
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.
18;;;
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/>.
21
22(define-module (gnu packages search)
23 #:use-module ((guix licenses)
ff8b5a3a 24 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 x11))
98e7fc9b
MW
25 #:use-module (guix packages)
26 #:use-module (guix download)
c3753f38 27 #:use-module (guix utils)
98e7fc9b 28 #:use-module (guix build-system gnu)
a2319d2c 29 #:use-module (gnu packages)
98e7fc9b 30 #:use-module (gnu packages compression)
065b7954
EB
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages databases)
a2319d2c
EB
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages perl)
423d2136 35 #:use-module (gnu packages python)
a2319d2c
EB
36 #:use-module (gnu packages web)
37 #:use-module (gnu packages xml))
98e7fc9b
MW
38
39(define-public xapian
40 (package
41 (name "xapian")
73b3eaf0
MB
42 (version "1.4.5")
43 ;; Note: When updating Xapian, remember to update xapian-bindings below.
98e7fc9b
MW
44 (source (origin
45 (method url-fetch)
6de9dfce 46 (uri (string-append "https://oligarchy.co.uk/xapian/" version
98e7fc9b
MW
47 "/xapian-core-" version ".tar.xz"))
48 (sha256
73b3eaf0 49 (base32 "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5"))))
98e7fc9b
MW
50 (build-system gnu-build-system)
51 (inputs `(("zlib" ,zlib)
52 ("util-linux" ,util-linux)))
53 (arguments
16a23d4a
MB
54 `(#:phases
55 (modify-phases %standard-phases
6de9dfce
MB
56 (replace 'check
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.
16a23d4a 60 (lambda _
6de9dfce
MB
61 (zero? (system* "make"
62 "check-inmemory"
63 "check-remoteprog"
64 ;"check-remotetcp"
65 "check-multi"
66 "check-glass"
67 "check-chert")))))))
98e7fc9b
MW
68 (synopsis "Search Engine Library")
69 (description
70 "Xapian is a highly adaptable toolkit which allows developers to easily
71add advanced indexing and search facilities to their own applications. It
72supports the Probabilistic Information Retrieval model and also supports a
73rich set of boolean query operators.")
6de9dfce 74 (home-page "https://xapian.org/")
98e7fc9b
MW
75 (license (list gpl2+ bsd-3 x11))))
76
423d2136
RW
77(define-public python-xapian-bindings
78 (package (inherit xapian)
79 (name "python-xapian-bindings")
80 (version (package-version xapian))
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "https://oligarchy.co.uk/xapian/" version
84 "/xapian-bindings-" version ".tar.xz"))
85 (sha256
86 (base32
73b3eaf0 87 "0cwx39764w24xd25w271had4w78lnw1dgz36yvlw1g3i19rqcy34"))))
423d2136
RW
88 (build-system gnu-build-system)
89 (arguments
90 `(#:configure-flags '("--with-python3")
91 #:make-flags
92 (list (string-append "pkgpylibdir="
93 (assoc-ref %outputs "out")
c3753f38
MB
94 "/lib/python" ,(version-major+minor
95 (package-version python))
96 "/site-packages/xapian"))))
423d2136
RW
97 (inputs
98 `(("python" ,python)
99 ("python-sphinx" ,python-sphinx) ; for documentation
100 ("xapian" ,xapian)
101 ("zlib" ,zlib)))
102 (synopsis "Python bindings for the Xapian search engine library")
103 (license gpl2+)))
104
065b7954
EB
105(define-public libtocc
106 (package
107 (name "libtocc")
108 (version "1.0.1")
109 (source
110 (origin
111 (method url-fetch)
112 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
113 "v" version "/tocc-" version ".tar.gz"))
114 (sha256
115 (base32
116 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
117 (build-system gnu-build-system)
118 (native-inputs `(("catch" ,catch-framework)))
119 (inputs `(("unqlite" ,unqlite)))
120 (arguments
121 `(#:phases (modify-phases %standard-phases
122 (add-before
f8503e2b 123 'configure 'chdir-source
065b7954
EB
124 (lambda _ (chdir "libtocc/src")))
125 (replace
f8503e2b 126 'check
065b7954
EB
127 (lambda _
128 (with-directory-excursion "../tests"
129 (and (zero? (system* "./configure"
130 (string-append "CONFIG_SHELL="
131 (which "sh"))
132 (string-append "SHELL="
133 (which "sh"))
134 "CPPFLAGS=-I../src"
e91d1d31
LC
135 (string-append
136 "LDFLAGS=-L../src/.libs "
137 "-Wl,-rpath=../src/.libs")))
065b7954
EB
138 (zero? (system* "make"))
139 (zero? (system* "./libtocctests")))))))))
cc7a4bbd 140 (home-page "https://t-o-c-c.com/")
065b7954
EB
141 (synopsis "Tool for Obsessive Compulsive Classifiers")
142 (description
143 "libtocc is the engine of the Tocc project, a tag-based file management
144system. The goal of Tocc is to provide a better system for classifying files
145that is more flexible than classic file systems that are based on a tree of
146files and directories.")
147 (license gpl3+)))
148
149(define-public tocc
150 (package
151 (name "tocc")
152 (version (package-version libtocc))
153 (source (package-source libtocc))
154 (build-system gnu-build-system)
155 (inputs
156 `(("libtocc" ,libtocc)
157 ("unqlite" ,unqlite)))
158 (arguments
159 `(#:tests? #f ;No tests
160 #:phases (modify-phases %standard-phases
161 (add-after
f8503e2b 162 'unpack 'chdir-source
065b7954 163 (lambda _ (chdir "cli/src"))))))
cc7a4bbd 164 (home-page "https://t-o-c-c.com/")
065b7954
EB
165 (synopsis "Command-line interface to libtocc")
166 (description
167 "Tocc is a tag-based file management system. This package contains the
168command line tool for interacting with libtocc.")
169 (license gpl3+)))
170
6ad2e17e
EB
171(define-public bool
172 (package
173 (name "bool")
174 (version "0.2.2")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (string-append "mirror://gnu/bool/bool-"
179 version ".tar.xz"))
180 (sha256
181 (base32
182 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
183 (build-system gnu-build-system)
6fd52309 184 (home-page "https://www.gnu.org/software/bool/")
04bdcdb6 185 (synopsis "Finding text and HTML files that match boolean expressions")
6ad2e17e 186 (description
04bdcdb6
LC
187 "GNU Bool is a utility to perform text searches on files using Boolean
188expressions. For example, a search for \"hello AND world\" would return a
189file containing the phrase \"Hello, world!\". It supports both AND and OR
190statements, as well as the NEAR statement to search for the occurrence of
191words in close proximity to each other. It handles context gracefully,
192accounting for new lines and paragraph changes. It also has robust support
193for parsing HTML files.")
6ad2e17e
EB
194 (license gpl3+)))
195
ff8b5a3a
TD
196(define-public hyperestraier
197 (package
198 (name "hyperestraier")
199 (version "1.4.13")
200 (source
201 (origin
202 (method url-fetch)
203 (uri (string-append "http://fallabs.com/" name "/"
204 name "-" version ".tar.gz"))
205 (sha256
206 (base32
207 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
208 (inputs
209 `(("qdbm" ,qdbm)
210 ("zlib" ,zlib)))
211 (build-system gnu-build-system)
212 (arguments
213 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
214 (assoc-ref %outputs "out")
215 "/lib"))))
216 (home-page "http://fallabs.com/hyperestraier")
217 (synopsis "Full-text search system")
218 (description "Hyper Estraier can be used to integrate full-text
219search into applications, using either the provided command line and CGI
220interfaces, or a C API.")
221 (license lgpl2.1+)))
222
b9b3440b
EB
223(define-public mlocate
224 (package
225 (name "mlocate")
226 (version "0.26")
227 (source (origin
228 (method url-fetch)
dca96ad3
LC
229 (uri (string-append "http://releases.pagure.org/mlocate/"
230 "mlocate-" version ".tar.xz"))
b9b3440b
EB
231 (sha256
232 (base32
233 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
234 (build-system gnu-build-system)
dca96ad3 235 (home-page "https://pagure.io/mlocate")
8f65585b 236 (synopsis "Locate files on the file system")
b9b3440b
EB
237 (description
238 "mlocate is a locate/updatedb implementation. The 'm' stands for
239\"merging\": @code{updatedb} reuses the existing database to avoid rereading
240most of the file system, which makes it faster and does not trash the system
241caches as much. The locate(1) utility is intended to be completely compatible
242with slocate, and attempts to be compatible to GNU locate when it does not
243conflict with slocate compatibility.")
244 (license gpl2)))
245
a2319d2c
EB
246(define-public swish-e
247 (package
248 (name "swish-e")
249 (version "2.4.7")
250 (source (origin
251 (method url-fetch)
8a5a50a7
EB
252 (uri (list (string-append
253 "https://web.archive.org/web/20160730145202/"
254 "http://swish-e.org/distribution/"
255 "swish-e-" version ".tar.gz")
a2319d2c
EB
256 (string-append "http://http.debian.net/debian/pool/"
257 "main/s/swish-e/swish-e_" version
258 ".orig.tar.gz")))
259 (file-name (string-append name "-" version ".tar.gz"))
260 (sha256
261 (base32
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,
269 ;; HTML::Entities.
270 (inputs
7bd65a63 271 `(("perl" ,perl)
a2319d2c
EB
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)))
276 (arguments
7bd65a63
EJ
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
a2319d2c
EB
282 (add-after 'install 'wrap-programs
283 (lambda* (#:key inputs outputs #:allow-other-keys)
284 (let* ((out (assoc-ref outputs "out")))
285 (for-each
286 (lambda (program)
287 (wrap-program program
288 `("PERL5LIB" ":" prefix
289 ,(map (lambda (i)
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.
294 '("perl-uri"
295 "perl-html-parser"
296 "perl-html-tagset"
297 "perl-mime-types")))))
298 (list (string-append out "/lib/swish-e/swishspider")
299 (string-append out "/bin/swish-filter-test")))
300 #t))))))
8a5a50a7
EB
301 (home-page (string-append "https://web.archive.org/web/20160730145202/"
302 "http://swish-e.org"))
a2319d2c
EB
303 (synopsis "Web indexing system")
304 (description
305 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
306can quickly and easily index directories of files or remote web sites and
307search the generated indexes.")
308 (license gpl2+))) ;with exception
309
98e7fc9b 310;;; search.scm ends here