2021-01-02 20:01:34 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2021-05-01 10:26:08 +00:00
|
|
|
, installShellFiles
|
2021-01-02 20:01:34 +00:00
|
|
|
, docopt
|
|
|
|
, hidapi
|
|
|
|
, pyusb
|
|
|
|
, smbus-cffi
|
2021-05-01 10:26:08 +00:00
|
|
|
, i2c-tools
|
|
|
|
, pytestCheckHook
|
2021-01-02 20:01:34 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "liquidctl";
|
2021-05-01 10:26:08 +00:00
|
|
|
version = "1.6.1";
|
2021-01-02 20:01:34 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-01 10:26:08 +00:00
|
|
|
sha256 = "sha256-FYpr1mYzPc0rOE75fUNjxe/57EWl+zcbIbkqFseDhzI=";
|
2021-01-02 20:01:34 +00:00
|
|
|
};
|
|
|
|
|
2021-05-01 10:26:08 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-02 20:01:34 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
docopt
|
|
|
|
hidapi
|
|
|
|
pyusb
|
|
|
|
smbus-cffi
|
2021-05-01 10:26:08 +00:00
|
|
|
i2c-tools
|
2021-01-02 20:01:34 +00:00
|
|
|
];
|
|
|
|
|
2021-05-01 10:26:08 +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-04 12:56:13 +00:00
|
|
|
pythonImportsCheck = [ "liquidctl" ];
|
|
|
|
|
2021-01-02 20:01:34 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform CLI and Python drivers for AIO liquid coolers and other devices";
|
|
|
|
homepage = "https://github.com/liquidctl/liquidctl";
|
|
|
|
changelog = "https://github.com/liquidctl/liquidctl/blob/master/CHANGELOG.md";
|
2021-05-01 10:26:08 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ arturcygan evils ];
|
2021-01-02 20:01:34 +00:00
|
|
|
};
|
|
|
|
}
|