2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, fetchpatch, python3Packages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "dstat";
|
|
|
|
format = "other";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "0.7.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dstat-real";
|
|
|
|
repo = "dstat";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1qnmkhqmjd1m3if05jj29dvr5hn6kayq9bkkkh881w472c0zhp8v";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [ six ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
patches = [
|
|
|
|
./fix_pluginpath.patch
|
|
|
|
# this fixes another bug with python3
|
|
|
|
(fetchpatch {
|
|
|
|
url = https://github.com/efexgee/dstat/commit/220a785321b13b6df92a536080aca6ef1cb644ad.patch ;
|
|
|
|
sha256 = "08kcz3yxvl35m55y7g1pr73x3bjcqnv0qlswxqyq8cqxg9zd64cn";
|
|
|
|
})
|
|
|
|
];
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [ "prefix=$(out)" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://dag.wieers.com/home-made/dstat/";
|
|
|
|
description = "Versatile resource statistics tool";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ ];
|
2021-04-05 15:23:46 +00:00
|
|
|
changelog = "https://github.com/dstat-real/dstat/blob/v${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|