diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix new file mode 100644 index 00000000000..9a8ff192dea --- /dev/null +++ b/pkgs/development/python-modules/psutil/default.nix @@ -0,0 +1,28 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, darwin +, mock +}: + +buildPythonPackage rec { + pname = "psutil"; + version = "4.3.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "1w4r09fvn6kd80m5mx4ws1wz100brkaq6hzzpwrns8cgjzjpl6c6"; + }; + + # No tests in archive + doCheck = false; + + buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.IOKit ]; + + meta = { + description = "Process and system utilization information interface for python"; + homepage = https://github.com/giampaolo/psutil; + license = stdenv.lib.licenses.bsd3; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2d640b9af60..573204ca8ec 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14878,31 +14878,13 @@ in { psd-tools = callPackage ../development/python-modules/psd-tools { }; - psutil = buildPythonPackage rec { - name = "psutil-${version}"; - version = "4.3.0"; + psutil = callPackage ../development/python-modules/psutil { }; - src = pkgs.fetchurl { - url = "mirror://pypi/p/psutil/${name}.tar.gz"; - sha256 = "1w4r09fvn6kd80m5mx4ws1wz100brkaq6hzzpwrns8cgjzjpl6c6"; - }; - - # Certain tests fail due to being in a chroot. - # See also the older issue: https://code.google.com/p/psutil/issues/detail?id=434 - doCheck = false; - - buildInputs = with self; [ mock ] ++ optionals stdenv.isDarwin [ pkgs.darwin.IOKit ]; - - meta = { - description = "Process and system utilization information interface for python"; - homepage = https://github.com/giampaolo/psutil; - }; - }; - - psutil_1 = self.psutil.overrideDerivation (self: rec { - name = "psutil-1.2.1"; - src = pkgs.fetchurl { - url = "mirror://pypi/p/psutil/${name}.tar.gz"; + psutil_1 = self.psutil.overrideAttrs (oldAttrs: rec { + name = "${oldAttrs.pname}-${version}"; + version = "1.2.1"; + src = oldAttrs.src.override { + inherit version; sha256 = "0ibclqy6a4qmkjhlk3g8jhpvnk0v9aywknc61xm3hfi5r124m3jh"; }; });