about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/search/groonga/default.nix
blob: 07f86a9ae8083a08ff6545ed5fff7bb0825e4f85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ lib, stdenv, cmake, fetchurl, kytea, msgpack-c, mecab, pkg-config, rapidjson, testers, xxHash, zstd, postgresqlPackages
, suggestSupport ? false, zeromq, libevent, openssl
, lz4Support  ? false, lz4
, zlibSupport ? true, zlib
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "groonga";
  version = "13.1.1";

  src = fetchurl {
    url = "https://packages.groonga.org/source/groonga/groonga-${finalAttrs.version}.tar.gz";
    hash = "sha256-eggMegWTpv+WIbzYq2GjSD66+Tj7zcvVUcbD2EkrFO8=";
  };

  patches = [
    ./fix-cmake-install-path.patch
    ./do-not-use-vendored-libraries.patch
  ];

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    rapidjson
    xxHash
    zstd
    mecab
    kytea
    msgpack-c
  ] ++ lib.optionals lz4Support [
    lz4
  ] ++ lib.optional zlibSupport [
    zlib
  ] ++ lib.optionals suggestSupport [
    zeromq
    libevent
  ];

  env.NIX_CFLAGS_COMPILE = lib.optionalString zlibSupport "-I${zlib.dev}/include";

  passthru.tests = {
    inherit (postgresqlPackages) pgroonga;
    version = testers.testVersion {
      package = finalAttrs.finalPackage;
    };
    pkg-config = testers.hasPkgConfigModules {
      package = finalAttrs.finalPackage;
      moduleNames = [ "groonga" ];
    };
  };

  meta = with lib; {
    homepage = "https://groonga.org/";
    description = "An open-source fulltext search engine and column store";
    license = licenses.lgpl21;
    maintainers = [ maintainers.ericsagnes ];
    platforms = platforms.all;
    longDescription = ''
      Groonga is an open-source fulltext search engine and column store.
      It lets you write high-performance applications that requires fulltext search.
    '';
  };
})