1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, installShellFiles
6, setuptools
7, docopt
8, hidapi
9, pyusb
10, smbus-cffi
11, i2c-tools
12, pytestCheckHook
13, colorlog
14, crcmod
15, pillow
16}:
17
18buildPythonPackage rec {
19 pname = "liquidctl";
20 version = "1.12.1";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = pname;
27 repo = pname;
28 rev = "refs/tags/v${version}";
29 hash = "sha256-0QjgnTxqB50JNjSUAgBrGyhN2XC/TDYiC1tvhw1Bl1M=";
30 };
31
32 nativeBuildInputs = [
33 installShellFiles
34 setuptools
35 ];
36
37 propagatedBuildInputs = [
38 docopt
39 hidapi
40 pyusb
41 smbus-cffi
42 i2c-tools
43 colorlog
44 crcmod
45 pillow
46 ];
47
48 propagatedNativeBuildInputs = [
49 smbus-cffi
50 ];
51
52 outputs = [
53 "out"
54 "man"
55 ];
56
57 postInstall = ''
58 installManPage liquidctl.8
59 installShellCompletion extra/completions/liquidctl.bash
60
61 mkdir -p $out/lib/udev/rules.d
62 cp extra/linux/71-liquidctl.rules $out/lib/udev/rules.d/.
63 '';
64
65 nativeCheckInputs = [
66 pytestCheckHook
67 ];
68
69 postBuild = ''
70 # needed for pythonImportsCheck
71 export XDG_RUNTIME_DIR=$TMPDIR
72 '';
73
74 pythonImportsCheck = [
75 "liquidctl"
76 ];
77
78 meta = with lib; {
79 description = "Cross-platform CLI and Python drivers for AIO liquid coolers and other devices";
80 homepage = "https://github.com/liquidctl/liquidctl";
81 changelog = "https://github.com/liquidctl/liquidctl/blob/v${version}/CHANGELOG.md";
82 license = licenses.gpl3Plus;
83 maintainers = with maintainers; [ arturcygan evils ];
84 };
85}