2025-06-06 21:58:04 +02:00

44 lines
985 B
Nix

{
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
LWP
];
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
shortenPerlShebang $out/bin/pgtop
'';
meta = {
description = "PostgreSQL clone of `mytop', which in turn is a `top' clone for MySQL";
mainProgram = "pgtop";
homepage = "https://github.com/cosimo/pgtop";
changelog = "https://github.com/cosimo/pgtop/releases/tag/v${version}";
maintainers = [ lib.maintainers.hagl ];
license = [ lib.licenses.gpl2Only ];
};
}