summaryrefslogtreecommitdiff
path: root/dev-python/PySDL2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/PySDL2
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/PySDL2')
-rw-r--r--dev-python/PySDL2/Manifest5
-rw-r--r--dev-python/PySDL2/PySDL2-0.9.6.ebuild64
-rw-r--r--dev-python/PySDL2/files/PySDL2-0.9.6-0001-test-Always-allow-greater-patch-version-of-SDL2.patch47
-rw-r--r--dev-python/PySDL2/files/PySDL2-0.9.6-0002-test-Handle-missing-haptic-support-gracefully.patch26
-rw-r--r--dev-python/PySDL2/metadata.xml15
5 files changed, 157 insertions, 0 deletions
diff --git a/dev-python/PySDL2/Manifest b/dev-python/PySDL2/Manifest
new file mode 100644
index 000000000000..a0536f624ac2
--- /dev/null
+++ b/dev-python/PySDL2/Manifest
@@ -0,0 +1,5 @@
+AUX PySDL2-0.9.6-0001-test-Always-allow-greater-patch-version-of-SDL2.patch 1812 BLAKE2B 7551d27fe1044d9a7bbe741fd70417f3f180d722915e53ff4374efc5575c70c8171cf4032d26e3b7703eb39e7da4998c6d867447a5338c76897ae84e598192ac SHA512 1a26d4db26b5fbc3c259c110825dbefa272e5c565928d041951438d1ed2012a67b3a06b2158b1c2a7c57685ab6e22363c3841e8bb3bf2e54ea21553b386c89cf
+AUX PySDL2-0.9.6-0002-test-Handle-missing-haptic-support-gracefully.patch 950 BLAKE2B e4baf35535ff37a845ba65127d6e580d2c5086e60df0d03a6939b5fee7dac860475503b01644097d9af2a21209e25258524f0feacd45729574034095615ecaf3 SHA512 50b1785d02290ce9544743cea245e216f8cbbadaf9dfc0c865fadd21e1beea88a64d89a304bcfb72e8b2cc19a961fba3c23de028b7caf7e16739f9665dd9aa1a
+DIST PySDL2-0.9.6.tar.gz 1048158 BLAKE2B 70a450990dd73169489af2d5b218eea0794c9f75948d774680df4b4423855318ddc6d16a0453f62361d4f0b81e872edc067235c4f946476ea8988e16cd0de44c SHA512 676b1b3381b614122442c70fe4cbd7c210ef3d8695c2babd37938e67b5cfeb2f8acbdcb914c5f68aceb549d89f7a77bdc80c7406b340b0e38c22543df8d46739
+EBUILD PySDL2-0.9.6.ebuild 1861 BLAKE2B fe6bcd721710c794428de82b12a7eac27bfa2e4d5998284d6983f8f270ca8cbf2fe10a0db7d0d87dd508ad3c9b9c742dc554def15ac558bd2ac3c1641fab612b SHA512 dfe479437a029a158db556839d9a2fbacc47fc4faf534fdb4ab056cdb0a6c45dc8d7fe4697bc509104b4fa9364aa65b82c3487781a74bcef86f8a423e1246e95
+MISC metadata.xml 451 BLAKE2B 2bc91faee3235d8d971aaba13051362ffe22563c5bc5a33a4dcaa0fa59abb7f238310d271a5311c98d4f69b112f731e11d1c8c49fa1a1d2bed1a5acf36c905f5 SHA512 50ba020088e640ca59a7ab64e30ff760b4708866ebc54b91fa2a12e4408463ebb0b04cfe990113bb7f556cbe8a4fc369fe86e3da4ec5b79a76752868cd08a62c
diff --git a/dev-python/PySDL2/PySDL2-0.9.6.ebuild b/dev-python/PySDL2/PySDL2-0.9.6.ebuild
new file mode 100644
index 000000000000..77afc908e4e3
--- /dev/null
+++ b/dev-python/PySDL2/PySDL2-0.9.6.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_{4,5,6}} )
+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"
+
+# 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}"
+}
diff --git a/dev-python/PySDL2/files/PySDL2-0.9.6-0001-test-Always-allow-greater-patch-version-of-SDL2.patch b/dev-python/PySDL2/files/PySDL2-0.9.6-0001-test-Always-allow-greater-patch-version-of-SDL2.patch
new file mode 100644
index 000000000000..0b72f9036637
--- /dev/null
+++ b/dev-python/PySDL2/files/PySDL2-0.9.6-0001-test-Always-allow-greater-patch-version-of-SDL2.patch
@@ -0,0 +1,47 @@
+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
+
diff --git a/dev-python/PySDL2/files/PySDL2-0.9.6-0002-test-Handle-missing-haptic-support-gracefully.patch b/dev-python/PySDL2/files/PySDL2-0.9.6-0002-test-Handle-missing-haptic-support-gracefully.patch
new file mode 100644
index 000000000000..2b03fed4d09d
--- /dev/null
+++ b/dev-python/PySDL2/files/PySDL2-0.9.6-0002-test-Handle-missing-haptic-support-gracefully.patch
@@ -0,0 +1,26 @@
+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
+
diff --git a/dev-python/PySDL2/metadata.xml b/dev-python/PySDL2/metadata.xml
new file mode 100644
index 000000000000..dbc51f1b9563
--- /dev/null
+++ b/dev-python/PySDL2/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">marcusva/py-sdl2</remote-id>
+ <remote-id type="pypi">PySDL2</remote-id>
+ </upstream>
+</pkgmetadata>