From 80bd21c54cd29c643ca840aae33d138c18cc648c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 28 Apr 2026 15:51:59 +0000 Subject: [PATCH] python3Packages.pygame-gui: cleanup, fix --- .../python-modules/pygame-gui/default.nix | 56 ++++++++++++++----- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/pygame-gui/default.nix b/pkgs/development/python-modules/pygame-gui/default.nix index ea2fd3040bfe..be21cc0d92af 100644 --- a/pkgs/development/python-modules/pygame-gui/default.nix +++ b/pkgs/development/python-modules/pygame-gui/default.nix @@ -3,43 +3,57 @@ pkgs, stdenv, buildPythonPackage, - nix-update-script, fetchFromGitHub, + + # build-system setuptools, + + # dependencies pygame-ce, python-i18n, + + # tests pytestCheckHook, + writableTmpDirAsHomeHook, + + # passthru + nix-update-script, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "pygame-gui"; version = "0614"; pyproject = true; + __structuredAttrs = true; # nixpkgs-update: no auto update src = fetchFromGitHub { owner = "MyreMylar"; repo = "pygame_gui"; - tag = "v_${version}"; + tag = "v_${finalAttrs.version}"; hash = "sha256-wLvWaJuXMXk7zOaSZfIpsXhQt+eCjOtlh8IRuKbR75o="; }; - nativeBuildInputs = [ setuptools ]; - - propagatedBuildInputs = [ - pygame-ce - python-i18n - ]; - postPatch = '' substituteInPlace pygame_gui/core/utility.py \ --replace-fail "xsel" "${lib.getExe pkgs.xsel}" ''; - nativeCheckInputs = [ pytestCheckHook ]; + build-system = [ + setuptools + ]; + + dependencies = [ + pygame-ce + python-i18n + ]; + + nativeCheckInputs = [ + pytestCheckHook + writableTmpDirAsHomeHook + ]; preCheck = '' - export HOME=$TMPDIR export SDL_VIDEODRIVER=dummy ''; @@ -54,6 +68,22 @@ buildPythonPackage rec { "test_process_event_text_ctrl_v_select_range" "test_process_event_text_ctrl_a" "test_process_event_text_ctrl_x" + + # Pixel-level rendering mismatches with pygame-ce 2.5.7 + "test_clear" + "test_creation_grow_to_fit_width" + "test_draw_ui" + "test_on_hovered" + "test_on_unhovered" + "test_process_event_mouse_buttons" + "test_set_active" + "test_set_cursor_from_click_pos" + "test_set_cursor_position" + "test_set_default_text_colour" + "test_set_inactive" + "test_set_text" + "test_split" + "test_split_index" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # fails to determine "/" as an existing path @@ -79,4 +109,4 @@ buildPythonPackage rec { pbsds ]; }; -} +})