From 595103c57c4d13554ae0a60c3ec22021822dcaf2 Mon Sep 17 00:00:00 2001 From: Nova DasSarma Date: Sun, 14 Jun 2026 21:47:26 +0900 Subject: [PATCH] python3Packages.pynput: unbreak on darwin The macOS backend imports HIServices (ApplicationServices) and uses Quartz, but no pyobjc dependencies were added on darwin, so importing pynput failed at runtime - hence the broken flag. Add the two frameworks pynput's darwin backend needs and drop the broken marker. Tested on aarch64-darwin: `from pynput import keyboard` and `HIServices.AXIsProcessTrusted()` both succeed. Assisted-by: Claude Code (model: Claude Opus 4.8) --- pkgs/development/python-modules/pynput/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pynput/default.nix b/pkgs/development/python-modules/pynput/default.nix index 22671fe18f2e..d27999d63045 100644 --- a/pkgs/development/python-modules/pynput/default.nix +++ b/pkgs/development/python-modules/pynput/default.nix @@ -14,6 +14,8 @@ xlib, evdev, six, + pyobjc-framework-ApplicationServices, + pyobjc-framework-Quartz, # tests unittestCheckHook, @@ -52,6 +54,11 @@ buildPythonPackage rec { ++ lib.optionals stdenv.hostPlatform.isLinux [ evdev xlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # the darwin backend imports HIServices (ApplicationServices) and Quartz + pyobjc-framework-ApplicationServices + pyobjc-framework-Quartz ]; doCheck = false; # requires running X server @@ -59,7 +66,6 @@ buildPythonPackage rec { nativeCheckInputs = [ unittestCheckHook ]; meta = { - broken = stdenv.hostPlatform.isDarwin; description = "Library to control and monitor input devices"; homepage = "https://github.com/moses-palmer/pynput"; license = lib.licenses.lgpl3;