nixpkgs/pkgs/by-name/ds/dstat/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
1.3 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";
mainProgram = "dstat";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ ];
changelog = "https://github.com/dstat-real/dstat/blob/v${version}/ChangeLog";
};
}