depot/pkgs/servers/sql/postgresql/ext/pg_safeupdate.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

55 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, postgresql }:
with {
"12" = {
version = "1.4";
sha256 = "sha256-1cyvVEC9MQGMr7Tg6EUbsVBrMc8ahdFS3+CmDkmAq4Y=";
};
"13" = {
version = "1.4";
sha256 = "sha256-1cyvVEC9MQGMr7Tg6EUbsVBrMc8ahdFS3+CmDkmAq4Y=";
};
"14" = {
version = "1.5";
sha256 = "sha256-RRSpkWLFuif+6RCncnsb1NnjKnIIRY9KgebKkjCN5cs=";
};
"15" = {
version = "1.5";
sha256 = "sha256-RRSpkWLFuif+6RCncnsb1NnjKnIIRY9KgebKkjCN5cs=";
};
"16" = {
version = "1.5";
sha256 = "sha256-RRSpkWLFuif+6RCncnsb1NnjKnIIRY9KgebKkjCN5cs=";
};
"17" = {
version = "1.5";
sha256 = "sha256-RRSpkWLFuif+6RCncnsb1NnjKnIIRY9KgebKkjCN5cs=";
};
}."${lib.versions.major postgresql.version}" or (throw "pg_safeupdate: version specification for pg ${postgresql.version} missing.");
stdenv.mkDerivation rec {
pname = "pg-safeupdate";
inherit version;
buildInputs = [ postgresql ];
src = fetchFromGitHub {
owner = "eradman";
repo = pname;
rev = version;
inherit sha256;
};
installPhase = ''
install -D safeupdate${postgresql.dlSuffix} -t $out/lib
'';
meta = with lib; {
description = "Simple extension to PostgreSQL that requires criteria for UPDATE and DELETE";
homepage = "https://github.com/eradman/pg-safeupdate";
changelog = "https://github.com/eradman/pg-safeupdate/raw/${src.rev}/NEWS";
platforms = postgresql.meta.platforms;
maintainers = with maintainers; [ wolfgangwalther ];
license = licenses.postgresql;
};
}