2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
|
|
|
, setuptools-lint
|
|
|
|
, sphinx
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, xlib
|
|
|
|
, evdev
|
|
|
|
, darwin
|
|
|
|
, six
|
|
|
|
|
|
|
|
# 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
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
evdev
|
|
|
|
xlib
|
|
|
|
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
|
|
ApplicationServices
|
|
|
|
Quartz
|
|
|
|
]);
|
|
|
|
|
|
|
|
doCheck = false; # requires running X server
|
|
|
|
|
|
|
|
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;
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "A library to control and monitor input devices";
|
|
|
|
homepage = "https://github.com/moses-palmer/pynput";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = with maintainers; [ nickhu ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|