2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
|
|
|
setuptools-lint,
|
|
|
|
sphinx,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
xlib,
|
|
|
|
evdev,
|
|
|
|
darwin,
|
|
|
|
six,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
unittestCheckHook,
|
|
|
|
}:
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pynput";
|
2022-01-03 16:56:52 +00:00
|
|
|
version = "1.7.6";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "moses-palmer";
|
|
|
|
repo = "pynput";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-gRq4LS9NvPL98N0Jk09Z0GfoHS09o3zM284BEWS+NW4=";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'sphinx >=1.3.1'" ""
|
|
|
|
'';
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-lint
|
|
|
|
sphinx
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[ six ]
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
evdev
|
|
|
|
xlib
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin (
|
|
|
|
with darwin.apple_sdk.frameworks;
|
|
|
|
[
|
|
|
|
ApplicationServices
|
|
|
|
Quartz
|
|
|
|
]
|
|
|
|
);
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
doCheck = false; # requires running X server
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ unittestCheckHook ];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library to control and monitor input devices";
|
2020-06-18 07:06:33 +00:00
|
|
|
homepage = "https://github.com/moses-palmer/pynput";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = with maintainers; [ nickhu ];
|
|
|
|
};
|
|
|
|
}
|