1{
2 lib,
3 stdenv,
4 cmake,
5 fetchurl,
6 kytea,
7 msgpack-c,
8 mecab,
9 pkg-config,
10 rapidjson,
11 testers,
12 xxHash,
13 zstd,
14 postgresqlPackages,
15 suggestSupport ? false,
16 zeromq,
17 libevent,
18 lz4Support ? false,
19 lz4,
20 zlibSupport ? true,
21 zlib,
22}:
23
24stdenv.mkDerivation (finalAttrs: {
25 pname = "groonga";
26 version = "15.1.3";
27
28 src = fetchurl {
29 url = "https://packages.groonga.org/source/groonga/groonga-${finalAttrs.version}.tar.gz";
30 hash = "sha256-L8UHjYBQf9iADvIs7QNZA/81FmVY/+gCwS73ff62dYc=";
31 };
32
33 patches = [
34 ./fix-cmake-install-path.patch
35 ./do-not-use-vendored-libraries.patch
36 ];
37
38 nativeBuildInputs = [
39 cmake
40 pkg-config
41 ];
42
43 buildInputs = [
44 rapidjson
45 xxHash
46 zstd
47 mecab
48 kytea
49 msgpack-c
50 ]
51 ++ lib.optionals lz4Support [
52 lz4
53 ]
54 ++ lib.optional zlibSupport [
55 zlib
56 ]
57 ++ lib.optionals suggestSupport [
58 zeromq
59 libevent
60 ];
61
62 env.NIX_CFLAGS_COMPILE = lib.optionalString zlibSupport "-I${zlib.dev}/include";
63
64 passthru.tests = {
65 inherit (postgresqlPackages) pgroonga;
66 version = testers.testVersion {
67 package = finalAttrs.finalPackage;
68 };
69 pkg-config = testers.hasPkgConfigModules {
70 package = finalAttrs.finalPackage;
71 moduleNames = [ "groonga" ];
72 };
73 };
74
75 meta = {
76 homepage = "https://groonga.org/";
77 description = "Open-source fulltext search engine and column store";
78 license = lib.licenses.lgpl21;
79 maintainers = [ ];
80 platforms = lib.platforms.all;
81 longDescription = ''
82 Groonga is an open-source fulltext search engine and column store.
83 It lets you write high-performance applications that requires fulltext search.
84 '';
85 };
86})