Skip to content

Commit 0d360c5

Browse files
committed
feat: supabase-groonga and mod pgroonga
1 parent dec38be commit 0d360c5

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

nix/ext/pgroonga.nix

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,25 @@ stdenv.mkDerivation rec {
1212
};
1313

1414
nativeBuildInputs = [ pkg-config ];
15+
1516
buildInputs = [ postgresql msgpack-c supabase-groonga mecab ];
1617

18+
runtimeDependencies = [ mecab ];
19+
1720
preConfigure = ''
1821
export MECAB_CONFIG=${mecab}/bin/mecab-config
1922
export MECAB_DICDIR=${mecab}/lib/mecab/dic/ipadic
2023
export GRN_PLUGINS_DIR=$out/lib/groonga/plugins
2124
export GROONGA_TOKENIZER_MECAB_DIR=${supabase-groonga}/lib/groonga/plugins/tokenizers
25+
export GROONGA_TOKENIZER_MECAB=$out/lib/groonga/plugins/tokenizer_mecab.so
2226
'';
2327

2428
configureFlags = [
2529
"--with-mecab=${mecab}"
2630
"--enable-tokenizer-mecab"
27-
"--with-groonga-tokenizer-mecab=$out/lib/groonga/plugins/tokenizer_mecab.so"
31+
"--with-groonga=${supabase-groonga}"
32+
"--with-groonga-token-mecab-dir=${supabase-groonga}/lib/groonga/plugins/tokenizers"
33+
"--with-groonga-tokenizer-mecab=${supabase-groonga}/lib/groonga/plugins/tokenizers/mecab.so"
2834
"--with-groonga-plugin-dir=${supabase-groonga}/lib/groonga/plugins"
2935
];
3036

@@ -43,10 +49,6 @@ stdenv.mkDerivation rec {
4349
install -D pgroonga_database.control -t $out/share/postgresql/extension
4450
install -D data/pgroonga_database-*.sql -t $out/share/postgresql/extension
4551
46-
mkdir -p $out/lib/groonga/plugins
47-
48-
# Create symbolic link for MeCab tokenizer
49-
cp ${supabase-groonga}/lib/groonga/plugins/tokenizers/mecab.so $out/lib/groonga/plugins/tokenizer_mecab.so
5052
'';
5153

5254
meta = with lib; {

nix/supabase-groonga.nix

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
4747
];
4848
preConfigure = ''
4949
export MECAB_DICDIR=${mecab}/lib/mecab/dic/ipadic
50-
echo "MeCab dictionary directory: $MECAB_DICDIR"
50+
echo "MeCab dictionary directory is: $MECAB_DICDIR"
5151
'';
5252
buildPhase = ''
5353
cmake --build . -- VERBOSE=1
@@ -68,23 +68,23 @@ stdenv.mkDerivation (finalAttrs: {
6868
6969
'';
7070
env.NIX_CFLAGS_COMPILE = lib.optionalString zlibSupport "-I${zlib.dev}/include";
71-
passthru = {
72-
tests = {
73-
inherit (postgresqlPackages) pgroonga;
74-
version = testers.testVersion {
75-
package = finalAttrs.finalPackage;
76-
};
77-
pkg-config = testers.hasPkgConfigModules {
78-
package = finalAttrs.finalPackage;
79-
moduleNames = [ "groonga" ];
80-
};
81-
};
82-
};
71+
# passthru = {
72+
# tests = {
73+
# inherit (postgresqlPackages) pgroonga;
74+
# version = testers.testVersion {
75+
# package = finalAttrs.finalPackage;
76+
# };
77+
# pkg-config = testers.hasPkgConfigModules {
78+
# package = finalAttrs.finalPackage;
79+
# moduleNames = [ "supabase-groonga" ];
80+
# };
81+
# };
82+
# };
8383
meta = with lib; {
8484
homepage = "https://groonga.org/";
8585
description = "Open-source fulltext search engine and column store";
8686
license = licenses.lgpl21;
87-
maintainers = [ maintainers.ericsagnes ];
87+
maintainers = [ maintainers.samrose ];
8888
platforms = platforms.all;
8989
longDescription = ''
9090
Groonga is an open-source fulltext search engine and column store.

0 commit comments

Comments
 (0)