Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, fetchFromGitHub, fetchpatch, python3Packages }: 2 3python3Packages.buildPythonApplication rec { 4 pname = "dstat"; 5 format = "other"; 6 version = "0.7.4"; 7 8 src = fetchFromGitHub { 9 owner = "dstat-real"; 10 repo = "dstat"; 11 rev = "v${version}"; 12 sha256 = "1qnmkhqmjd1m3if05jj29dvr5hn6kayq9bkkkh881w472c0zhp8v"; 13 }; 14 15 propagatedBuildInputs = with python3Packages; [ six ]; 16 17 patches = [ 18 ./fix_pluginpath.patch 19 # this fixes another bug with python3 20 (fetchpatch { 21 url = "https://github.com/efexgee/dstat/commit/220a785321b13b6df92a536080aca6ef1cb644ad.patch"; 22 sha256 = "08kcz3yxvl35m55y7g1pr73x3bjcqnv0qlswxqyq8cqxg9zd64cn"; 23 }) 24 ]; 25 26 makeFlags = [ "prefix=$(out)" ]; 27 28 # remove deprecation warnings 29 preFixup = '' 30 sed -i "s/import collections/import collections.abc/g" $out/share/dstat/dstat.py $out/bin/dstat 31 sed -i "s/collections.Sequence/collections.abc.Sequence/g" "$out"/bin/dstat 32 ''; 33 34 meta = with lib; { 35 homepage = "http://dag.wieers.com/home-made/dstat/"; 36 description = "Versatile resource statistics tool"; 37 license = licenses.gpl2; 38 platforms = platforms.linux; 39 maintainers = with maintainers; [ ]; 40 changelog = "https://github.com/dstat-real/dstat/blob/v${version}/ChangeLog"; 41 }; 42}