From 5e0a5ca921524f8859808527a57655eec16efa52 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 18 Jul 2023 00:58:25 +0100 Subject: gentoo auto-resync : 18:07:2023 - 00:58:24 --- dev-python/pygame/Manifest | 2 + .../pygame/files/pygame-2.5.0-cython-3.patch | 214 +++++++++++++++++++++ dev-python/pygame/pygame-2.5.0-r1.ebuild | 92 +++++++++ 3 files changed, 308 insertions(+) create mode 100644 dev-python/pygame/files/pygame-2.5.0-cython-3.patch create mode 100644 dev-python/pygame/pygame-2.5.0-r1.ebuild (limited to 'dev-python/pygame') diff --git a/dev-python/pygame/Manifest b/dev-python/pygame/Manifest index 147287b74bb8..8676b26b5b25 100644 --- a/dev-python/pygame/Manifest +++ b/dev-python/pygame/Manifest @@ -1,4 +1,5 @@ AUX pygame-2.1.2-libsdl2-2.26-tests.patch 889 BLAKE2B b676d4f591041858492df2cbe087aa051b7ba3dd9d0480d9afdc878412fa6613131f8ab8f78c055f0cdf014627ba42dc9c4118798c81a8365f457225af231282 SHA512 8577b3f39828d65db0b08ed3c59d15a6de26d0f0f1bb085137c4a5a97aa0498cb9572292bca87ae2162316a001f8d9ddf5834626dc0af8162194ae483091d68c +AUX pygame-2.5.0-cython-3.patch 8237 BLAKE2B 3de903f00f59a98f332e19ed55c0082980cd08a52ce697863e168be7af0db33c17546ed01d2ccd94ad957d57b7e094b769e4ab300974a5f97275cdfb5c816525 SHA512 f7336dea50f62ba1b2d6d0f19a24a73e776907e42a8d7ddd966f484c6660e5bb079030f174c9bf2d53eae52e80aadee4b46eb057be4d8937480d09610320d9dc DIST pygame-2.1.3.gh.tar.gz 6517003 BLAKE2B 9f2062b24ef2e97995207fbf7572a8aa4d3475356e8646356758ad72b0b744fcf911adaa78bb730ed43c95fa23b8ed733a5573882bd83e112ae5e7e6ef099de9 SHA512 28f46826f58f73607b28c1411c6f2b71796cd4f98103df2dd47db842f578fe7f26dac01cb60d1cb00ac9dacfa62c6c3b913a244379ce70bd03265424e29052e6 DIST pygame-2.2.0.gh.tar.gz 6530469 BLAKE2B 301b8decd7afe7ad44d97b086ad27209a084884993122f0c8d6973e718cb811587aa2e2c34b5e9fc5859410ced4c298b24127b4bf166dbeaa225b5c731c66cb6 SHA512 212e0f6390fa84f4fbcb3051ecb83c324a59d7591fd216a0f17946a581cf01540116162357b41004a387fbd3395e030a5a6d5f804496d84558125f512c9c2617 DIST pygame-2.3.0.gh.tar.gz 6547956 BLAKE2B 3189dc5dda7e5fc12fe2091af304816d905a24a33f6f43070040b90bd1bac1191fe6fe1a738ccfda49b5d9b472a704962c3b6aa7d8b99bc67e15317a9df06a2b SHA512 ed93cf5f0fac67b8a03f25f514ac71bf9b9a97f4df30efca9e3225396769e7616d3ce1063e6cc6ee3f4e6f1327154a9e0ec4e81b179578118af3a140bb1543bd @@ -8,5 +9,6 @@ EBUILD pygame-2.1.3.ebuild 1975 BLAKE2B 9d8d7ebb593c89452536e91989833bae2d208a15 EBUILD pygame-2.2.0.ebuild 1912 BLAKE2B 31fdebb9c749217a33ba81ae930e5dfd27d5d1b7df75cb2874640ec7ce1c8610871ff72687b0f4e0fd1d5f4e494c5f7106a6307a1762329e4244030f15986390 SHA512 ddef31ada30a32e9ae3c57c0fe05ebba44b226bffe186728f5b5759fbe8340625a9494b3e3f77cdceeb60a39faffdd73041f5cadfc6a5eda0044164b93c5018f EBUILD pygame-2.3.0.ebuild 1912 BLAKE2B 31fdebb9c749217a33ba81ae930e5dfd27d5d1b7df75cb2874640ec7ce1c8610871ff72687b0f4e0fd1d5f4e494c5f7106a6307a1762329e4244030f15986390 SHA512 ddef31ada30a32e9ae3c57c0fe05ebba44b226bffe186728f5b5759fbe8340625a9494b3e3f77cdceeb60a39faffdd73041f5cadfc6a5eda0044164b93c5018f EBUILD pygame-2.4.0.ebuild 1931 BLAKE2B d17408e670610ab2bda594be78bd74818da1ebe7a48a6b4f577ba28041b163d3068f4b69d3277bab0584466646f8e4fc63c2bf7d436e4105e7d8621531b4790f SHA512 92b68a0a45822df698fe5cfb79275ac96a42ed7e32c152604c715819129d79c021113b6476c8b36d2c3f92f6414fea668b4c8fed71edf1e2f13894b4208fb9d9 +EBUILD pygame-2.5.0-r1.ebuild 1981 BLAKE2B 5b707865f3cc7689f042ee4d322721ce1dde50ef2c95d170fbcd6ee04f9637bdad631994129e68f68a900473a52e3173d47dd70bb845a5a344d4a291bd26ecc8 SHA512 3f7d4ac14d50ffde1e0c181bd5108f05d593800c1af960a48e00df7d1c90aadc35aae82b9a0db9c6a6a740b8d411a83e84e0d2357dfe5081f6f9557cb0bbfdb2 EBUILD pygame-2.5.0.ebuild 1936 BLAKE2B 416bbfdfb8c6a09ce228b7a123928f1d70deba416d6c46f445955a439965ad951bcb83fe80d557406cde0c84de99648a65bc44f4b4d877a70a81b98b8a3e23dc SHA512 b0693da90ad40b471e7897cdb315d95005f297fef58fe900eddaca1d1c1a24202d175466b5e5416f51b081e046f391d758150d932b7da6063dbe77a9e06c5503 MISC metadata.xml 363 BLAKE2B a942b91aded22ec850a7b075703ce4037af9f0a61155717ac455f7d2b7779cb6f5f953b2ad8d61d7cc5254307951a20dd3edb9853e21d907e1999f7570a6b821 SHA512 15403754c9b13f9b2d8c5e7615ae0ca9359b5079e22eb5a7049424e414ebbdd8a06f6324c31594636324414e35ca34bec977b7dded9f9ea14027497b5097b060 diff --git a/dev-python/pygame/files/pygame-2.5.0-cython-3.patch b/dev-python/pygame/files/pygame-2.5.0-cython-3.patch new file mode 100644 index 000000000000..48e48e738ab3 --- /dev/null +++ b/dev-python/pygame/files/pygame-2.5.0-cython-3.patch @@ -0,0 +1,214 @@ +https://bugs.gentoo.org/898704 +https://github.com/pygame/pygame/issues/3938 +https://github.com/pygame/pygame/pull/3956 +https://github.com/pygame/pygame/commit/bff1ba00fa58de40d357d70ba645be2957593b69 + +From bff1ba00fa58de40d357d70ba645be2957593b69 Mon Sep 17 00:00:00 2001 +From: Matus Valo +Date: Wed, 12 Jul 2023 01:26:21 +0200 +Subject: [PATCH] Mark functions as noexcept + +--- a/src_c/cython/pygame/_sdl2/audio.pyx ++++ b/src_c/cython/pygame/_sdl2/audio.pyx +@@ -67,7 +67,7 @@ def get_audio_device_names(iscapture = False): + return names + + import traceback +-cdef void recording_cb(void* userdata, Uint8* stream, int len) nogil: ++cdef void recording_cb(void* userdata, Uint8* stream, int len) noexcept nogil: + """ This is called in a thread made by SDL. + So we need the python GIL to do python stuff. + """ +--- a/src_c/cython/pygame/_sdl2/controller.pxd ++++ b/src_c/cython/pygame/_sdl2/controller.pxd +@@ -101,8 +101,8 @@ cdef extern from "../controllercompat.c" nogil: + Uint16 high_frequency_rumble, + Uint32 duration_ms) + +-cdef bint _controller_autoinit() +-cdef void _controller_autoquit() ++cdef bint _controller_autoinit() noexcept ++cdef void _controller_autoquit() noexcept + + cdef class Controller: + cdef SDL_GameController* _controller +--- a/src_c/cython/pygame/_sdl2/controller.pyx ++++ b/src_c/cython/pygame/_sdl2/controller.pyx +@@ -17,14 +17,14 @@ def _gamecontroller_init_check(): + if not SDL_WasInit(_SDL_INIT_GAMECONTROLLER): + raise error("gamecontroller system not initialized") + +-cdef bint _controller_autoinit(): ++cdef bint _controller_autoinit() noexcept: + if not SDL_WasInit(_SDL_INIT_GAMECONTROLLER): + if SDL_InitSubSystem(_SDL_INIT_GAMECONTROLLER): + return False + #pg_RegisterQuit(_controller_autoquit) + return True + +-cdef void _controller_autoquit(): ++cdef void _controller_autoquit() noexcept: + cdef Controller controller + for c in Controller._controllers: + controller = c +--- a/src_c/cython/pygame/_sdl2/mixer.pxd ++++ b/src_c/cython/pygame/_sdl2/mixer.pxd +@@ -5,7 +5,7 @@ from .sdl2 cimport * + + #https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC79 + +-ctypedef void (*mixcallback)(void *udata, Uint8 *stream, int len) nogil ++ctypedef void (*mixcallback)(void *udata, Uint8 *stream, int len) noexcept nogil + + cdef extern from "SDL_mixer.h" nogil: + ctypedef void (*mix_func)(void *udata, Uint8 *stream, int len) +--- a/src_c/cython/pygame/_sdl2/mixer.pyx ++++ b/src_c/cython/pygame/_sdl2/mixer.pyx +@@ -14,7 +14,7 @@ import traceback + # Mix_SetPostMix(noEffect, NULL); + + +-cdef void recording_cb(void* userdata, Uint8* stream, int len) nogil: ++cdef void recording_cb(void* userdata, Uint8* stream, int len) noexcept nogil: + """ This is called in a thread made by SDL. + So we need the python GIL to do python stuff. + """ +--- a/src_c/cython/pygame/_sdl2/video.pxd ++++ b/src_c/cython/pygame/_sdl2/video.pxd +@@ -430,7 +430,7 @@ cdef class Texture: + cdef draw_internal(self, SDL_Rect *csrcrect, SDL_Rect *cdstrect, float angle=*, SDL_Point *originptr=*, + bint flip_x=*, bint flip_y=*) + cpdef void draw(self, srcrect=*, dstrect=*, float angle=*, origin=*, +- bint flip_x=*, bint flip_y=*) ++ bint flip_x=*, bint flip_y=*) noexcept + + cdef class Image: + cdef Color _color +@@ -445,4 +445,4 @@ cdef class Image: + cdef public Texture texture + cdef public Rect srcrect + +- cpdef void draw(self, srcrect=*, dstrect=*) ++ cpdef void draw(self, srcrect=*, dstrect=*) noexcept +--- a/src_c/cython/pygame/_sdl2/video.pyx ++++ b/src_c/cython/pygame/_sdl2/video.pyx +@@ -731,7 +731,7 @@ cdef class Texture: + raise error() + + cpdef void draw(self, srcrect=None, dstrect=None, float angle=0, origin=None, +- bint flip_x=False, bint flip_y=False): ++ bint flip_x=False, bint flip_y=False) noexcept: + """ Copy a portion of the texture to the rendering target. + + :param srcrect: source rectangle on the texture, or None for the entire texture. +@@ -904,7 +904,7 @@ cdef class Image: + def get_rect(self): + return pgRect_New(&self.srcrect.r) + +- cpdef void draw(self, srcrect=None, dstrect=None): ++ cpdef void draw(self, srcrect=None, dstrect=None) noexcept: + """ Copy a portion of the image to the rendering target. + + :param srcrect: source rectangle specifying a sub-image, or None for the entire image. +--- a/src_c/cython/pygame/_sprite.pyx ++++ b/src_c/cython/pygame/_sprite.pyx +@@ -188,10 +188,10 @@ cdef class Sprite: + else: + self.remove(*group) + +- cpdef void add_internal(self, group): ++ cpdef void add_internal(self, group) noexcept: + self.__g.add(group) + +- cpdef void remove_internal(self, group): ++ cpdef void remove_internal(self, group) noexcept: + self.__g.remove(group) + + def update(self, *args, **kwargs): +@@ -346,16 +346,16 @@ cdef class AbstractGroup: + """ + return list(self.spritedict) + +- cpdef void add_internal(self, sprite): ++ cpdef void add_internal(self, sprite) noexcept: + self.spritedict[sprite] = 0 + +- cpdef void remove_internal(self, sprite): ++ cpdef void remove_internal(self, sprite) noexcept: + r = self.spritedict[sprite] + if r: + self.lostsprites.append(r) + del self.spritedict[sprite] + +- cpdef bint has_internal(self, sprite): ++ cpdef bint has_internal(self, sprite) noexcept: + return sprite in self.spritedict + + def copy(self): +@@ -650,11 +650,11 @@ cdef class OrderedUpdates(RenderUpdates): + cpdef list sprites(self): + return list(self._spritelist) + +- cpdef void add_internal(self, sprite): ++ cpdef void add_internal(self, sprite) noexcept: + RenderUpdates.add_internal(self, sprite) + self._spritelist.append(sprite) + +- cpdef void remove_internal(self, sprite): ++ cpdef void remove_internal(self, sprite) noexcept: + RenderUpdates.remove_internal(self, sprite) + self._spritelist.remove(sprite) + +@@ -697,7 +697,7 @@ cdef class LayeredUpdates(AbstractGroup): + + self.add(*sprites, **kwargs) + +- cpdef void add_internal(self, sprite, layer=None): ++ cpdef void add_internal(self, sprite, layer=None) noexcept: + """Do not use this method directly. + + It is used by the group to add a sprite internally. +@@ -779,7 +779,7 @@ cdef class LayeredUpdates(AbstractGroup): + self.add_internal(sprite, layer) + sprite.add_internal(self) + +- cpdef void remove_internal(self, sprite): ++ cpdef void remove_internal(self, sprite) noexcept: + """Do not use this method directly. + + The group uses it to add a sprite. +@@ -1059,7 +1059,7 @@ cdef class LayeredDirty(LayeredUpdates): + if hasattr(self, key): + setattr(self, key, val) + +- cpdef void add_internal(self, sprite, layer=None): ++ cpdef void add_internal(self, sprite, layer=None) noexcept: + """Do not use this method directly. + + It is used by the group to add a sprite internally. +@@ -1333,7 +1333,7 @@ cdef class GroupSingle(AbstractGroup): + else: + return [] + +- cpdef void add_internal(self, sprite): ++ cpdef void add_internal(self, sprite) noexcept: + if self.__sprite is not None: + self.__sprite.remove_internal(self) + self.remove_internal(self.__sprite) +@@ -1355,13 +1355,13 @@ cdef class GroupSingle(AbstractGroup): + None, + "The sprite contained in this group") + +- cpdef void remove_internal(self, sprite): ++ cpdef void remove_internal(self, sprite) noexcept: + if sprite is self.__sprite: + self.__sprite = None + if sprite in self.spritedict: + AbstractGroup.remove_internal(self, sprite) + +- cpdef bint has_internal(self, sprite): ++ cpdef bint has_internal(self, sprite) noexcept: + return self.__sprite is sprite + + # Optimizations... + diff --git a/dev-python/pygame/pygame-2.5.0-r1.ebuild b/dev-python/pygame/pygame-2.5.0-r1.ebuild new file mode 100644 index 000000000000..1c0320737094 --- /dev/null +++ b/dev-python/pygame/pygame-2.5.0-r1.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..11} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Python bindings for SDL multimedia library" +HOMEPAGE=" + https://www.pygame.org/ + https://github.com/pygame/pygame/ + https://pypi.org/project/pygame/ +" +SRC_URI=" + https://github.com/pygame/pygame/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="examples opengl test X" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-python/numpy[${PYTHON_USEDEP}] + media-libs/freetype + media-libs/libjpeg-turbo:= + media-libs/libpng:= + media-libs/portmidi + media-libs/sdl2-image + media-libs/sdl2-mixer + media-libs/sdl2-ttf + X? ( media-libs/libsdl2[opengl?,threads,video,X] ) + !X? ( media-libs/libsdl2[threads] ) +" +DEPEND=" + ${RDEPEND} + test? ( + media-libs/sdl2-image[gif,jpeg,png,tiff,webp] + media-libs/sdl2-mixer[mp3,vorbis,wav] + ) +" +# fontconfig used for fc-list +RDEPEND+=" + media-libs/fontconfig +" +# util-linux provides script +BDEPEND=" + dev-python/cython[${PYTHON_USEDEP}] + test? ( + media-libs/fontconfig + sys-apps/util-linux + ) +" + +PATCHES=( + "${FILESDIR}"/${P}-cython-3.patch +) + +python_configure() { + PORTMIDI_INC_PORTTIME=1 LOCALBASE="${EPREFIX}/usr" \ + "${EPYTHON}" "${S}"/buildconfig/config.py || die +} + +python_configure_all() { + find src_c/cython -name '*.pyx' -exec touch {} + || die + "${EPYTHON}" setup.py cython_only || die +} + +python_test() { + local -x PYTHONPATH=${BUILD_DIR}/install/lib + local -x SDL_VIDEODRIVER=dummy + local -x SDL_AUDIODRIVER=disk + script -eqc "${EPYTHON} -m pygame.tests -v" || die +} + +python_install() { + distutils-r1_python_install + + # Bug #497720 + rm -fr "${D}$(python_get_sitedir)"/pygame/{docs,examples,tests}/ || die +} + +python_install_all() { + distutils-r1_python_install_all + use examples && dodoc -r examples +} -- cgit v1.2.3