depot/third_party/nixpkgs/pkgs/development/python-modules/pynput/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

70 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
setuptools-lint,
sphinx,
# dependencies
xlib,
evdev,
darwin,
six,
# tests
unittestCheckHook,
}:
buildPythonPackage rec {
pname = "pynput";
version = "1.7.6";
format = "pyproject";
src = fetchFromGitHub {
owner = "moses-palmer";
repo = "pynput";
rev = "refs/tags/v${version}";
hash = "sha256-gRq4LS9NvPL98N0Jk09Z0GfoHS09o3zM284BEWS+NW4=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "'sphinx >=1.3.1'" ""
'';
nativeBuildInputs = [
setuptools
setuptools-lint
sphinx
];
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 ];
meta = with lib; {
broken = stdenv.isDarwin;
description = "Library to control and monitor input devices";
homepage = "https://github.com/moses-palmer/pynput";
license = licenses.lgpl3;
maintainers = with maintainers; [ nickhu ];
};
}