Merge pull request #303846 from toast003/update-hhd

handheld-daemon: 1.1.0 -> 2.6.4
This commit is contained in:
Nick Cao 2024-04-17 19:51:43 -04:00 committed by GitHub
commit bb1e65a834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,21 +1,22 @@
{ config
, fetchFromGitHub
, hidapi
, kmod
, lib
, python3
, toybox
{
config,
fetchFromGitHub,
hidapi,
kmod,
lib,
python3,
toybox,
}:
python3.pkgs.buildPythonApplication rec {
pname = "handheld-daemon";
version = "1.1.0";
version = "2.6.4";
pyproject = true;
src = fetchFromGitHub {
owner = "hhd-dev";
repo = "hhd";
rev = "v${version}";
hash = "sha256-ovLC1BQ98jUaDEMPBzWma4TYSzTF+yE/cMemFdJmqlE=";
hash = "sha256-S77APtE1GGfqnv1IkZdJOSlprPOBtrqVXV60yVMvopg=";
};
propagatedBuildInputs = with python3.pkgs; [
@ -26,17 +27,22 @@ python3.pkgs.buildPythonApplication rec {
rich
setuptools
toybox
xlib
];
# This package doesn't have upstream tests.
doCheck = false;
# handheld-daemon contains a fork of the python module `hid`, so this hook
# is borrowed from the `hid` derivation.
postPatch = ''
hidapi=${ hidapi }/lib/
# handheld-daemon contains a fork of the python module `hid`, so this hook
# is borrowed from the `hid` derivation.
hidapi=${hidapi}/lib/
test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|libhidapi|$hidapi/libhidapi|" src/hhd/controller/lib/hid.py
# The generated udev rules point to /bin/chmod, which does not exist in NixOS
chmod=${toybox}/bin/chmod
sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py
'';
postInstall = ''