1{ lib
2, pkgs
3, buildPythonPackage
4, fetchFromGitHub
5, pygame
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "pygame-gui";
11 version = "0.5.7";
12
13 src = fetchFromGitHub {
14 owner = "MyreMylar";
15 repo = "pygame_gui";
16 rev = "v_${lib.replaceStrings ["."] [""] version}";
17 sha256 = "4P2PT8/7oA5Q7H4+pm7BOET7w05pQYQltXVV3+YVrVE=";
18 };
19
20 propagatedBuildInputs = [ pygame ];
21
22 postPatch = ''
23 substituteInPlace pygame_gui/core/utility.py \
24 --replace "xsel" "${pkgs.xsel}/bin/xsel"
25 '';
26
27 checkInputs = [ pytestCheckHook ];
28
29 preCheck = ''
30 export HOME=$TMPDIR
31 export SDL_VIDEODRIVER=dummy
32 '';
33
34 disabledTests = [
35 # Clipboard doesn't exist in test environment
36 "test_process_event_text_ctrl_c"
37 "test_process_event_text_ctrl_v"
38 "test_process_event_text_ctrl_v_nothing"
39 "test_process_event_ctrl_v_over_limit"
40 "test_process_event_ctrl_v_at_limit"
41 "test_process_event_ctrl_v_over_limit_select_range"
42 "test_process_event_text_ctrl_v_select_range"
43 "test_process_event_text_ctrl_a"
44 "test_process_event_text_ctrl_x"
45 ];
46
47 meta = with lib; {
48 description = "A GUI system for pygame";
49 homepage = "https://github.com/MyreMylar/pygame_gui";
50 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ angustrau ];
52 };
53}