commit:     faa23060a8db98c794ba723fd567f2ec688c6eb5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon May 20 18:30:11 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May 20 18:35:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=faa23060

dev-python/pygame: Backport a GCC 14 build fix

Closes: https://bugs.gentoo.org/926650
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pygame/files/pygame-2.5.2-gcc-14.patch | 38 +++++++++++++++++++++++
 dev-python/pygame/pygame-2.5.2-r1.ebuild          |  2 ++
 2 files changed, 40 insertions(+)

diff --git a/dev-python/pygame/files/pygame-2.5.2-gcc-14.patch 
b/dev-python/pygame/files/pygame-2.5.2-gcc-14.patch
new file mode 100644
index 000000000000..0d74303bbba4
--- /dev/null
+++ b/dev-python/pygame/files/pygame-2.5.2-gcc-14.patch
@@ -0,0 +1,38 @@
+From 504a11fd4855e33ecb945af1270311aa463aae59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ren=C3=A9=20Dudfield?= <ren...@gmail.com>
+Date: Sun, 19 May 2024 11:12:33 +0200
+Subject: [PATCH] pypm: Fix incorrect param in Pm_OpenInput
+
+---
+ src_c/cython/pygame/pypm.pyx | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src_c/cython/pygame/pypm.pyx b/src_c/cython/pygame/pypm.pyx
+index f2c16c9e2b..54a88fd83a 100644
+--- a/src_c/cython/pygame/pypm.pyx
++++ b/src_c/cython/pygame/pypm.pyx
+@@ -106,7 +106,7 @@ cdef extern from "portmidi.h":
+                          PmDeviceID inputDevice,
+                          void *inputDriverInfo,
+                          long bufferSize,
+-                         long (*PmPtr) (), # long = PtTimestamp
++                         PmTimeProcPtr time_proc, # long = PtTimestamp
+                          void *time_info)
+ 
+     PmError Pm_OpenOutput(PortMidiStream** stream,
+@@ -538,11 +538,14 @@ cdef class Input:
+         """Instantiate MIDI input stream object."""
+ 
+         cdef PmError err
++        cdef PmTimeProcPtr PmPtr
+         self.device = input_device
+         self.debug = 0
+ 
++        PmPtr = <PmTimeProcPtr>&Pt_Time
++
+         err = Pm_OpenInput(&(self.midi), input_device, NULL, buffersize,
+-                           &Pt_Time, NULL)
++                           PmPtr, NULL)
+         if err < 0:
+             raise Exception(Pm_GetErrorText(err))
+ 

diff --git a/dev-python/pygame/pygame-2.5.2-r1.ebuild 
b/dev-python/pygame/pygame-2.5.2-r1.ebuild
index a7e594998df9..077556ead05f 100644
--- a/dev-python/pygame/pygame-2.5.2-r1.ebuild
+++ b/dev-python/pygame/pygame-2.5.2-r1.ebuild
@@ -62,6 +62,8 @@ src_prepare() {
        local PATCHES=(
                # https://github.com/pygame/pygame/pull/4035
                "${FILESDIR}/${P}-error.patch"
+               # https://github.com/pygame/pygame/pull/4236
+               "${FILESDIR}/${P}-gcc-14.patch"
        )
 
        # some numpy-related crash (not a regression)

Reply via email to