1{ lib, stdenv, fetchFromGitHub, postgresql, protobufc }:
2
3stdenv.mkDerivation rec {
4 pname = "cstore_fdw";
5 version = "unstable-2022-03-08";
6
7 nativeBuildInputs = [ protobufc ];
8 buildInputs = [ postgresql ];
9
10 src = fetchFromGitHub {
11 owner = "citusdata";
12 repo = "cstore_fdw";
13 rev = "90e22b62fbee6852529104fdd463f532cf7a3311";
14 sha256 = "sha256-02wcCqs8A5ZOZX080fgcNJTQrYQctnlwnA8+YPaRTZc=";
15 };
16
17 installPhase = ''
18 mkdir -p $out/{lib,share/postgresql/extension}
19
20 cp *.so $out/lib
21 cp *.sql $out/share/postgresql/extension
22 cp *.control $out/share/postgresql/extension
23 '';
24
25 meta = with lib; {
26 broken = versionAtLeast postgresql.version "14";
27 description = "Columnar storage for PostgreSQL";
28 homepage = "https://github.com/citusdata/cstore_fdw";
29 maintainers = with maintainers; [ thoughtpolice ];
30 platforms = postgresql.meta.platforms;
31 license = licenses.asl20;
32 };
33}