projects/guix·blob javascript-team · refs

929 lines · 37.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Mark H Weaver <[email protected]>
3;;; Copyright © 2015, 2016 Eric Bavier <[email protected]>
4;;; Copyright © 2017 Thomas Danckaert <[email protected]>
5;;; Copyright © 2017, 2021, 2024 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2018 Adam Massmann <[email protected]>
8;;; Copyright © 2020 Hartmut Goebel <[email protected]>
9;;; Copyright © 2021 Vinicius Monego <[email protected]>
10;;; Copyright © 2021 Alexandr Vityazev <[email protected]>
11;;; Copyright © 2021, 2022 Nicolas Goaziou <[email protected]>
12;;; Copyright © 2022 Jai Vetrivelan <[email protected]>
13;;; Copyright © 2022 Arun Isaac <[email protected]>
14;;; Copyright © 2022 Michael Rohleder <[email protected]>
15;;; Copyright © 2023 Adam Faiz <[email protected]>
16;;; Copyright © 2023 David Pflug <[email protected]>
17;;; Copyright © 2024-2026 Ashish SHUKLA <[email protected]>
18;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
19;;; Copyright © 2025 Nicolas Graves <[email protected]>
20;;; Copyright © Zheng Junjie <[email protected]>
21;;; Copyright © 2026 Marius Bakke <[email protected]>
22;;;
23;;; This file is part of GNU Guix.
24;;;
25;;; GNU Guix is free software; you can redistribute it and/or modify it
26;;; under the terms of the GNU General Public License as published by
27;;; the Free Software Foundation; either version 3 of the License, or (at
28;;; your option) any later version.
29;;;
30;;; GNU Guix is distributed in the hope that it will be useful, but
31;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33;;; GNU General Public License for more details.
34;;;
35;;; You should have received a copy of the GNU General Public License
36;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38(define-module (gnu packages search)
39 #:use-module (gnu packages aspell)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages c)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages dns)
48 #:use-module (gnu packages ebook)
49 #:use-module (gnu packages elf)
50 #:use-module (gnu packages file)
51 #:use-module (gnu packages freedesktop)
52 #:use-module (gnu packages gawk)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages gnunet)
56 #:use-module (gnu packages groff)
57 #:use-module (gnu packages gtk)
58 #:use-module (gnu packages icu4c)
59 #:use-module (gnu packages less)
60 #:use-module (gnu packages linux)
61 #:use-module (gnu packages pcre)
62 #:use-module (gnu packages pdf)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages photo)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages python-build)
68 #:use-module (gnu packages python-crypto)
69 #:use-module (gnu packages python-web)
70 #:use-module (gnu packages python-xyz)
71 #:use-module (gnu packages qt)
72 #:use-module (gnu packages regex)
73 #:use-module (gnu packages serialization)
74 #:use-module (gnu packages sphinx)
75 #:use-module (gnu packages swig)
76 #:use-module (gnu packages time)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages web)
79 #:use-module (gnu packages xdisorg)
80 #:use-module (gnu packages xml)
81 #:use-module (gnu packages)
82 #:use-module (guix build-system cargo)
83 #:use-module (guix build-system gnu)
84 #:use-module (guix build-system meson)
85 #:use-module (guix build-system perl)
86 #:use-module (guix build-system pyproject)
87 #:use-module (guix download)
88 #:use-module (guix gexp)
89 #:use-module (guix git-download)
90 #:use-module ((guix licenses) #:prefix license:)
91 #:use-module (guix packages)
92 #:use-module (guix utils))
93
94(define-public xapian
95 (package
96 (name "xapian")
97 (version "2.1.0")
98 ;; Note: When updating Xapian, remember to update omega and
99 ;; python-xapian-bindings below.
100 (source (origin
101 (method url-fetch)
102 (uri (string-append "https://oligarchy.co.uk/xapian/" version
103 "/xapian-core-" version ".tar.xz"))
104 (sha256
105 (base32 "1k5ap1qry8rwbimmchg52sxg442s33lp5xz1nl93sbildmc5j4lf"))))
106 (build-system gnu-build-system)
107 (inputs (list zlib
108 `(,util-linux "lib")))
109 (arguments
110 `(#:phases
111 (modify-phases %standard-phases
112 (add-after 'unpack 'skip-remotetcp-tests
113 ;; As of Xapian 1.3.3, the TCP server implementation uses
114 ;; getaddrinfo(). This does not work in the build environment,
115 ;; so exclude those tests.
116 (lambda _
117 (substitute* "tests/harness/testrunner.cc"
118 (("do_tests_for_backend\\(BackendManagerRemoteTcp.*")
119 ""))))
120 (add-before 'check 'set-automated-testing-flag
121 (lambda _
122 ;; Skip timing-sensitive tests to avoid indeterministic failures.
123 (setenv "AUTOMATED_TESTING" "1"))))))
124 (synopsis "Search Engine Library")
125 (description
126 "Xapian is a highly adaptable toolkit which allows developers to easily
127add advanced indexing and search facilities to their own applications. It
128supports the Probabilistic Information Retrieval model and also supports a
129rich set of boolean query operators.")
130 (home-page "https://xapian.org/")
131 (properties
132 '((release-monitoring-url . "https://xapian.org/download.html")
133 (release-file-regexp . "xapian-core-([0-9\\.]+).tar.xz")))
134 (license (list license:gpl2+ license:bsd-3 license:x11))))
135
136(define-public xapian-1.4
137 (package
138 (inherit xapian)
139 (version "1.4.32")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "https://oligarchy.co.uk/xapian/" version
143 "/xapian-core-" version ".tar.xz"))
144 (sha256
145 (base32
146 "1kmfjxc1k5hcjg8fmi4ars2z4yaas5l94mzmmmb1fc9727l69zf4"))))))
147
148(define-public omega
149 (package
150 (name "omega")
151 (version (package-version xapian))
152 (source
153 (origin
154 (method url-fetch)
155 (uri (string-append "https://oligarchy.co.uk/xapian/" version
156 "/xapian-omega-" version ".tar.xz"))
157 (sha256
158 (base32
159 "1glpa00plrzfndn5dfph2i4s9acpjbzj81p9qcl0qyfbbydz5g73"))))
160 (build-system gnu-build-system)
161 (native-inputs
162 (list pkg-config))
163 (inputs
164 (list file pcre2 perl xapian zlib))
165 (home-page "https://xapian.org/")
166 (synopsis "Search engine built on Xapian")
167 (description
168 "Omega is a search application built on Xapian. It provides indexers and
169a CGI web search frontend.")
170 (license (list license:gpl2+ ; Main license
171 ;; csvescape.cc, csvescape.h, csvesctest.cc, datetime.cc,
172 ;; datetime.h, jsonescape.cc, jsonescape.h, jsonesctest.cc,
173 ;; mimemap.h, my-html-tok.h, namedents.h, pkglibbindir.cc,
174 ;; pkglibbindir.h, timegm.cc, timegm.h, urldecode.h,
175 ;; urlencode.cc, urlencode.h, urlenctest.cc, common/Tokeniseise.pm,
176 ;; common/keyword.cc, common/keyword.h
177 license:expat))))
178
179(define %xapian-bindings-origin
180 (let ((version (package-version xapian)))
181 (origin
182 (method url-fetch)
183 (uri (string-append "https://oligarchy.co.uk/xapian/" version
184 "/xapian-bindings-" version ".tar.xz"))
185 (sha256
186 (base32 "0p47wg5m9nhxj5mbw1n8kqdnbp9jpfafp9i5lrpackrvy64w2bpm")))))
187
188(define-public python-xapian-bindings
189 (package (inherit xapian)
190 (name "python-xapian-bindings")
191 (version (package-version xapian))
192 (source %xapian-bindings-origin)
193 (build-system gnu-build-system)
194 (arguments
195 (list #:configure-flags #~(list "--with-python3")
196 #:make-flags
197 #~(list (string-append "pkgpylibdir="
198 #$output
199 "/lib/python" #$(version-major+minor
200 (package-version python))
201 "/site-packages/xapian")
202 ;; XXX: Otherwise set to "None", which produces _xapianNone
203 ;; and ends up unable to find it.
204 "PYTHON3_SO=.so")))
205 (native-inputs
206 (list python-sphinx)) ;for documentation
207 (inputs
208 (list python xapian zlib))
209 (synopsis "Python bindings for the Xapian search engine library")
210 (license license:gpl2+)))
211
212(define-public perl-xapian
213 (package
214 (inherit xapian)
215 (name "perl-xapian")
216 (source %xapian-bindings-origin)
217 (arguments
218 (list #:modules `((ice-9 popen)
219 (ice-9 rdelim)
220 ,@%default-gnu-modules)
221 #:configure-flags #~(list "--with-perl")
222 #:make-flags
223 #~(list (string-append "perllibdir="
224 #$output
225 "/lib/perl5/site_perl/"
226 #$(package-version perl)))
227 #:phases
228 #~(modify-phases %standard-phases
229 (replace 'install
230 (lambda* (#:key (make-flags '()) #:allow-other-keys)
231 ;; Extract the architecture-dependent install directory
232 ;; for the solib.
233 (let* ((port (open-pipe* OPEN_READ
234 "perl" "-V:archlib"))
235 (arch-lib (read-line port))
236 (arch-lib-sans-suffix
237 (string-drop-right arch-lib 2))
238 (arch-lib-sans-prefix
239 (string-drop arch-lib-sans-suffix
240 (string-length "archlib='")))
241 (arch-lib-sans-store
242 (string-drop arch-lib-sans-prefix
243 (+ (string-length (%store-directory))
244 1)))
245 (arch-lib-sans-perldir
246 (string-join
247 (cdr (string-split arch-lib-sans-store #\/))
248 "/")))
249 (close-port port)
250 (apply invoke "make" "install"
251 (string-append "perlarchdir="
252 #$output
253 "/" arch-lib-sans-perldir
254 "/auto/Xapian")
255 make-flags)))))))
256 (native-inputs
257 (list perl swig))
258 (inputs
259 (list xapian zlib))
260 (synopsis "Perl bindings for the Xapian search engine library")
261 ;; Note: Xapian.pm says "you can redistribute it and/or modify it
262 ;; under the same terms as Perl itself". Several source files
263 ;; carry the GPL2 license that's also in COPYING.
264 (license (list license:perl-license
265 license:gpl2+))))
266
267;; Note: This package is obsolete, and won't work with Xapian 2.0.
268;; Users are encouraged to migrate to perl-xapian instead.
269(define-public perl-search-xapian
270 (package
271 (name "perl-search-xapian")
272 (version "1.2.25.7")
273 (source
274 (origin
275 (method url-fetch)
276 (uri (string-append "mirror://cpan/authors/id/O/OL/OLLY/"
277 "Search-Xapian-" version ".tar.gz"))
278 (sha256
279 (base32 "02cxv5s3651hxb37c6gzi79216sm0vy1vbq739zfrsm9223i76w4"))))
280 (build-system perl-build-system)
281 (native-inputs
282 (list perl-devel-leak))
283 (inputs
284 (list xapian-1.4))
285 (home-page "https://metacpan.org/release/Search-Xapian")
286 (synopsis "Perl XS frontend to the Xapian C++ search library")
287 (description
288 "Search::Xapian wraps most methods of most Xapian classes. The missing
289classes and methods should be added in the future. It also provides a
290simplified, more 'perlish' interface to some common operations.
291
292Note: This package is obsolete. Please migrate to perl-xapian instead.")
293 (license license:perl-license)))
294
295(define-public libtocc
296 (package
297 (name "libtocc")
298 (version "1.0.1")
299 (source
300 (origin
301 (method url-fetch)
302 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
303 "v" version "/tocc-" version ".tar.gz"))
304 (sha256
305 (base32
306 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
307 (build-system gnu-build-system)
308 (native-inputs (list catch-framework))
309 (inputs (list unqlite))
310 (arguments
311 `(#:phases (modify-phases %standard-phases
312 (add-before 'configure 'chdir-source
313 (lambda _
314 (chdir "libtocc/src")
315 #t))
316 (replace 'check
317 (lambda _
318 (with-directory-excursion "../tests"
319 (invoke "./configure"
320 (string-append "CONFIG_SHELL="
321 (which "sh"))
322 (string-append "SHELL="
323 (which "sh"))
324 "CPPFLAGS=-I../src"
325 (string-append
326 "LDFLAGS=-L../src/.libs "
327 "-Wl,-rpath=../src/.libs"))
328 (invoke "make")
329 (invoke "./libtocctests")))))))
330 (home-page "https://t-o-c-c.com/")
331 (synopsis "Tool for Obsessive Compulsive Classifiers")
332 (description
333 "libtocc is the engine of the Tocc project, a tag-based file management
334system. The goal of Tocc is to provide a better system for classifying files
335that is more flexible than classic file systems that are based on a tree of
336files and directories.")
337 (license license:gpl3+)))
338
339(define-public tocc
340 (package
341 (name "tocc")
342 (version (package-version libtocc))
343 (source (package-source libtocc))
344 (build-system gnu-build-system)
345 (inputs
346 (list libtocc unqlite))
347 (arguments
348 `(#:tests? #f ;No tests
349 #:phases (modify-phases %standard-phases
350 (add-after
351 'unpack 'chdir-source
352 (lambda _ (chdir "cli/src"))))))
353 (home-page "https://t-o-c-c.com/")
354 (synopsis "Command-line interface to libtocc")
355 (description
356 "Tocc is a tag-based file management system. This package contains the
357command line tool for interacting with libtocc.")
358 (license license:gpl3+)))
359
360(define-public bool
361 (package
362 (name "bool")
363 (version "0.2.2")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (string-append "mirror://gnu/bool/bool-"
368 version ".tar.xz"))
369 (sha256
370 (base32
371 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
372 (build-system gnu-build-system)
373 (home-page "https://www.gnu.org/software/bool/")
374 (synopsis "Finding text and HTML files that match boolean expressions")
375 (description
376 "GNU Bool is a utility to perform text searches on files using Boolean
377expressions. For example, a search for \"hello AND world\" would return a
378file containing the phrase \"Hello, world!\". It supports both AND and OR
379statements, as well as the NEAR statement to search for the occurrence of
380words in close proximity to each other. It handles context gracefully,
381accounting for new lines and paragraph changes. It also has robust support
382for parsing HTML files.")
383 (license license:gpl3+)))
384
385(define-public fsearch
386 (package
387 (name "fsearch")
388 (version "0.2.3")
389 (source
390 (origin
391 (method git-fetch)
392 (uri (git-reference
393 (url "https://github.com/cboxdoerfer/fsearch")
394 (commit version)))
395 (file-name (git-file-name name version))
396 (sha256
397 (base32 "12vj1ymvg561594vdq852ianbkgnvrq585qp5jrrv2kq307jh5sl"))))
398 (build-system meson-build-system)
399 (native-inputs
400 (list autoconf
401 automake
402 gettext-minimal
403 `(,glib "bin") ;for glib-compile-resources
404 intltool
405 libtool
406 pkg-config))
407 (inputs
408 (list gtk+ icu4c pcre2))
409 (home-page "https://github.com/cboxdoerfer/fsearch")
410 (synopsis "Fast file search utility")
411 (description
412 "FSearch is a fast file search utility, inspired by Everything
413Search Engine. It is written in C and based on GTK3.")
414 (license license:gpl2+)))
415
416(define-public recoll
417 (package
418 (name "recoll")
419 (version "1.44.1")
420 (source
421 (origin
422 (method url-fetch)
423 (uri (string-append "https://www.recoll.org/recoll-" version ".tar.gz"))
424 (sha256
425 (base32 "0zhjpqlv18ahh7lfv464rr274h2czyvfl19kbswsd8vf7bpzaxqg"))))
426 (outputs (list "out" "python"))
427 (build-system meson-build-system)
428 (arguments
429 (list
430 #:imported-modules
431 `((guix build gremlin)
432 ,@%meson-build-system-modules
433 ,@%pyproject-build-system-modules)
434 #:modules
435 '((guix build meson-build-system)
436 ((guix build pyproject-build-system) #:prefix py:)
437 (guix build utils)
438 (guix build gremlin)
439 (ice-9 match))
440 #:configure-flags
441 #~(list "-Dwebkit=false"
442 "-Dpython-module=true"
443 "-Dsystemd=false"
444 "-Dinotify=false"
445 "-Drecollq=true")
446 #:phases
447 #~(modify-phases %standard-phases
448 ;; XXX: Missing runpath item.
449 (add-before 'shrink-runpath 'patchelf
450 (lambda _
451 (let ((binary (string-append #$output "/bin/recoll")))
452 (invoke "patchelf" "--set-rpath"
453 (string-join (cons* (string-append #$output "/lib")
454 (file-runpath binary))
455 ":")
456 binary))))
457 (add-after 'unpack 'patch-default-data-dir
458 (lambda _
459 (substitute* "python/recoll/recoll/rclconfig.py"
460 (("/opt/local") #$output))))
461 (add-after 'install 'wrap-filters
462 (lambda* (#:key inputs #:allow-other-keys)
463 (let ((target (string-append #$output "/share/recoll/filters/")))
464 (for-each
465 (match-lambda
466 ((program . binaries)
467 (wrap-program (string-append target program)
468 `("PATH" ":" prefix
469 ,(map (lambda (bin)
470 (dirname
471 (search-input-file
472 inputs
473 (string-append "/bin/" bin))))
474 binaries)))))
475 '(("rclps" . ("pdftotext"))
476 ("rclpdf.py" . ("pdftotext"))
477 ("rclpurple" . ("gawk"))
478 ("rcllyx" . ("iconv"))
479 ("rcltex" . ("iconv"))
480 ("rclkwd" . ("unzip" "gzip" "tar" "xsltproc"))
481 ("rclman" . ("groff"))
482 ("rclgaim" . ("gawk" "iconv"))
483 ("rclaptosidman" . ("sed"))
484 ("rclscribus" . ("grep" "gawk" "sed"))))
485 (wrap-program (string-append target "rclimg")
486 `("PERL5LIB" ":" prefix
487 (,(getenv "PERL5LIB")))))))
488 (add-after 'install 'relocate-python
489 (lambda* (#:key inputs outputs #:allow-other-keys)
490 (define (py:site output)
491 (py:site-packages inputs `(("out" . ,output))))
492 (let ((origin (py:site #$output))
493 (destination (py:site #$output:python)))
494 (mkdir-p destination)
495 (copy-recursively origin destination)
496 (delete-file-recursively (dirname origin))))))))
497 (inputs
498 (list aspell
499 chmlib
500 inotify-tools
501 jsoncpp
502 libxslt
503 libxml2
504 python
505 qtbase-5
506 unzip
507 xapian
508 zlib
509 ;; For filters
510 gawk
511 grep
512 groff
513 gzip
514 libiconv
515 perl
516 perl-image-exiftool
517 poppler
518 sed
519 tar))
520 (native-inputs
521 (list patchelf pkg-config python qttools-5))
522 (home-page "https://www.recoll.org")
523 (synopsis "Find documents based on their contents or file names")
524 (description "Recoll finds documents based on their contents as well as
525their file names. It can search most document formats, but you may need
526external applications for text extraction. It can reach any storage place:
527files, archive members, email attachments, transparently handling
528decompression.")
529 (license license:gpl2+)))
530
531(define-public recoll-cli
532 (package/inherit recoll
533 (name "recoll-cli")
534 (arguments
535 (substitute-keyword-arguments arguments
536 ((#:configure-flags flags #~(list))
537 #~(cons* "-Dqtgui=false" "-Dx11mon=false" #$flags))
538 ((#:phases phases #~%standard-phases)
539 #~(modify-phases #$phases
540 (delete 'patchelf)))))
541 (inputs
542 (modify-inputs inputs
543 (delete "qtbase")))
544 (native-inputs
545 (modify-inputs native-inputs
546 (delete "patchelf" "qttools")))))
547
548(define-public hyperestraier
549 (package
550 (name "hyperestraier")
551 (version "1.4.13")
552 (source
553 (origin
554 (method url-fetch)
555 (uri (string-append "http://fallabs.com/" name "/"
556 name "-" version ".tar.gz"))
557 (sha256
558 (base32
559 "1qk3pxgzyrpcz5qfyd5xs2hw9q1cbb7j5zd4kp1diq501wcj2vs9"))))
560 (inputs
561 (list qdbm zlib))
562 (build-system gnu-build-system)
563 (arguments
564 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
565 (assoc-ref %outputs "out")
566 "/lib"))))
567 (home-page "https://fallabs.com/hyperestraier")
568 (synopsis "Full-text search system")
569 (description "Hyper Estraier can be used to integrate full-text
570search into applications, using either the provided command line and CGI
571interfaces, or a C API.")
572 (license license:lgpl2.1+)))
573
574(define-public meilisearch
575 (package
576 (name "meilisearch")
577 (version "1.49.0")
578 (source
579 (origin
580 (method git-fetch)
581 (uri (git-reference
582 (url "https://github.com/meilisearch/meilisearch")
583 (commit (string-append "v" version))))
584 (file-name (git-file-name name version))
585 (sha256
586 (base32 "0s9pw6i830zmccd0n0xlraakyalq9cdi9khqp7j9qy4dhbrigdd1"))
587 (modules '((guix build utils)))
588 (snippet
589 #~(begin
590 (use-modules (ice-9 rdelim))
591 ;; Remove Enterprise Edition source
592 ;; Make sure that all are under the EXPAT license.
593 (for-each
594 delete-file
595 (find-files
596 "."
597 (lambda (file _)
598 (and
599 (string-suffix? ".rs" file)
600 (call-with-input-file file
601 (lambda (in)
602 (define rx
603 (make-regexp
604 "This file is part of Meilisearch Enterprise Edition [(]EE[)]\\."))
605 (let loop ((line (read-line in 'concat)))
606 (if (eof-object? line)
607 #f
608 (begin
609 (or (regexp-exec rx line)
610 (loop (read-line in 'concat))))))))))))))))
611 (build-system cargo-build-system)
612 (arguments
613 (list #:install-source? #f
614 #:cargo-install-paths ''("crates/meilisearch" "crates/meilitool")
615 ;; some tests failed because "Too many open files", and some tests
616 ;; require network to download assets
617 #:tests? #f
618 #:phases
619 #~(modify-phases %standard-phases
620 (add-after 'unpack 'adjust-git-src
621 (lambda _
622 (substitute* "crates/milli/Cargo.toml"
623 (("git = \"https://github.com/meilisearch/bbqueue\"")
624 "version = \"0.5.1\""))))
625 (add-after 'unpack 'make-offline-build-work
626 (lambda _
627 ;; avoid build.rs download assets
628 (substitute* "Cargo.toml"
629 ((" \"crates/benchmarks\",")
630 ""))
631 (with-directory-excursion "crates"
632 ;; enable mini-dashboard Will attempt to download assets
633 ;; at build time
634 (substitute* "meilisearch/Cargo.toml"
635 ((", \"mini-dashboard\"")
636 ""))
637 ;; TODO: enable japanese and korean, lindera-unidic and
638 ;; lindera-ko-dic try download assets
639 (substitute* (list "milli/Cargo.toml"
640 "meilisearch-types/Cargo.toml"
641 "meilisearch/Cargo.toml")
642 (("^(japanese|korean).*")
643 ""))
644 (substitute* "milli/Cargo.toml"
645 (("all-tokenizations = \\[\"charabia/default\"]")
646 "all-tokenizations = [\"charabia/chinese\",
647 \"charabia/hebrew\",
648 \"charabia/thai\",
649 \"charabia/greek\",
650 \"charabia/khmer\",
651 \"charabia/vietnamese\",
652 \"charabia/swedish-recomposition\",
653 \"charabia/turkish\",
654 \"charabia/german-segmentation\"]")))))
655 (add-after 'unpack 'default-disable-telemetry
656 (lambda _
657 (substitute* "crates/meilisearch/src/option.rs"
658 (("#\\[clap[(]long, env = MEILI_NO_ANALYTICS[)]]")
659 "#[clap(long, default_value_t= true, \
660env = MEILI_NO_ANALYTICS)]")))))))
661 (native-inputs (list pkg-config))
662 (inputs (cons* oniguruma
663 mimalloc
664 `(,zstd "lib")
665 (cargo-inputs 'meilisearch)))
666 (home-page "https://www.meilisearch.com")
667 (synopsis "Search engine API that into your apps, websites, and workflow")
668 (description
669 "Meilisearch helps you shape a delightful search experience in a snap,
670offering features that work out of the box to speed up your workflow.")
671 (license license:expat)))
672
673(define-public mlocate
674 (package
675 (name "mlocate")
676 (version "0.26")
677 (source (origin
678 (method url-fetch)
679 (uri (string-append "http://releases.pagure.org/mlocate/"
680 "mlocate-" version ".tar.xz"))
681 (sha256
682 (base32
683 "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh"))))
684 (build-system gnu-build-system)
685 (home-page "https://pagure.io/mlocate")
686 (synopsis "Locate files on the file system")
687 (description
688 "mlocate is a locate/updatedb implementation. The @code{m} stands for
689\"merging\": @code{updatedb} reuses the existing database to avoid rereading
690most of the file system, which makes it faster and does not trash the system
691caches as much. The locate(1) utility is intended to be completely compatible
692with slocate, and attempts to be compatible to GNU locate when it does not
693conflict with slocate compatibility.")
694 (license license:gpl2)))
695
696(define-public plocate
697 (package
698 (name "plocate")
699 (version "1.1.22")
700 (source
701 (origin
702 (method url-fetch)
703 (uri (string-append "https://plocate.sesse.net/download/"
704 "plocate-" version ".tar.gz"))
705 (sha256
706 (base32 "0j80zcklr7g73wsq54wbj8ggp8rj993hdzrywm2c0bmani0lfziv"))))
707 (build-system meson-build-system)
708 (arguments
709 `(#:configure-flags
710 (list
711 ;; Put the database in /var/cache/plocate.db
712 "--sharedstatedir=/var"
713 "-Dinstall_systemd=false"
714 "-Ddbpath=cache/plocate.db")
715 #:phases
716 (modify-phases %standard-phases
717 (add-after 'unpack 'remove-cachedirtag
718 (lambda _
719 (substitute* "meson.build"
720 ;; Remove the script adding a "cachedirtag"
721 (("meson.add_install_script") "#")))))))
722 (inputs
723 (list liburing
724 `(,zstd "lib")))
725 (native-inputs
726 (list pkg-config))
727 (home-page "https://plocate.sesse.net/")
728 (synopsis "Faster locate")
729 (description "Plocate is a @code{locate} based on posting lists,
730completely replacing @command{mlocate} with a faster and smaller index. It is
731suitable as a default locate on your system.")
732 (license license:gpl2)))
733
734(define-public swish-e
735 (package
736 (name "swish-e")
737 (version "2.4.7")
738 (source (origin
739 (method url-fetch)
740 (uri (list (string-append
741 "https://web.archive.org/web/20160730145202/"
742 "http://swish-e.org/distribution/"
743 "swish-e-" version ".tar.gz")
744 (string-append "http://deb.debian.org/debian/pool/"
745 "main/s/swish-e/swish-e_" version
746 ".orig.tar.gz")))
747 (file-name (string-append name "-" version ".tar.gz"))
748 (sha256
749 (base32
750 "0qkrk7z25yp9hynj21vxkyn7yi8gcagcfxnass5cgczcz0gm9pax"))
751 (patches (search-patches "swish-e-search.patch"
752 "swish-e-format-security.patch"))))
753 (build-system gnu-build-system)
754 ;; Several other packages and perl modules may be installed alongside
755 ;; swish-e to extend its features at runtime, but are not required for
756 ;; building: xpdf, catdoc, MP3::Tag, Spreadsheet::ParseExcel,
757 ;; HTML::Entities.
758 (inputs
759 (list bash-minimal perl perl-uri perl-html-parser perl-html-tagset
760 perl-mime-types))
761 (arguments
762 `(;; XXX: This fails to build with zlib (API mismatch) and tests fail
763 ;; with libxml2, so disable both.
764 #:configure-flags (list (string-append "--without-zlib")
765 (string-append "--without-libxml2"))
766 #:phases (modify-phases %standard-phases
767 (add-after 'install 'wrap-programs
768 (lambda* (#:key inputs outputs #:allow-other-keys)
769 (let* ((out (assoc-ref outputs "out")))
770 (for-each
771 (lambda (program)
772 (wrap-program program
773 `("PERL5LIB" ":" prefix
774 ,(map (lambda (i)
775 (string-append (assoc-ref inputs i)
776 "/lib/perl5/site_perl"))
777 ;; These perl modules have no propagated
778 ;; inputs, so no further analysis needed.
779 '("perl-uri"
780 "perl-html-parser"
781 "perl-html-tagset"
782 "perl-mime-types")))))
783 (list (string-append out "/lib/swish-e/swishspider")
784 (string-append out "/bin/swish-filter-test")))
785 #t))))))
786 (home-page (string-append "https://web.archive.org/web/20160730145202/"
787 "http://swish-e.org"))
788 (synopsis "Web indexing system")
789 (description
790 "Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e
791can quickly and easily index directories of files or remote web sites and
792search the generated indexes.")
793 (license license:gpl2+))) ; with exception
794
795(define-public xapers
796 (package
797 (name "xapers")
798 (version "0.8.2")
799 (source
800 (origin
801 (method url-fetch)
802 (uri (string-append "https://finestructure.net/xapers/releases/xapers-"
803 version ".tar.gz"))
804 (sha256
805 (base32 "0ykz6hn3qj46w3c99d6q0pi5ncq2894simcl7vapv047zm3cylmd"))))
806 (build-system pyproject-build-system)
807 (arguments
808 (list
809 #:tests? #f ; A lot of tests are failing, unclear why.
810 #:modules `((ice-9 rdelim)
811 (guix build pyproject-build-system)
812 (guix build utils))
813 #:phases
814 #~(modify-phases %standard-phases
815 (add-after 'install 'install-doc
816 (lambda* (#:key inputs outputs #:allow-other-keys)
817 (define (purge-term-support input output)
818 (let loop
819 ((line (read-line input)))
820 (if (string-prefix? "if [[ \"$term\"" line)
821 (display "eval \"$cmd\"\n" output)
822 (begin
823 (display (string-append line "\n") output)
824 (loop (read-line input))))))
825 (let* ((bin (string-append #$output "/bin"))
826 (adder-out (string-append bin "/xapers-adder"))
827 (man1 (string-append #$output "/share/man/man1")))
828 (install-file "man/man1/xapers.1" man1)
829 (install-file "man/man1/xapers-adder.1" man1)
830 ;; below is equivalent to setting --no-term option
831 ;; permanently on; this is desirable to avoid imposing
832 ;; an x-terminal installation on the user but breaks
833 ;; some potential xapers-adder uses like auto browser
834 ;; pdf handler, but user could instead still use
835 ;; e.g. "xterm -e xapers-adder %F" for same use.
836 ;; alternatively we could propagate xterm as an input
837 ;; and replace 'x-terminal-emulator' with 'xterm'
838 (mkdir-p (dirname adder-out))
839 (call-with-input-file "bin/xapers-adder"
840 (lambda (input)
841 (call-with-output-file adder-out
842 (lambda (output)
843 (purge-term-support input output)))))
844 (chmod adder-out #o555))))
845 (replace 'check
846 (lambda* (#:key tests? #:allow-other-keys)
847 (if tests?
848 (with-directory-excursion "test"
849 (setenv "HOME" (getcwd))
850 (invoke "bash" "all"))
851 (format #t "test suite not run~%")))))))
852 (native-inputs (list python-setuptools))
853 (propagated-inputs (list poppler python-urwid xclip xdg-utils))
854 (inputs (list python-latexcodec
855 python-pybtex
856 python-pycurl
857 python-pyyaml
858 python-six
859 python-xapian-bindings))
860 (home-page "https://finestructure.net/xapers/")
861 (synopsis "Personal document indexing system")
862 (description
863 "Xapers is a personal document indexing system, geared towards academic
864journal articles build on the Xapian search engine. Think of it as your own
865personal document search engine, or a local cache of online libraries. It
866provides fast search of document text and bibliographic data and simple
867document and bibtex retrieval.")
868 (license license:gpl3+)))
869
870(define-public ugrep
871 (package
872 (name "ugrep")
873 (version "7.8.5")
874 (source (origin
875 (method git-fetch)
876 (uri (git-reference
877 (url "https://github.com/Genivia/ugrep")
878 (commit (string-append "v" version))))
879 (sha256
880 (base32 "0qgmakg4p2v1z8ak3n38h2gsxs8ndcykrpsi55mrkqh8byr55d98"))
881 (file-name (git-file-name name version))
882 (modules '((guix build utils)))
883 (snippet
884 #~(begin
885 (delete-file-recursively "bin/win32") ; pre-built
886 (delete-file-recursively "bin/win64") ; pre-built
887 (for-each (lambda (regexp)
888 (for-each delete-file
889 (find-files "tests" regexp)))
890 '("^archive" "\\.pdf$" "\\.class$"))))))
891 (build-system gnu-build-system)
892 (inputs
893 (list bzip2
894 less
895 lz4
896 lzip ;; lzma
897 pcre2
898 zlib
899 brotli
900 `(,zstd "lib")))
901 (arguments
902 (list
903 #:tests? #f ; no way to rebuild the binary input files
904 #:test-target "test"
905 #:phases
906 #~(modify-phases %standard-phases
907 (add-before 'check 'check-setup
908 (lambda _
909 ;; Unpatch shebangs in tests.
910 (substitute* '("tests/Hello.bat"
911 "tests/Hello.sh")
912 (("#!/gnu/store/.*/bin/sh") "#!/bin/sh")))))))
913 (home-page "https://github.com/Genivia/ugrep/")
914 (synopsis "Faster grep with an interactive query UI")
915 (description "Ugrep is a ultra fast searcher of file systems, text
916and binary files, source code, archives, compressed files, documents, and
917more.
918
919While still being compatible with the standard GNU/BSD grep command-line
920options, ugrep supports fuzzy search as well as structured and (adjustable)
921colored output, piped through \"less\" for pagination. An interactive query
922UI allows refinement and has a built-in help (press F1). Ugrep implements
923multi-threaded and other techniques to speed up search, pattern-matching and
924decompression. Many pre-defined regexps ease searching e.g. C typdefs or XML
925attributes. Results can be output in several structured or self-defined
926formats.")
927 (license license:bsd-3)))
928
929;;; search.scm ends here