From 04f0b7378b99aed246badbe072846936a6f2029f Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Tue, 17 Jan 2023 08:15:19 +0000 Subject: Adding metadata --- .../pygame/files/pygame-2.1.2-cython_only.patch | 36 ++++++++ .../files/pygame-2.1.2-libsdl2-2.26-tests.patch | 17 ++++ dev-python/pygame/pygame-2.1.2-r1.ebuild | 4 + dev-python/pygame/pygame-2.1.2-r2.ebuild | 95 ++++++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 dev-python/pygame/files/pygame-2.1.2-cython_only.patch create mode 100644 dev-python/pygame/files/pygame-2.1.2-libsdl2-2.26-tests.patch create mode 100644 dev-python/pygame/pygame-2.1.2-r2.ebuild (limited to 'dev-python/pygame') diff --git a/dev-python/pygame/files/pygame-2.1.2-cython_only.patch b/dev-python/pygame/files/pygame-2.1.2-cython_only.patch new file mode 100644 index 000000000000..4fb935dcf668 --- /dev/null +++ b/dev-python/pygame/files/pygame-2.1.2-cython_only.patch @@ -0,0 +1,36 @@ +Backport to ease running cythonize, DISTUTILS_ARGS=(cython) resulted in +reconfigure attempts that failed without PORTMIDI* being exported. + +https://github.com/pygame/pygame/commit/4eeffc049cf +From: Ankith <46915066+ankith26@users.noreply.github.com> +Date: Fri, 3 Jun 2022 21:27:57 +0530 +Subject: [PATCH] Add cython_only option to setup.py +--- a/setup.py ++++ b/setup.py +@@ -209,7 +209,16 @@ def consume_arg(name): + cflags += '-mfpu=neon' + os.environ['CFLAGS'] = cflags + ++compile_cython = False ++cython_only = False + if consume_arg('cython'): ++ compile_cython = True ++ ++if consume_arg('cython_only'): ++ compile_cython = True ++ cython_only = True ++ ++if compile_cython: + # compile .pyx files + # So you can `setup.py cython` or `setup.py cython install` + try: +@@ -280,6 +289,9 @@ def consume_arg(name): + for i, kwargs in enumerate(queue): + kwargs['progress'] = f'[{i + 1}/{count}] ' + cythonize_one(**kwargs) ++ ++ if cython_only: ++ sys.exit(0) + + no_compilation = any(x in ['lint', 'format', 'docs'] for x in sys.argv) + AUTO_CONFIG = not os.path.isfile('Setup') and not no_compilation diff --git a/dev-python/pygame/files/pygame-2.1.2-libsdl2-2.26-tests.patch b/dev-python/pygame/files/pygame-2.1.2-libsdl2-2.26-tests.patch new file mode 100644 index 000000000000..e231d1bf6d85 --- /dev/null +++ b/dev-python/pygame/files/pygame-2.1.2-libsdl2-2.26-tests.patch @@ -0,0 +1,17 @@ +https://github.com/pygame/pygame/commit/420c1a7341 +From: Starbuck5 <46412508+Starbuck5@users.noreply.github.com> +Date: Sat, 19 Nov 2022 21:17:32 -0800 +Subject: [PATCH] Adjust surface masks to create a proper 24 bit Surface + +The SDL 2.26.0 pre-release rejects a 24 bit Surface created with this mask, which is the right call, as it needs 32 bits of space. Older SDL went ahead and created a 32 bit surface anyway, which it probably shouldn't have. +--- a/test/surface_test.py ++++ b/test/surface_test.py +@@ -2023,7 +2023,7 @@ def test_get_losses(self): + mask8 = (224, 28, 3, 0) + mask15 = (31744, 992, 31, 0) + mask16 = (63488, 2016, 31, 0) +- mask24 = (4278190080, 16711680, 65280, 0) ++ mask24 = (16711680, 65280, 255, 0) + mask32 = (4278190080, 16711680, 65280, 255) + + # Surfaces with standard depths and masks diff --git a/dev-python/pygame/pygame-2.1.2-r1.ebuild b/dev-python/pygame/pygame-2.1.2-r1.ebuild index cb7239f695f1..083a0d4881ab 100644 --- a/dev-python/pygame/pygame-2.1.2-r1.ebuild +++ b/dev-python/pygame/pygame-2.1.2-r1.ebuild @@ -45,6 +45,10 @@ BDEPEND=" sys-apps/util-linux )" +PATCHES=( + "${FILESDIR}"/${P}-libsdl2-2.26-tests.patch +) + src_prepare() { if ! use midi; then rm test/midi_test.py || die diff --git a/dev-python/pygame/pygame-2.1.2-r2.ebuild b/dev-python/pygame/pygame-2.1.2-r2.ebuild new file mode 100644 index 000000000000..6b055f713aa2 --- /dev/null +++ b/dev-python/pygame/pygame-2.1.2-r2.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{7,8,9,10,11} ) + +inherit distutils-r1 + +DESCRIPTION="Python bindings for SDL multimedia library" +HOMEPAGE="https://www.pygame.org/" +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 midi opengl test X" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-python/numpy[${PYTHON_USEDEP}] + media-libs/freetype + media-libs/libjpeg-turbo:= + media-libs/libpng:= + media-libs/sdl2-image + media-libs/sdl2-mixer + media-libs/sdl2-ttf + midi? ( media-libs/portmidi ) + 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}-libsdl2-2.26-tests.patch + "${FILESDIR}"/${P}-cython_only.patch +) + +src_prepare() { + distutils-r1_src_prepare + + if ! use midi; then + rm test/midi_test.py || die + fi +} + +python_configure() { + PORTMIDI_INC_PORTTIME=1 LOCALBASE="${EPREFIX}/usr" \ + "${EPYTHON}" "${S}"/buildconfig/config.py -auto || die + + # Disable automagic dependency on PortMidi. + if ! use midi; then + sed -e "s:^pypm :#&:" -i Setup || die + fi +} + +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.3