depot/third_party/nixpkgs/pkgs/servers/sql/postgresql/ext/rum.nix
Default email ae2dc6aea6 Project import generated by Copybara.
GitOrigin-RevId: 4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0
2024-10-11 07:15:48 +02:00

65 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
postgresql,
postgresqlTestHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rum";
version = "1.3.14";
src = fetchFromGitHub {
owner = "postgrespro";
repo = "rum";
rev = finalAttrs.version;
hash = "sha256-VsfpxQqRBu9bIAP+TfMRXd+B3hSjuhU2NsutocNiCt8=";
};
buildInputs = [ postgresql ];
makeFlags = [ "USE_PGXS=1" ];
installPhase = ''
install -D -t $out/lib *${postgresql.dlSuffix}
install -D -t $out/share/postgresql/extension *.control
install -D -t $out/share/postgresql/extension *.sql
'';
passthru.tests.extension = stdenv.mkDerivation {
inherit (finalAttrs) version;
pname = "rum-test";
dontUnpack = true;
doCheck = true;
nativeCheckInputs = [
postgresqlTestHook
(postgresql.withPackages (_: [ finalAttrs.finalPackage ]))
];
failureHook = "postgresqlStop";
postgresqlTestUserOptions = "LOGIN SUPERUSER";
passAsFile = [ "sql" ];
sql = ''
CREATE EXTENSION rum;
CREATE TABLE test_table (t text, v tsvector);
CREATE INDEX test_table_rumindex ON test_table USING rum (v rum_tsvector_ops);
'';
checkPhase = ''
runHook preCheck
psql -a -v ON_ERROR_STOP=1 -f $sqlPath
runHook postCheck
'';
installPhase = "touch $out";
};
meta = with lib; {
description = "Full text search index method for PostgreSQL";
homepage = "https://github.com/postgrespro/rum";
license = licenses.postgresql;
platforms = postgresql.meta.platforms;
maintainers = with maintainers; [ DeeUnderscore ];
};
})