1{ lib, stdenv, fetchFromGitHub, postgresql }:
2
3stdenv.mkDerivation rec {
4 pname = "pg_ivm";
5 version = "1.7";
6
7 src = fetchFromGitHub {
8 owner = "sraoss";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-uSYhNUfd4mw7mGGAcP43X/0v/bNp6SdZjPzktGONgaQ=";
12 };
13
14 buildInputs = [ postgresql ];
15
16 installPhase = ''
17 install -D -t $out/lib pg_ivm${postgresql.dlSuffix}
18 install -D -t $out/share/postgresql/extension *.sql
19 install -D -t $out/share/postgresql/extension *.control
20 '';
21
22 meta = with lib; {
23 description = "Materialized views with IVM (Incremental View Maintenance) for PostgreSQL";
24 homepage = "https://github.com/sraoss/pg_ivm";
25 changelog = "https://github.com/sraoss/pg_ivm/releases/tag/v${version}";
26 maintainers = with maintainers; [ ivan ];
27 platforms = postgresql.meta.platforms;
28 license = licenses.postgresql;
29 broken = versionOlder postgresql.version "13";
30 };
31}