1{
2 lib,
3 stdenv,
4 perlPackages,
5 fetchFromGitHub,
6 shortenPerlShebang,
7}:
8
9perlPackages.buildPerlPackage rec {
10 pname = "pgtop";
11 version = "0.11";
12
13 src = fetchFromGitHub {
14 owner = "cosimo";
15 repo = "pgtop";
16 rev = "v${version}";
17 sha256 = "1awyl6ddfihm7dfr5y2z15r1si5cyipnlyyj3m1l19pk98s4x66l";
18 };
19
20 outputs = [ "out" ];
21
22 buildInputs = with perlPackages; [
23 DBI
24 DBDPg
25 TermReadKey
26 JSON
27 LWP
28 ];
29
30 nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;
31 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
32 shortenPerlShebang $out/bin/pgtop
33 '';
34
35 meta = {
36 description = "PostgreSQL clone of `mytop', which in turn is a `top' clone for MySQL";
37 mainProgram = "pgtop";
38 homepage = "https://github.com/cosimo/pgtop";
39 changelog = "https://github.com/cosimo/pgtop/releases/tag/v${version}";
40 maintainers = [ lib.maintainers.hagl ];
41 license = [ lib.licenses.gpl2Only ];
42 };
43}