From d9e4af9ae8ed30a1ab860915c5c0ff9ae0c16dc1 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:32:24 +0200 Subject: [PATCH 01/13] handheld-daemon: 1.1.0 -> 2.6.2 --- pkgs/by-name/ha/handheld-daemon/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index bb0c9d65bfe19dd..b5f25f339ffb605 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -8,14 +8,14 @@ }: 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; [ @@ -26,6 +26,7 @@ python3.pkgs.buildPythonApplication rec { rich setuptools toybox + xlib ]; # This package doesn't have upstream tests. From 2a8d54c511bda43bea18d35d2c08f224f3352a18 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:42:25 +0200 Subject: [PATCH 02/13] handheld-daemon: update license --- pkgs/by-name/ha/handheld-daemon/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index b5f25f339ffb605..f0ce6e9648e3e81 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -48,7 +48,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"; }; From 3b96a3c082f6b0e9f7e2eabcc18cf599a0c7eb63 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 15 Apr 2024 00:31:56 +0200 Subject: [PATCH 03/13] handheld-daemon: patch generated udev rules to use chmod from nix store --- pkgs/by-name/ha/handheld-daemon/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index f0ce6e9648e3e81..72981284e2e9c10 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -5,6 +5,7 @@ , lib , python3 , toybox +, coreutils }: python3.pkgs.buildPythonApplication rec { pname = "handheld-daemon"; @@ -38,6 +39,10 @@ python3.pkgs.buildPythonApplication rec { 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/chroot, which does not exist in NixOS + chmod=${ coreutils }/bin/chmod + sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py ''; postInstall = '' From 6a2060842db04c81b354b49a9c53bfd2262a5af3 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:57:10 +0200 Subject: [PATCH 04/13] handheld-daemon: remove unneeded coreutils dependency --- pkgs/by-name/ha/handheld-daemon/package.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 72981284e2e9c10..835c07744693543 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -5,7 +5,6 @@ , lib , python3 , toybox -, coreutils }: python3.pkgs.buildPythonApplication rec { pname = "handheld-daemon"; @@ -41,7 +40,7 @@ python3.pkgs.buildPythonApplication rec { 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 - chmod=${ coreutils }/bin/chmod + chmod=${ toybox }/bin/chmod sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py ''; From c9e8b7cf0260618682c15f7ba601ec9827396ceb Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:07:46 +0200 Subject: [PATCH 05/13] handheld-daemon: move udev rule comment --- pkgs/by-name/ha/handheld-daemon/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 835c07744693543..d79457057e392ce 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -34,12 +34,12 @@ python3.pkgs.buildPythonApplication rec { # handheld-daemon contains a fork of the python module `hid`, so this hook # is borrowed from the `hid` derivation. + # The generated udev rules point to /bin/chroot, which does not exist in NixOS 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 - # The generated udev rules point to /bin/chroot, which does not exist in NixOS chmod=${ toybox }/bin/chmod sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py ''; From 7bea1eb24a9e84b343c3944318e74ce3442ce40c Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:32:43 +0200 Subject: [PATCH 06/13] handheld-daemon: 2.6.2 -> 2.6.4 --- pkgs/by-name/ha/handheld-daemon/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index d79457057e392ce..7801038ea36669a 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -8,14 +8,14 @@ }: python3.pkgs.buildPythonApplication rec { pname = "handheld-daemon"; - version = "2.6.2"; + version = "2.6.4"; pyproject = true; src = fetchFromGitHub { owner = "hhd-dev"; repo = "hhd"; rev = "v${version}"; - hash = "sha256-fsH8H6ZhiguOWI2t79GnxqAmqL/1m06RQzs+k8bUWcU="; + hash = "sha256-S77APtE1GGfqnv1IkZdJOSlprPOBtrqVXV60yVMvopg="; }; propagatedBuildInputs = with python3.pkgs; [ From b510c5a603c7f2193a4f1c10e03bac6f7f361584 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 15 Apr 2024 21:30:51 +0200 Subject: [PATCH 07/13] handheld-daemon: move udev rule comment to the right place this time --- pkgs/by-name/ha/handheld-daemon/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 7801038ea36669a..4189bf0483b9735 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -32,14 +32,14 @@ python3.pkgs.buildPythonApplication rec { # 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. - # The generated udev rules point to /bin/chroot, which does not exist in NixOS postPatch = '' + # 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/chroot, which does not exist in NixOS chmod=${ toybox }/bin/chmod sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py ''; From f7b450a4d83aec36be9c1576cb69b92c7895b33d Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 15 Apr 2024 21:38:38 +0200 Subject: [PATCH 08/13] handheld-daemon: fix typo in comment --- pkgs/by-name/ha/handheld-daemon/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 4189bf0483b9735..5087698c793430e 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -39,7 +39,7 @@ python3.pkgs.buildPythonApplication rec { 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 + # 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 ''; From a581a28a074a3a8bad48ba2883a320bfb02a5062 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Tue, 16 Apr 2024 19:50:25 +0200 Subject: [PATCH 09/13] handheld-daemon: format with nixfmt-rfc-style --- pkgs/by-name/ha/handheld-daemon/package.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 5087698c793430e..52b5729bc6f3003 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -1,10 +1,11 @@ -{ config -, fetchFromGitHub -, hidapi -, kmod -, lib -, python3 -, toybox +{ + config, + fetchFromGitHub, + hidapi, + kmod, + lib, + python3, + toybox, }: python3.pkgs.buildPythonApplication rec { pname = "handheld-daemon"; @@ -35,12 +36,12 @@ python3.pkgs.buildPythonApplication rec { postPatch = '' # handheld-daemon contains a fork of the python module `hid`, so this hook # is borrowed from the `hid` derivation. - hidapi=${ hidapi }/lib/ + 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 + chmod=${toybox}/bin/chmod sed -i -e "s|/bin/chmod|$chmod|" src/hhd/controller/lib/hide.py ''; From d9b7086a02c8b6a156438d88d86903218907aa9e Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:15:21 +0200 Subject: [PATCH 10/13] handheld-daemon: replace sed commands with substituteInPlace --- pkgs/by-name/ha/handheld-daemon/package.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 52b5729bc6f3003..356130ec54e07e5 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -34,15 +34,17 @@ python3.pkgs.buildPythonApplication rec { doCheck = false; postPatch = '' + # 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 + 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 = '' From 20753a73d1a20cf5b67bc7cc51572807c0eda9fc Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:29:56 +0200 Subject: [PATCH 11/13] handheld-daemon: trim out trailing whitespace --- pkgs/by-name/ha/handheld-daemon/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index b734034a439dab5..db6c46a7e8055c7 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -41,9 +41,9 @@ python3.pkgs.buildPythonApplication rec { # 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 - - hidapi=${hidapi}/lib/ + --replace-fail libhidapi ${hidapi}/lib/libhidapi + + hidapi=${hidapi}/lib/ test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; } ''; From cb2fa9a66110a6deb4f66c2dfd146b2895f932bd Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:04:48 +0200 Subject: [PATCH 12/13] handheld-daemon: fix indenting --- pkgs/by-name/ha/handheld-daemon/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index db6c46a7e8055c7..ad0554bec36d52b 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -41,9 +41,9 @@ python3.pkgs.buildPythonApplication rec { # 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 + --replace-fail libhidapi ${hidapi}/lib/libhidapi - hidapi=${hidapi}/lib/ + hidapi=${hidapi}/lib/ test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; } ''; From d9b487ae609a368378c1a9d89a5441c5c44121df Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:19:43 +0200 Subject: [PATCH 13/13] handheld-daemon: undo refactor --- pkgs/by-name/ha/handheld-daemon/package.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index ad0554bec36d52b..246e3879bb5cfa8 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -34,17 +34,15 @@ python3.pkgs.buildPythonApplication rec { doCheck = false; postPatch = '' - # 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 - 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 = ''