1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mouseinfo,
6 pygetwindow,
7 pymsgbox,
8 pyperclip,
9 pyscreeze,
10 pytweening,
11 tkinter,
12 xlib,
13 xvfb-run,
14 scrot,
15}:
16buildPythonPackage {
17 pname = "pyautogui";
18 version = "0.9.53";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "asweigart";
23 repo = "pyautogui";
24 rev = "5e4acb870f2e7ce0ea1927cc5188bc2f5ab7bbbc";
25 hash = "sha256-R9tcTqxUaqw63FLOGFRaO/Oz6kD7V6MPHdQ8A29NdXw=";
26 };
27
28 nativeCheckInputs = [
29 xvfb-run
30 scrot
31 ];
32 checkPhase = ''
33 xvfb-run python -c 'import pyautogui'
34 # The tests depend on some specific things that xvfb cant provide, like keyboard and mouse
35 # xvfb-run python -m unittest tests.test_pyautogui
36 '';
37
38 patches = [
39 # https://github.com/asweigart/pyautogui/issues/598
40 ./fix-locateOnWindow-and-xlib.patch
41 ];
42
43 propagatedBuildInputs = [
44 mouseinfo
45 pygetwindow
46 pymsgbox
47 xlib
48 tkinter
49 pyperclip
50 pyscreeze
51 pytweening
52 ];
53
54 meta = with lib; {
55 description = "PyAutoGUI lets Python control the mouse and keyboard, and other GUI automation tasks";
56 homepage = "https://github.com/asweigart/pyautogui";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ lucasew ];
59 };
60}