From c52cf267fc4cd07db6bc1e345da47af8efc4bf3c2e713458a4722408d28110e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 29 May 2024 12:58:33 +0000 Subject: [PATCH] Accepting request 1177462 from home:glaubitz:branches:devel:languages:python - Cherry-pick upstream patch to fix build with GCC 14 * pygame-pr4236-gcc14.patch - Add python-Cython to BuildRequires - Switch upstream source to GitHub to avoid generated C code OBS-URL: https://build.opensuse.org/request/show/1177462 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygame?expand=0&rev=57 --- pygame-2.5.2.tar.gz | 4 ++-- pygame-pr4236-gcc14.patch | 38 ++++++++++++++++++++++++++++++++++++++ python-pygame.changes | 8 ++++++++ python-pygame.spec | 5 ++++- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 pygame-pr4236-gcc14.patch diff --git a/pygame-2.5.2.tar.gz b/pygame-2.5.2.tar.gz index 0c80db2..f888596 100644 --- a/pygame-2.5.2.tar.gz +++ b/pygame-2.5.2.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1b89eb5d539e7ac5cf75513125fb5f2f0a2d918b1fd6e981f23bf0ac1b1c24a -size 15788328 +oid sha256:46427b2b35060303b06a06a56c07a9e8e55b26cd4c434b792ed78244d2023e05 +size 5970857 diff --git a/pygame-pr4236-gcc14.patch b/pygame-pr4236-gcc14.patch new file mode 100644 index 0000000..2a84f2b --- /dev/null +++ b/pygame-pr4236-gcc14.patch @@ -0,0 +1,38 @@ +From 504a11fd4855e33ecb945af1270311aa463aae59 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ren=C3=A9=20Dudfield?= +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 = &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/python-pygame.changes b/python-pygame.changes index b9ebe82..32ad12a 100644 --- a/python-pygame.changes +++ b/python-pygame.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 29 07:56:43 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix build with GCC 14 + * pygame-pr4236-gcc14.patch +- Add python-Cython to BuildRequires +- Switch upstream source to GitHub to avoid generated C code + ------------------------------------------------------------------- Fri Mar 29 13:57:43 UTC 2024 - ecsos diff --git a/python-pygame.spec b/python-pygame.spec index 3deab28..2189c10 100644 --- a/python-pygame.spec +++ b/python-pygame.spec @@ -23,9 +23,12 @@ Release: 0 Summary: A Python Module for Interfacing with the SDL Multimedia Library License: Apache-2.0 AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND libpng-2.0 URL: https://github.com/pygame/pygame -Source0: https://files.pythonhosted.org/packages/source/p/pygame/pygame-%{version}.tar.gz +Source0: %{url}/archive/%{version}.tar.gz#/pygame-%{version}.tar.gz # PATCH-FIX-UPSTREAM pygame-pr4169-videodummytests.patch gh#pygame/pygame#4169 Patch0: pygame-pr4169-videodummytests.patch +# PATCH-FIX-UPSTREAM pygame-pr4236-gcc14.patch gh#pygame/pygame#4236 +Patch1: pygame-pr4236-gcc14.patch +BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy} BuildRequires: %{python_module pip}