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 3 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
12 changes: 9 additions & 3 deletions pkgs/by-name/ha/handheld-daemon/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
, lib
, python3
, toybox
, coreutils
toast003 marked this conversation as resolved.
Show resolved Hide resolved
}:
python3.pkgs.buildPythonApplication rec {
pname = "handheld-daemon";
version = "1.1.0";
version = "2.6.2";
pyproject = true;

src = fetchFromGitHub {
owner = "hhd-dev";
repo = "hhd";
rev = "v${version}";
hash = "sha256-ovLC1BQ98jUaDEMPBzWma4TYSzTF+yE/cMemFdJmqlE=";
hash = "sha256-fsH8H6ZhiguOWI2t79GnxqAmqL/1m06RQzs+k8bUWcU=";
};

propagatedBuildInputs = with python3.pkgs; [
Expand All @@ -26,6 +27,7 @@ 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.
Expand All @@ -37,6 +39,10 @@ python3.pkgs.buildPythonApplication rec {
hidapi=${ hidapi }/lib/
toast003 marked this conversation as resolved.
Show resolved Hide resolved
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

# The generated udev rules point to /bin/chroot, which does not exist in NixOS
toast003 marked this conversation as resolved.
Show resolved Hide resolved
chmod=${ coreutils }/bin/chmod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be updated to use toybox.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to pointing that out, didn't realized it 😅

Btw are we using toolbox cause it's preferred by nixpkgs or cause it's already there? (or both idk)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK if it matters. Just suggesting to use it here because it was already in there.

(I think I chose it originally because it's a small dependency and I'd used it before to access POSIX commands.)

sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py
toast003 marked this conversation as resolved.
Show resolved Hide resolved
'';

postInstall = ''
Expand All @@ -47,7 +53,7 @@ python3.pkgs.buildPythonApplication rec {
homepage = "https://github.com/hhd-dev/hhd/";
description = "Linux support for handheld gaming devices like the Legion Go, ROG Ally, and GPD Win";
platforms = platforms.linux;
license = licenses.mit;
license = licenses.gpl3Only;
maintainers = with maintainers; [ appsforartists ];
mainProgram = "hhd";
};
Expand Down