about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pysmart/default.nix
blob: 5c576e4895ffe2b8f2b963808e6b96bfc1a29184 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, buildPythonPackage
, fetchFromGitHub
, smartmontools
, humanfriendly
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pysmart";
  version = "1.2.1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "truenas";
    repo = "py-SMART";
    rev = "refs/tags/v${version}";
    hash = "sha256-slLk4zoW0ht9hiOxyBt0caekjrPgih9G99pRiD2vIxE=";
  };

  postPatch = ''
    substituteInPlace pySMART/utils.py \
      --replace "which('smartctl')" '"${smartmontools}/bin/smartctl"'
  '';

  propagatedBuildInputs = [
    humanfriendly
  ];

  checkInputs = [
    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 ];
  };
}