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