summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/pg/pgmanage/package.nix
blob: c48640fbde7cb82139b50b23a75bccbe59e1befc (plain)
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
53
54
55
{
  lib,
  stdenv,
  fetchFromGitHub,
  libpq,
  openssl,
  nixosTests,
}:
stdenv.mkDerivation {
  pname = "pgmanage";
  # The last release 11.0.1 from 2018 fails the NixOS test
  # probably because of PostgreSQL-12 incompatibility.
  # Fortunately the latest master does succeed the test.
  version = "unstable-2022-05-11";

  src = fetchFromGitHub {
    owner = "pgManage";
    repo = "pgManage";
    rev = "a028604416be382d6d310bc68b4e7c3cd16020fb";
    sha256 = "sha256-ibCzZrqfbio1wBVFKB6S/wdRxnCc7s3IQdtI9txxhaM=";
  };

  patchPhase = ''
    patchShebangs src/configure
  '';

  configurePhase = ''
    ./configure --prefix $out
  '';

  buildInputs = [
    libpq
    openssl
  ];

  nativeBuildInputs = [
    libpq.pg_config
  ];

  passthru.tests.sign-in = nixosTests.pgmanage;

  meta = {
    description = "Fast replacement for PGAdmin";
    longDescription = ''
      At the heart of pgManage is a modern, fast, event-based C-binary, built in
      the style of NGINX and Node.js. This heart makes pgManage as fast as any
      PostgreSQL interface can hope to be. (Note: pgManage replaces Postage,
      which is no longer maintained.)
    '';
    homepage = "https://github.com/pgManage/pgManage";
    license = lib.licenses.postgresql;
    maintainers = [ lib.maintainers.basvandijk ];
    mainProgram = "pgmanage";
  };
}