Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / search.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
3 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages search)
21 #:use-module ((guix licenses)
22 #:select (gpl2+ gpl3+ bsd-3 x11))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages databases)
29 #:use-module (gnu packages linux))
30
31 (define-public xapian
32 (package
33 (name "xapian")
34 (version "1.2.21")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append "http://oligarchy.co.uk/xapian/" version
38 "/xapian-core-" version ".tar.xz"))
39 (sha256
40 (base32 "0grd2s6gf8yzqwdaa50g57j9d81mxkrrpkyldm2shgyizdc8gx33"))))
41 (build-system gnu-build-system)
42 (inputs `(("zlib" ,zlib)
43 ("util-linux" ,util-linux)))
44 (arguments
45 `(#:phases (alist-cons-after
46 'unpack 'patch-remotetcp-harness
47 (lambda _
48 (substitute* "tests/harness/backendmanager_remotetcp.cc"
49 (("/bin/sh") (which "bash"))))
50 %standard-phases)))
51 (synopsis "Search Engine Library")
52 (description
53 "Xapian is a highly adaptable toolkit which allows developers to easily
54 add advanced indexing and search facilities to their own applications. It
55 supports the Probabilistic Information Retrieval model and also supports a
56 rich set of boolean query operators.")
57 (home-page "http://xapian.org/")
58 (license (list gpl2+ bsd-3 x11))))
59
60 (define-public libtocc
61 (package
62 (name "libtocc")
63 (version "1.0.1")
64 (source
65 (origin
66 (method url-fetch)
67 (uri (string-append "https://github.com/aidin36/tocc/releases/download/"
68 "v" version "/tocc-" version ".tar.gz"))
69 (sha256
70 (base32
71 "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068"))))
72 (build-system gnu-build-system)
73 (native-inputs `(("catch" ,catch-framework)))
74 (inputs `(("unqlite" ,unqlite)))
75 (arguments
76 `(#:phases (modify-phases %standard-phases
77 (add-before
78 'configure 'chdir-source
79 (lambda _ (chdir "libtocc/src")))
80 (replace
81 'check
82 (lambda _
83 (with-directory-excursion "../tests"
84 (and (zero? (system* "./configure"
85 (string-append "CONFIG_SHELL="
86 (which "sh"))
87 (string-append "SHELL="
88 (which "sh"))
89 "CPPFLAGS=-I../src"
90 (string-append
91 "LDFLAGS=-L../src/.libs "
92 "-Wl,-rpath=../src/.libs")))
93 (zero? (system* "make"))
94 (zero? (system* "./libtocctests")))))))))
95 (home-page "http://t-o-c-c.com/")
96 (synopsis "Tool for Obsessive Compulsive Classifiers")
97 (description
98 "libtocc is the engine of the Tocc project, a tag-based file management
99 system. The goal of Tocc is to provide a better system for classifying files
100 that is more flexible than classic file systems that are based on a tree of
101 files and directories.")
102 (license gpl3+)))
103
104 (define-public tocc
105 (package
106 (name "tocc")
107 (version (package-version libtocc))
108 (source (package-source libtocc))
109 (build-system gnu-build-system)
110 (inputs
111 `(("libtocc" ,libtocc)
112 ("unqlite" ,unqlite)))
113 (arguments
114 `(#:tests? #f ;No tests
115 #:phases (modify-phases %standard-phases
116 (add-after
117 'unpack 'chdir-source
118 (lambda _ (chdir "cli/src"))))))
119 (home-page "http://t-o-c-c.com/")
120 (synopsis "Command-line interface to libtocc")
121 (description
122 "Tocc is a tag-based file management system. This package contains the
123 command line tool for interacting with libtocc.")
124 (license gpl3+)))
125
126 (define-public bool
127 (package
128 (name "bool")
129 (version "0.2.2")
130 (source
131 (origin
132 (method url-fetch)
133 (uri (string-append "mirror://gnu/bool/bool-"
134 version ".tar.xz"))
135 (sha256
136 (base32
137 "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw"))))
138 (build-system gnu-build-system)
139 (home-page "https://www.gnu.org/software/bool")
140 (synopsis "Finding text and HTML files that match boolean expressions")
141 (description
142 "GNU Bool is a utility to perform text searches on files using Boolean
143 expressions. For example, a search for \"hello AND world\" would return a
144 file containing the phrase \"Hello, world!\". It supports both AND and OR
145 statements, as well as the NEAR statement to search for the occurrence of
146 words in close proximity to each other. It handles context gracefully,
147 accounting for new lines and paragraph changes. It also has robust support
148 for parsing HTML files.")
149 (license gpl3+)))
150
151 ;;; search.scm ends here