49 lines
1,012 B
Nix
49 lines
1,012 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, smartmontools
|
|
, humanfriendly
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pysmart";
|
|
version = "1.2.3";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "truenas";
|
|
repo = "py-SMART";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-5VoZEgHWmHUDkm2KhBP0gfmhOJUYJUqDLWBp/kU1404=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pySMART/utils.py \
|
|
--replace "which('smartctl')" '"${smartmontools}/bin/smartctl"'
|
|
'';
|
|
|
|
propagatedBuildInputs = [
|
|
humanfriendly
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"pySMART"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Wrapper for smartctl (smartmontools)";
|
|
homepage = "https://github.com/truenas/py-SMART";
|
|
changelog = "https://github.com/truenas/py-SMART/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.lgpl21Only;
|
|
maintainers = with maintainers; [ nyanloutre ];
|
|
};
|
|
}
|