2021-01-05 17:05:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
, installShellFiles
|
2021-01-05 17:05:55 +00:00
|
|
|
, docopt
|
|
|
|
, hidapi
|
|
|
|
, pyusb
|
|
|
|
, smbus-cffi
|
2021-05-20 23:08:51 +00:00
|
|
|
, i2c-tools
|
|
|
|
, pytestCheckHook
|
2021-07-14 22:03:04 +00:00
|
|
|
, colorlog
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "liquidctl";
|
2022-01-23 02:10:13 +00:00
|
|
|
version = "1.8.1";
|
2021-01-05 17:05:55 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-06 13:57:05 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-23 02:10:13 +00:00
|
|
|
sha256 = "0cl1xg3rqpn4yjflwcz667pwfjnbq0g41pkg2nak7x9mxqnbdk70";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
docopt
|
|
|
|
hidapi
|
|
|
|
pyusb
|
|
|
|
smbus-cffi
|
2021-05-20 23:08:51 +00:00
|
|
|
i2c-tools
|
2021-07-14 22:03:04 +00:00
|
|
|
colorlog
|
2021-01-05 17:05:55 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedNativeBuildInputs = [
|
|
|
|
smbus-cffi
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage liquidctl.8
|
|
|
|
installShellCompletion extra/completions/liquidctl.bash
|
|
|
|
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
cp extra/linux/71-liquidctl.rules $out/lib/udev/rules.d/.
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
# needed for pythonImportsCheck
|
|
|
|
export XDG_RUNTIME_DIR=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
pythonImportsCheck = [ "liquidctl" ];
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform CLI and Python drivers for AIO liquid coolers and other devices";
|
2021-10-06 13:57:05 +00:00
|
|
|
homepage = "https://github.com/liquidctl/liquidctl";
|
|
|
|
changelog = "https://github.com/liquidctl/liquidctl/blob/master/CHANGELOG.md";
|
|
|
|
license = licenses.gpl3Plus;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ arturcygan evils ];
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
}
|