depot/pkgs/servers/sql/postgresql/ext/wal2json.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

44 lines
1.1 KiB
Nix

{
lib,
stdenv,
callPackage,
fetchFromGitHub,
postgresql,
}:
stdenv.mkDerivation rec {
pname = "wal2json";
version = "2.6";
src = fetchFromGitHub {
owner = "eulerto";
repo = "wal2json";
rev = "wal2json_${builtins.replaceStrings [ "." ] [ "_" ] version}";
sha256 = "sha256-+QoACPCKiFfuT2lJfSUmgfzC5MXf75KpSoc2PzPxKyM=";
};
buildInputs = [ postgresql ];
makeFlags = [ "USE_PGXS=1" ];
installPhase = ''
install -D -t $out/lib *${postgresql.dlSuffix}
install -D -t $out/share/postgresql/extension sql/*.sql
'';
passthru.tests.wal2json = lib.recurseIntoAttrs (
callPackage ../../../../../nixos/tests/postgresql-wal2json.nix {
inherit (stdenv) system;
inherit postgresql;
}
);
meta = with lib; {
description = "PostgreSQL JSON output plugin for changeset extraction";
homepage = "https://github.com/eulerto/wal2json";
changelog = "https://github.com/eulerto/wal2json/releases/tag/wal2json_${version}";
maintainers = with maintainers; [ euank ];
platforms = postgresql.meta.platforms;
license = licenses.bsd3;
};
}