1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pillow
5, xlib
6, six
7, xvfb-run
8, setuptools
9, gobject-introspection
10, pygobject3
11, gtk3
12, libayatana-appindicator
13}:
14
15buildPythonPackage rec {
16 pname = "pystray";
17 version = "0.19.2";
18 format = "pyproject";
19
20 src = fetchFromGitHub {
21 owner = "moses-palmer";
22 repo = "pystray";
23 rev = "v${version}";
24 hash = "sha256-8B178MSe4ujlnGBmQhIu+BoAh1doP9V5cL0ermLQTvs=";
25 };
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace "'sphinx >=1.3.1'" ""
30 '';
31
32 nativeBuildInputs = [
33 gobject-introspection
34 setuptools
35 ];
36
37 propagatedBuildInputs = [
38 pillow
39 xlib
40 six
41 pygobject3
42 gtk3
43 libayatana-appindicator
44 ];
45
46 nativeCheckInputs = [
47 xvfb-run
48 ];
49
50 checkPhase = ''
51 rm tests/icon_tests.py # test needs user input
52
53 xvfb-run -s '-screen 0 800x600x24' python setup.py test
54 '';
55
56 meta = with lib; {
57 homepage = "https://github.com/moses-palmer/pystray";
58 description = "This library allows you to create a system tray icon";
59 license = with licenses; [ gpl3Plus lgpl3Plus ];
60 platforms = platforms.linux;
61 maintainers = with maintainers; [ jojosch ];
62 };
63}