From patchwork Fri Jun 10 18:09:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean Pierre De Jesus DIAZ X-Patchwork-Id: 39823 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E6C7527BBE9; Fri, 10 Jun 2022 19:18:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 536BB27BBE9 for ; Fri, 10 Jun 2022 19:18:32 +0100 (BST) Received: from localhost ([::1]:55670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzjDL-0006Fb-GU for patchwork@mira.cbaines.net; Fri, 10 Jun 2022 14:18:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzjCs-0006DY-KB for guix-patches@gnu.org; Fri, 10 Jun 2022 14:18:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzjCs-0002sj-Bn for guix-patches@gnu.org; Fri, 10 Jun 2022 14:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzjCs-0006LK-7c for guix-patches@gnu.org; Fri, 10 Jun 2022 14:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55893] [PATCH] gnu: python-xyz: Add python-pysdl2. Resent-From: Jean Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Jun 2022 18:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55893 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55893@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.165488503124310 (code B ref -1); Fri, 10 Jun 2022 18:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jun 2022 18:17:11 +0000 Received: from localhost ([127.0.0.1]:51311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzjC3-0006K1-2x for submit@debbugs.gnu.org; Fri, 10 Jun 2022 14:17:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:57838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzj4d-00068W-53 for submit@debbugs.gnu.org; Fri, 10 Jun 2022 14:09:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzj4b-0001Ds-4o for guix-patches@gnu.org; Fri, 10 Jun 2022 14:09:30 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:36535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzj4X-0001dj-6g for guix-patches@gnu.org; Fri, 10 Jun 2022 14:09:28 -0400 Date: Fri, 10 Jun 2022 18:09:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeandudey.tech; s=protonmail3; t=1654884554; x=1655143754; bh=nTPRnVwj6KndSTRLsV4Wso/PpBJT2GhAEm61e6ih1RM=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=UBgo/GCa9WH8Megbdp0eKz5fZQrubcEX7kO69R7McDKr/bHdZZw8JrGpXE4AEwD2u c0ZrVWdR/UiYD7hVCfjiorQmeFQ2zRB3IJlDL5vtyd6LryALM0dEn16iLSxSSpG409 yYA1h279IwoHrIuXf9XyABI2KjemoZ/YSV2agQycQuvIill9RCyB4PqL0VL/a0Kwh2 B8EHRd+pQXkcVP96+UGZVzpobW8oy3DXdjwpzJhsz8JcO6J+elIdntrMdAvkVO47fv aNTxsV5a6cqg1KFXU2xrtjfxHYgfNMPvpviTlNEFhTaRDLCuPi6X87GC3CvIsp2aBi DqGCmDzWD3mfw== Message-ID: Feedback-ID: 20187791:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.23; envelope-from=me@jeandudey.tech; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 10 Jun 2022 14:17:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Jean Pierre De Jesus DIAZ X-ACL-Warn: , Jean Pierre De Jesus DIAZ via Guix-patches X-Patchwork-Original-From: Jean Pierre De Jesus DIAZ via Guix-patches via From: Jean Pierre De Jesus DIAZ X-getmail-retrieved-from-mailbox: Patches Adds the PySDL2 package published on PyPi. The package definition sets a fixed path for SDL2 libraries instead of relying on `LD_LIBRARY_PATH`. From f983d332d6f541e019aa68eddbc14525c549b948 Mon Sep 17 00:00:00 2001 Message-Id: From: Jean-Pierre De Jesus DIAZ Date: Fri, 10 Jun 2022 19:57:31 +0200 Subject: [PATCH] gnu: python-xyz: Add python-pysdl2. * gnu/packages/python-xyz.scm (python-pysdl2): Add package. --- gnu/packages/python-xyz.scm | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 92adf74393..062d8ce96b 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -123,6 +123,7 @@ ;;; Copyright © 2022 Jai Vetrivelan ;;; Copyright © 2022 Artyom V. Poptsov ;;; Copyright © 2022 Paul A. Patience +;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ ;;; ;;; This file is part of GNU Guix. ;;; @@ -29447,3 +29448,75 @@ (define-public python-musical-scales @url{https://en.wikipedia.org/wiki/List_of_musical_scales_and_modes, found on Wikipedia}.") (license license:expat))) + +(define-public python-pysdl2 + (package + (name "python-pysdl2") + (version "0.9.11") + (source (origin + (method url-fetch) + (uri (pypi-uri "PySDL2" version)) + (sha256 + (base32 + "19id1qswgcj4v4j5kn49shq1xxx3slhjpm0102w87mczsdbi1rck")))) + (build-system python-build-system) + (arguments + `(#:tests? #f ; Requires /dev/dri, OpenGL module, etc. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "sdl2/dll.py" + ; Disable pysdl2-dll. Not needed. + (("prepath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)") + "prepath = \"system\"") + (("^import sdl2dll$") "") + (("postpath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)") + "postpath = \"system\"") + (("DLL\\(.*, os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)\\)") + (string-append "DLL(\"SDL2\", [\"SDL2\", \"SDL2-2.0\"," + "\"SDL2-2.0.0\"], " + "\"" + (dirname + (search-input-file inputs + "/lib/libSDL2.so")) + "\"" + ")"))) + (substitute* "sdl2/sdlimage.py" + (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)") + (string-append "\"" + (dirname + (search-input-file inputs + "/lib/libSDL2_image.so")) + "\""))) + (substitute* "sdl2/sdlgfx.py" + (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)") + (string-append "\"" + (dirname + (search-input-file inputs + "/lib/libSDL2_gfx.so")) + "\""))) + (substitute* "sdl2/sdlmixer.py" + (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)") + (string-append "\"" + (dirname + (search-input-file inputs + "/lib/libSDL2_mixer.so")) + "\""))) + (substitute* "sdl2/sdlttf.py" + (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)") + (string-append "\"" + (dirname + (search-input-file inputs + "/lib/libSDL2_ttf.so")) + "\"")))))))) + (native-inputs + (list sdl2 sdl2-image sdl2-gfx sdl2-mixer sdl2-ttf)) + (home-page "https://github.com/py-sdl/py-sdl2") + (synopsis "Python ctypes wrapper around SDL2") + (description "PySDL2 is a pure Python wrapper around the @code{SDL2}, +@code{SDL2_mixer}, @code{SDL2_image}, @code{SDL2_ttf}, and @code{SDL2_gfx} +libraries. Instead of relying on C code, it uses the built-in ctypes module to +interface with SDL2, and provides simple Python classes and wrappers for +common SDL2 functionality.") + (license license:cc0))) -- 2.36.1