nixpkgs/pkgs/by-name/ha/handheld-daemon/package.nix
Brenton Simpson b960a217bd handheld-daemon: touchup code style to better match nixpkgs
Co-authored-by: h7x4 <h7x4@nani.wtf>
Co-authored-by: Luke Granger-Brown <git@lukegb.com>
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-01-29 17:20:30 -08:00

54 lines
1.3 KiB
Nix

{ config
, fetchFromGitHub
, hidapi
, kmod
, lib
, python3
, toybox
}:
python3.pkgs.buildPythonApplication rec {
pname = "handheld-daemon";
version = "1.1.0";
pyproject = true;
src = fetchFromGitHub {
owner = "hhd-dev";
repo = "hhd";
rev = "v${version}";
hash = "sha256-ovLC1BQ98jUaDEMPBzWma4TYSzTF+yE/cMemFdJmqlE=";
};
propagatedBuildInputs = with python3.pkgs; [
evdev
hidapi
kmod
pyyaml
rich
setuptools
toybox
];
# 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/
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";
platforms = platforms.linux;
license = licenses.mit;
maintainers = with maintainers; [ appsforartists ];
mainProgram = "hhd";
};
}