Subject: [PATCH v4 2/5] gnu: Add python-pygame-menu.

From: Adam Faiz <[email-masked]>
Date: Sat, 15 Feb 2025 09:46:08 +0800

>From 696d8737ba8d82d429fe66d0899b224b59caf3f4 Mon Sep 17 00:00:00 2001
Message-ID: <6[email-masked]>
In-Reply-To: <4[email-masked]>
References: <4[email-masked]>
From: AwesomeAdam54321 <[email-masked]>
Date: Mon, 13 Nov 2023 11:41:54 +0800
Subject: [PATCH v4 2/5] gnu: Add python-pygame-menu.

* gnu/packages/game-development.scm (python-pygame-menu): New variable.
---
 gnu/packages/game-development.scm | 44 +++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index c901ad869e..810a03a7c2 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1425,6 +1425,50 @@ (define-public python-pygame
                    license:public-domain
                    license:lgpl2.1+))))
 
+(define-public python-pygame-menu
+  (package
+    (name "python-pygame-menu")
+    (version "4.5.1")
+    (source
+     ;; Tests not included in release.
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/ppizarror/pygame-menu")
+           (commit version)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0xd5d6nfkd5bp2zfq77yglp6mz043w28zprfz7savgmph5kvdnfh"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'check 'prepare-test-environment
+                 (lambda _
+                   (setenv "HOME" (getcwd))))
+               (add-before 'check 'skip-certain-tests
+                 (lambda _
+                   (substitute* "test/test_font.py"
+                     (("test_font_argument") "skip_test_font_argument")
+                     (("test_system_load") "skip_test_system_load"))
+                   (substitute* "test/test_baseimage.py"
+                     ;; Tuples differ: (111, 110) != (110, 109)
+                     (("test_invalid_image") "skip_test_invalid_image")
+                     (("test_scale") "skip_test_scale")))))))
+    (propagated-inputs (list python-pygame python-pyperclip
+                             python-typing-extensions))
+    (native-inputs (list python-nose2 python-setuptools python-wheel))
+    (home-page "https://pygame-menu.readthedocs.io")
+    (synopsis "Menu for pygame")
+    (description
+     "Pygame-menu is a python-pygame library for creating menus and GUIs.
+It supports several widgets, such as buttons, color inputs, clock objects,
+drop selectors, frames, images, labels, selectors, tables, text inputs,
+color switches, and many more, with multiple options to customize.")
+    (license license:expat)))
+
 (define-public python-pygame-sdl2
   (let ((real-version "2.1.0")
         (renpy-version "8.3.0"))
-- 
2.46.0