2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, chardet
|
2021-10-28 06:52:43 +00:00
|
|
|
, humanfriendly
|
|
|
|
, pytestCheckHook
|
2022-12-17 10:02:37 +00:00
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
, setuptools-scm
|
|
|
|
, smartmontools
|
2021-10-28 06:52:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysmart";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.3.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "pyproject";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "truenas";
|
|
|
|
repo = "py-SMART";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-1k+5XnIT/AfZmzKUxkyU/uc0eW05CvugpY6OdJCoALc=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pySMART/utils.py \
|
|
|
|
--replace "which('smartctl')" '"${smartmontools}/bin/smartctl"'
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-07-15 17:15:38 +00:00
|
|
|
chardet
|
2022-12-17 10:02:37 +00:00
|
|
|
humanfriendly
|
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pySMART"
|
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Wrapper for smartctl (smartmontools)";
|
|
|
|
homepage = "https://github.com/truenas/py-SMART";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/truenas/py-SMART/blob/v${version}/CHANGELOG.md";
|
2021-10-28 06:52:43 +00:00
|
|
|
license = licenses.lgpl21Only;
|
2022-12-17 10:02:37 +00:00
|
|
|
maintainers = with maintainers; [ nyanloutre ];
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
}
|