Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handheld-daemon: 1.1.0 -> 2.6.4 #303846

Merged
merged 14 commits into from
Apr 17, 2024
Merged
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions pkgs/by-name/ha/handheld-daemon/package.nix
Original file line number Diff line number Diff line change
@@ -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; [
Expand All @@ -26,17 +27,24 @@ python3.pkgs.buildPythonApplication rec {
rich
setuptools
toybox
xlib
toast003 marked this conversation as resolved.
Show resolved Hide resolved
];

# 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/
# The generated udev rules point to /bin/chmod, which does not exist in NixOS
substituteInPlace src/hhd/controller/lib/hide.py \
--replace-fail /bin/chmod ${toybox}/bin/chmod

# handheld-daemon contains a fork of the python module `hid`, so this hook
# is borrowed from the `hid` derivation.
substituteInPlace src/hhd/controller/lib/hid.py \
--replace-fail libhidapi ${hidapi}/lib/libhidapi
toast003 marked this conversation as resolved.
Show resolved Hide resolved

hidapi=${hidapi}/lib/
toast003 marked this conversation as resolved.
Show resolved Hide resolved
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
'';

postInstall = ''
Expand Down