1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/os-specific/linux/dstat/default.nix
Daniel Nagy 993c9fad7b
dstat: 0.7.3 -> 0.7.4
This change also switches dstat to python3. The patches introduced in this
commit are inspired by archlinux[0][1].

[0]:
e688b126c5/trunk/PKGBUILD
[1]: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/dstat&id=e688b126c561e842b459ea1cc88e725f1f2a29cc
2021-01-18 10:50:46 +01:00

42 lines
1.2 KiB
Nix

{ lib, fetchFromGitHub, fetchpatch, python3Packages }:
python3Packages.buildPythonApplication rec {
pname = "dstat";
format = "other";
version = "0.7.4";
src = fetchFromGitHub {
owner = "dstat-real";
repo = "dstat";
rev = "v${version}";
sha256 = "1qnmkhqmjd1m3if05jj29dvr5hn6kayq9bkkkh881w472c0zhp8v";
};
propagatedBuildInputs = with python3Packages; [ six ];
patches = [
./fix_pluginpath.patch
# this fixes another bug with python3
(fetchpatch {
url = https://github.com/efexgee/dstat/commit/220a785321b13b6df92a536080aca6ef1cb644ad.patch ;
sha256 = "08kcz3yxvl35m55y7g1pr73x3bjcqnv0qlswxqyq8cqxg9zd64cn";
})
];
makeFlags = [ "prefix=$(out)" ];
# remove deprecation warnings
preFixup = ''
sed -i "s/import collections/import collections.abc/g" $out/share/dstat/dstat.py $out/bin/dstat
sed -i "s/collections.Sequence/collections.abc.Sequence/g" "$out"/bin/dstat
'';
meta = with lib; {
homepage = "http://dag.wieers.com/home-made/dstat/";
description = "Versatile resource statistics tool";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
};
}