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