1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, smartmontools
5, humanfriendly
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "pysmart";
11 version = "1.1.0";
12
13 src = fetchFromGitHub {
14 owner = "truenas";
15 repo = "py-SMART";
16 rev = "v${version}";
17 sha256 = "sha256-e46ALiYg0Db/gOzqLmVc1vi9ObhfxzqwfQk9/9pz+r0=";
18 };
19
20 postPatch = ''
21 substituteInPlace pySMART/utils.py \
22 --replace "which('smartctl')" '"${smartmontools}/bin/smartctl"'
23 '';
24
25 propagatedBuildInputs = [ humanfriendly ];
26
27 checkInputs = [ pytestCheckHook ];
28
29 pythonImportsCheck = [ "pySMART" ];
30
31 meta = with lib; {
32 description = "Wrapper for smartctl (smartmontools)";
33 homepage = "https://github.com/truenas/py-SMART";
34 maintainers = with maintainers; [ nyanloutre ];
35 license = licenses.lgpl21Only;
36 };
37}