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