summary refs log tree commit diff
path: root/pkgs/development/tools/pgtop/default.nix
blob: 03b3ef89265bb24ba54fe48f6bfcc21152737cb2 (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
{ lib, stdenv, perlPackages, fetchFromGitHub, shortenPerlShebang }:

perlPackages.buildPerlPackage rec {
  pname = "pgtop";
  version = "0.11";

  src = fetchFromGitHub {
    owner = "cosimo";
    repo = "pgtop";
    rev = "v${version}";
    sha256 = "1awyl6ddfihm7dfr5y2z15r1si5cyipnlyyj3m1l19pk98s4x66l";
  };

  outputs = [ "out" ];

  buildInputs = with perlPackages; [ DBI DBDPg TermReadKey JSON LWPUserAgent ];

  nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
  postInstall = lib.optionalString stdenv.isDarwin ''
    shortenPerlShebang $out/bin/pgtop
  '';

  meta = with lib; {
    description = "a PostgreSQL clone of `mytop', which in turn is a `top' clone for MySQL";
    homepage = "https://github.com/cosimo/pgtop";
    changelog = "https://github.com/cosimo/pgtop/releases/tag/v${version}";
    maintainers = [ maintainers.hagl ];
    license = [ licenses.gpl2Only ];
  };
}