nixpkgs/pkgs/servers/sql/postgresql/ext/plr.nix
Wolfgang Walther 68254e438c
postgresqlPackages: enable update scripts by default
This enables update scripts via buildPostgresqlExtension. Extensions
must actively opt-out, if they don't support either the default
configuration or the unstable configuration.

To make the update script work, some extensions had to be changed to
pull their code from GitHub instead. Those with PostgreSQL-style version
tags (REL_X_Y) had to be changed to make src.rev the source of truth.
2024-11-16 13:09:35 +01:00

28 lines
850 B
Nix

{ lib, stdenv, fetchFromGitHub, pkg-config, R, postgresql, buildPostgresqlExtension }:
buildPostgresqlExtension rec {
pname = "plr";
version = "${builtins.replaceStrings ["_"] ["."] (lib.strings.removePrefix "REL" src.rev)}";
src = fetchFromGitHub {
owner = "postgres-plr";
repo = "plr";
rev = "REL8_4_7";
sha256 = "sha256-PdvFEmtKfLT/xfaf6obomPR5hKC9F+wqpfi1heBphRk=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ R ];
makeFlags = [ "USE_PGXS=1" ];
meta = with lib; {
description = "PL/R - R Procedural Language for PostgreSQL";
homepage = "https://github.com/postgres-plr/plr";
changelog = "https://github.com/postgres-plr/plr/blob/${src.rev}/changelog.md";
maintainers = with maintainers; [ qoelet ];
platforms = postgresql.meta.platforms;
license = licenses.gpl2Only;
};
}