about summary refs log tree commit diff
path: root/pkgs/servers/sql/postgresql/ext/citus.nix
blob: 211216d86672cf77e83412c723d32ca12edaa543 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ lib
, stdenv
, curl
, fetchFromGitHub
, lz4
, postgresql
}:

stdenv.mkDerivation rec {
  pname = "citus";
  version = "12.1.2";

  src = fetchFromGitHub {
    owner = "citusdata";
    repo = "citus";
    rev = "v${version}";
    hash = "sha256-0uYNMLAYigtGlDRvOEkQeC5i58QfXcdSVjTQwWVFX+8=";
  };

  buildInputs = [
    curl
    lz4
    postgresql
  ];

  installPhase = ''
    runHook preInstall

    install -D -t $out/lib src/backend/columnar/citus_columnar${postgresql.dlSuffix}
    install -D -t $out/share/postgresql/extension src/backend/columnar/build/sql/*.sql
    install -D -t $out/share/postgresql/extension src/backend/columnar/*.control

    install -D -t $out/lib src/backend/distributed/citus${postgresql.dlSuffix}
    install -D -t $out/share/postgresql/extension src/backend/distributed/build/sql/*.sql
    install -D -t $out/share/postgresql/extension src/backend/distributed/*.control

    runHook postInstall
  '';

  meta = with lib; {
    # "Our soft policy for Postgres version compatibility is to support Citus'
    # latest release with Postgres' 3 latest releases."
    # https://www.citusdata.com/updates/v12-0/#deprecated_features
    broken = versionOlder postgresql.version "14";
    description = "Distributed PostgreSQL as an extension";
    homepage = "https://www.citusdata.com/";
    changelog = "https://github.com/citusdata/citus/blob/${src.rev}/CHANGELOG.md";
    license = licenses.agpl3Only;
    maintainers = with maintainers; [ ];
    inherit (postgresql.meta) platforms;
  };
}