nixpkgs/pkgs/by-name/ha/handheld-daemon/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.3 KiB
Nix
Raw Normal View History

2024-01-02 00:18:45 +00:00
{ config
, fetchFromGitHub
, hidapi
2024-01-22 19:13:15 +00:00
, kmod
2024-01-02 00:18:45 +00:00
, lib
, python3
2024-01-22 19:13:15 +00:00
, toybox
2024-01-02 00:18:45 +00:00
}:
python3.pkgs.buildPythonApplication rec {
pname = "handheld-daemon";
2024-01-22 19:13:15 +00:00
version = "1.1.0";
pyproject = true;
2024-01-02 00:18:45 +00:00
src = fetchFromGitHub {
owner = "hhd-dev";
repo = "hhd";
rev = "v${version}";
2024-01-22 19:13:15 +00:00
hash = "sha256-ovLC1BQ98jUaDEMPBzWma4TYSzTF+yE/cMemFdJmqlE=";
2024-01-02 00:18:45 +00:00
};
2024-01-22 19:13:15 +00:00
propagatedBuildInputs = with python3.pkgs; [
evdev
2024-01-02 00:18:45 +00:00
hidapi
2024-01-22 19:13:15 +00:00
kmod
pyyaml
rich
2024-01-22 19:13:15 +00:00
setuptools
toybox
2024-01-02 00:18:45 +00:00
];
# This package doesn't have upstream tests.
doCheck = false;
2024-01-02 00:18:45 +00:00
# handheld-daemon contains a fork of the python module `hid`, so this hook
# is borrowed from the `hid` derivation.
postPatch = ''
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
'';
postInstall = ''
install -Dm644 $src/usr/lib/udev/rules.d/83-hhd.rules -t $out/lib/udev/rules.d/
'';
meta = with lib; {
homepage = "https://github.com/hhd-dev/hhd/";
description = "Linux support for handheld gaming devices like the Legion Go, ROG Ally, and GPD Win";
2024-01-02 00:18:45 +00:00
platforms = platforms.linux;
license = licenses.mit;
maintainers = with maintainers; [ appsforartists toast ];
2024-01-02 00:18:45 +00:00
mainProgram = "hhd";
};
}