about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pysmart/default.nix
blob: 3bd5fa50a1339fee82d65cd572b46cceb2c39216 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, smartmontools
, humanfriendly
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "pysmart";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "truenas";
    repo = "py-SMART";
    rev = "v${version}";
    sha256 = "sha256-e46ALiYg0Db/gOzqLmVc1vi9ObhfxzqwfQk9/9pz+r0=";
  };

  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";
    maintainers = with maintainers; [ nyanloutre ];
    license = licenses.lgpl21Only;
  };
}