diff options
author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2023-10-27 19:53:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-27 19:53:14 +0200 |
commit | fb1c60b65aef254270c7670b5b9c720028ffd631 (patch) | |
tree | 444f0a885708782bf2ba8194393efa331c65d6fd /pkgs/servers/sql | |
parent | 60b8ef20cc08420ce9710cdd97f337ccd9359593 (diff) | |
parent | 47646a34bae848c4a6869c41ff544be6c4cdb7a4 (diff) |
Merge pull request #262224 from chayleaf/tsja
postgresqlPackages.tsja: init at 0.5.0
Diffstat (limited to 'pkgs/servers/sql')
-rw-r--r-- | pkgs/servers/sql/postgresql/ext/tsja.nix | 45 | ||||
-rw-r--r-- | pkgs/servers/sql/postgresql/packages.nix | 2 |
2 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/servers/sql/postgresql/ext/tsja.nix b/pkgs/servers/sql/postgresql/ext/tsja.nix new file mode 100644 index 0000000000000..f62eae5b6a3e2 --- /dev/null +++ b/pkgs/servers/sql/postgresql/ext/tsja.nix @@ -0,0 +1,45 @@ +{ lib +, fetchzip +, nixosTests +, stdenv + +, mecab +, postgresql +}: + +stdenv.mkDerivation rec { + pname = "tsja"; + version = "0.5.0"; + + src = fetchzip { + url = "https://www.amris.jp/tsja/tsja-${version}.tar.xz"; + hash = "sha256-h59UhUG/7biN8NaDiGK6kXDqfhR9uMzt8CpwbJ+PpEM="; + }; + + postPatch = '' + substituteInPlace Makefile \ + --replace /usr/local/pgsql ${postgresql} \ + --replace -L/usr/local/lib "" \ + --replace -I/usr/local/include "" + substituteInPlace tsja.c --replace /usr/local/lib/mecab ${mecab}/lib/mecab + ''; + + buildInputs = [ mecab postgresql ]; + + installPhase = '' + mkdir -p $out/lib $out/share/postgresql/extension + mv libtsja.so $out/lib + mv dbinit_libtsja.txt $out/share/postgresql/extension/libtsja_dbinit.sql + ''; + + passthru.tests.tsja = nixosTests.tsja; + + meta = with lib; { + description = "PostgreSQL extension implementing Japanese text search"; + homepage = "https://www.amris.jp/tsja/index.html"; + maintainers = with maintainers; [ chayleaf ]; + # GNU-specific linker options are used + platforms = platforms.gnu; + license = licenses.gpl2Only; + }; +} diff --git a/pkgs/servers/sql/postgresql/packages.nix b/pkgs/servers/sql/postgresql/packages.nix index 69309d0c4824e..d9d9ce8b09d98 100644 --- a/pkgs/servers/sql/postgresql/packages.nix +++ b/pkgs/servers/sql/postgresql/packages.nix @@ -87,5 +87,7 @@ self: super: { rum = super.callPackage ./ext/rum.nix { }; + tsja = super.callPackage ./ext/tsja.nix { }; + wal2json = super.callPackage ./ext/wal2json.nix { }; } |