dev-python/PySDL2: Remove redundant versions

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2020-07-12 18:40:56 +02:00
parent 7abcede2ea
commit 76d5baef30
4 changed files with 0 additions and 140 deletions

View File

@@ -1,2 +1 @@
DIST PySDL2-0.9.6.tar.gz 1048158 BLAKE2B 70a450990dd73169489af2d5b218eea0794c9f75948d774680df4b4423855318ddc6d16a0453f62361d4f0b81e872edc067235c4f946476ea8988e16cd0de44c SHA512 676b1b3381b614122442c70fe4cbd7c210ef3d8695c2babd37938e67b5cfeb2f8acbdcb914c5f68aceb549d89f7a77bdc80c7406b340b0e38c22543df8d46739
DIST PySDL2-0.9.7.tar.gz 1079253 BLAKE2B 986a21d8c2f4f45df683d85a8369be7b39f102e59a1b3fd37e2941065a1174d5cd6dd056f78fbc66663e2cf50228ee40abf67352e5ae75176a9c000fb6f672fb SHA512 10d40063762272eaaae1cb6290e007481887806938ba0ba17d28974a3a3c8b36570054587001d00eb9ab4aa2375c616c43a81c7e7308fbb9b61b55b3eb7da5ac

View File

@@ -1,66 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
DISTUTILS_USE_SETUPTOOLS=no
PYTHON_COMPAT=( python3_{6,7} )
inherit distutils-r1
DESCRIPTION="Python (ctypes) bindings for SDL2 libraries"
HOMEPAGE="https://github.com/marcusva/py-sdl2 https://pypi.org/project/PySDL2/"
SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz"
LICENSE="|| ( public-domain CC0-1.0 ZLIB )"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
# Optional deps:
# - dev-python/numpy,
# - dev-python/pillow,
# - media-libs/sdl2-* (loaded dynamically via ctypes).
#
# If a reverse dependency needs the specific module, it should
# explicitly depend on the optional module in question. You also
# probably need to explicitly require some media-libs/libsdl2 flags.
RDEPEND="media-libs/libsdl2"
# Require all of SDL2 libraries and at least the most common subsystems
# for better test coverage.
DEPEND="
test? (
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/pillow[${PYTHON_USEDEP}]
media-libs/libsdl2[joystick,sound,video]
media-libs/sdl2-gfx
media-libs/sdl2-image
media-libs/sdl2-mixer
media-libs/sdl2-ttf
)"
PATCHES=(
# fix tests to allow newer versions of libsdl2
"${FILESDIR}"/PySDL2-0.9.6-0001-test-Always-allow-greater-patch-version-of-SDL2.patch
# fix tests to handle missing haptic support gracefully
"${FILESDIR}"/PySDL2-0.9.6-0002-test-Handle-missing-haptic-support-gracefully.patch
)
src_prepare() {
# tarball uses DOS line endings
find '(' -name '*.py' -o -name '*.rst' -o -name '*.txt' ')' \
-type f -exec sed -i -e 's/\r$//' {} + || die
distutils-r1_src_prepare
}
python_test() {
# from .travis.yml
local -x SDL_VIDEODRIVER=dummy
local -x SDL_AUDIODRIVER=dummy
local -x SDL_RENDER_DRIVER=software
"${PYTHON}" -m unittest discover -v \
-s sdl2/test -p '*_test.py' || die "Tests fail with ${EPYTHON}"
}

View File

@@ -1,47 +0,0 @@
From d34a898bb8d8bfd9cb4a85ff880826e4c7f2b0f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 1 Jan 2018 12:31:52 +0100
Subject: [PATCH 1/2] test: Always allow greater patch-version of SDL2
Similarly to sdlimage_test, allow newer patch-version of other SDL2
libraries. There is no technical reason to prevent people from upgrading
libsdl2 while having old PySDL2 installed, and there is no reason to
make tests fail every time libsdl2 happens to be upgraded.
(backported for 0.9.6)
Closes: https://github.com/marcusva/py-sdl2/issues/115
---
sdl2/test/sdlmixer_test.py | 2 +-
sdl2/test/version_test.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sdl2/test/sdlmixer_test.py b/sdl2/test/sdlmixer_test.py
index 00c2ca6..1cebe55 100644
--- a/sdl2/test/sdlmixer_test.py
+++ b/sdl2/test/sdlmixer_test.py
@@ -27,7 +27,7 @@ class SDLMixerTest(unittest.TestCase):
self.assertIsInstance(v.contents, version.SDL_version)
self.assertEqual(v.contents.major, 2)
self.assertEqual(v.contents.minor, 0)
- self.assertEqual(v.contents.patch, 1)
+ self.assertGreaterEqual(v.contents.patch, 1)
if __name__ == '__main__':
sys.exit(unittest.main())
diff --git a/sdl2/test/version_test.py b/sdl2/test/version_test.py
index 51b5065..60e5bcf 100644
--- a/sdl2/test/version_test.py
+++ b/sdl2/test/version_test.py
@@ -25,7 +25,7 @@ class SDLVersionTest(unittest.TestCase):
self.assertEqual(type(v), version.SDL_version)
self.assertEqual(v.major, 2)
self.assertEqual(v.minor, 0)
- self.assertEqual(v.patch, 6)
+ self.assertGreaterEqual(v.patch, 6)
def test_SDL_VERSIONNUM(self):
self.assertEqual(version.SDL_VERSIONNUM(1, 2, 3), 1203)
--
2.16.0.rc0

View File

@@ -1,26 +0,0 @@
From 4a38a0ef4c13ec3c518b78c0e56550fb8af43119 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 1 Jan 2018 13:29:16 +0100
Subject: [PATCH 2/2] test: Handle missing haptic support gracefully
---
sdl2/test/sdl_test.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sdl2/test/sdl_test.py b/sdl2/test/sdl_test.py
index 70c2e98..402e549 100644
--- a/sdl2/test/sdl_test.py
+++ b/sdl2/test/sdl_test.py
@@ -47,7 +47,8 @@ class SDLTest(unittest.TestCase):
"FreeBSD des not support haptic input yet")
def test_SDL_INIT_HAPTIC(self):
ret = SDL_Init(SDL_INIT_HAPTIC)
- self.assertEqual(ret, 0, SDL_GetError())
+ if ret != 0:
+ self.skipTest('Haptic subsystem not supported')
ret = SDL_WasInit(SDL_INIT_HAPTIC)
self.assertEqual(ret, SDL_INIT_HAPTIC)
SDL_QuitSubSystem(SDL_INIT_HAPTIC)
--
2.16.0.rc0