[bug#67131,v4,2/5] gnu: Add python-pygame-menu.

Message ID 501b918a-356b-4536-9a57-92ef58b1d8f3@disroot.org
State New
Headers
Series [bug#67131,v4,1/5] gnu: Add python-neteria. |

Commit Message

Adam Faiz Feb. 15, 2025, 1:46 a.m. UTC
  From 696d8737ba8d82d429fe66d0899b224b59caf3f4 Mon Sep 17 00:00:00 2001
Message-ID: <696d8737ba8d82d429fe66d0899b224b59caf3f4.1739583668.git.adam.faiz@disroot.org>
In-Reply-To: <41e55dc3f7a5b6a444cd81b641107ac5323a1303.1739583668.git.adam.faiz@disroot.org>
References: <41e55dc3f7a5b6a444cd81b641107ac5323a1303.1739583668.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
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(+)
  

Patch

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"))