2024-10-11 05:15:48 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
postgresql,
|
|
|
|
postgresqlTestHook,
|
|
|
|
}:
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "rum";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "1.3.14";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "postgrespro";
|
|
|
|
repo = "rum";
|
2024-10-11 05:15:48 +00:00
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-VsfpxQqRBu9bIAP+TfMRXd+B3hSjuhU2NsutocNiCt8=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
|
|
|
|
makeFlags = [ "USE_PGXS=1" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-10-19 13:55:26 +00:00
|
|
|
install -D -t $out/lib *${postgresql.dlSuffix}
|
2022-03-30 09:31:56 +00:00
|
|
|
install -D -t $out/share/postgresql/extension *.control
|
|
|
|
install -D -t $out/share/postgresql/extension *.sql
|
|
|
|
'';
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
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 ];
|
|
|
|
};
|
2024-10-11 05:15:48 +00:00
|
|
|
})
|