1{
2 lib,
3 pkgs,
4 stdenv,
5 buildPythonPackage,
6 nix-update-script,
7 fetchFromGitHub,
8 setuptools,
9 pygame-ce,
10 python-i18n,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "pygame-gui";
16 version = "0614";
17 pyproject = true;
18 # nixpkgs-update: no auto update
19
20 src = fetchFromGitHub {
21 owner = "MyreMylar";
22 repo = "pygame_gui";
23 tag = "v_${version}";
24 hash = "sha256-wLvWaJuXMXk7zOaSZfIpsXhQt+eCjOtlh8IRuKbR75o=";
25 };
26
27 nativeBuildInputs = [ setuptools ];
28
29 propagatedBuildInputs = [
30 pygame-ce
31 python-i18n
32 ];
33
34 postPatch = ''
35 substituteInPlace pygame_gui/core/utility.py \
36 --replace-fail "xsel" "${lib.getExe pkgs.xsel}"
37 '';
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 preCheck = ''
42 export HOME=$TMPDIR
43 export SDL_VIDEODRIVER=dummy
44 '';
45
46 disabledTests = [
47 # Clipboard doesn't exist in test environment
48 "test_process_event_text_ctrl_c"
49 "test_process_event_text_ctrl_v"
50 "test_process_event_text_ctrl_v_nothing"
51 "test_process_event_ctrl_v_over_limit"
52 "test_process_event_ctrl_v_at_limit"
53 "test_process_event_ctrl_v_over_limit_select_range"
54 "test_process_event_text_ctrl_v_select_range"
55 "test_process_event_text_ctrl_a"
56 "test_process_event_text_ctrl_x"
57 ]
58 ++ lib.optionals stdenv.hostPlatform.isDarwin [
59 # fails to determine "/" as an existing path
60 # https://github.com/MyreMylar/pygame_gui/issues/644
61 "test_process_event"
62 ];
63
64 disabledTestPaths = [ "tests/test_performance/test_text_performance.py" ];
65
66 passthru.updateScript = nix-update-script {
67 extraArgs = [
68 "--version-regex"
69 "v_(.*)"
70 ];
71 };
72
73 meta = with lib; {
74 description = "GUI system for pygame";
75 homepage = "https://github.com/MyreMylar/pygame_gui";
76 license = with licenses; [ mit ];
77 maintainers = with maintainers; [
78 emilytrau
79 pbsds
80 ];
81 };
82}