Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pygame_sdl2/files/, dev-python/pygame_sdl2/
Date: Thu, 10 Jan 2019 14:51:05
Message-Id: 1547131821.ce9cbff3c8210a0b96dc0b1317e747b6f136914e.bircoph@gentoo
1 commit: ce9cbff3c8210a0b96dc0b1317e747b6f136914e
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 10 14:49:44 2019 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 10 14:50:21 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce9cbff3
7
8 dev-python/pygame_sdl2: fix bug 635442
9
10 Add support for the latest sdl2-mixer API.
11
12 Closes: https://bugs.gentoo.org/635442
13 Package-Manager: Portage-2.3.54, Repoman-2.3.12
14 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
15
16 .../files/pygame_sdl2-6.99.12.4-mixer.patch | 43 +++++++++++++++++++++
17 .../pygame_sdl2/pygame_sdl2-6.99.12.4-r1.ebuild | 44 ++++++++++++++++++++++
18 2 files changed, 87 insertions(+)
19
20 diff --git a/dev-python/pygame_sdl2/files/pygame_sdl2-6.99.12.4-mixer.patch b/dev-python/pygame_sdl2/files/pygame_sdl2-6.99.12.4-mixer.patch
21 new file mode 100644
22 index 00000000000..1c3964afaa9
23 --- /dev/null
24 +++ b/dev-python/pygame_sdl2/files/pygame_sdl2-6.99.12.4-mixer.patch
25 @@ -0,0 +1,43 @@
26 +From ced6051f4a4559a725804cc58c079e1efea0a573 Mon Sep 17 00:00:00 2001
27 +From: Markus Koschany <apo@××××××.org>
28 +Date: Sat, 11 Nov 2017 23:00:25 +0100
29 +Subject: [PATCH] Fix build failure due to the removal of MIX_INIT_MODPLUG and
30 + the replacement of
31 +
32 +MIX_INIT_FLUIDSYNTH with MIX_INIT_MID.
33 +---
34 + include/sdl2_mixer.pxd | 3 +--
35 + src/pygame_sdl2/mixer.pyx | 4 ++--
36 + 2 files changed, 3 insertions(+), 4 deletions(-)
37 +
38 +diff --git a/include/sdl2_mixer.pxd b/include/sdl2_mixer.pxd
39 +index 0cea395..4bb0187 100644
40 +--- a/include/sdl2_mixer.pxd
41 ++++ b/include/sdl2_mixer.pxd
42 +@@ -18,10 +18,9 @@ cdef extern from "SDL_mixer.h" nogil:
43 + ctypedef enum MIX_InitFlags:
44 + MIX_INIT_FLAC
45 + MIX_INIT_MOD
46 +- MIX_INIT_MODPLUG
47 + MIX_INIT_MP3
48 + MIX_INIT_OGG
49 +- MIX_INIT_FLUIDSYNTH
50 ++ MIX_INIT_MID
51 +
52 + int Mix_Init(int flags)
53 + void Mix_Quit()
54 +diff --git a/src/pygame_sdl2/mixer.pyx b/src/pygame_sdl2/mixer.pyx
55 +index 3c5e185..bea5cbf 100644
56 +--- a/src/pygame_sdl2/mixer.pyx
57 ++++ b/src/pygame_sdl2/mixer.pyx
58 +@@ -81,8 +81,8 @@ def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096):
59 + if get_init() is not None:
60 + return
61 +
62 +- for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG,
63 +- MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH):
64 ++ for flag in (MIX_INIT_FLAC, MIX_INIT_MOD,
65 ++ MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_MID):
66 +
67 + if Mix_Init(flag) != flag:
68 + errors.append("{}\n".format(SDL_GetError()))
69
70 diff --git a/dev-python/pygame_sdl2/pygame_sdl2-6.99.12.4-r1.ebuild b/dev-python/pygame_sdl2/pygame_sdl2-6.99.12.4-r1.ebuild
71 new file mode 100644
72 index 00000000000..2f5df88d368
73 --- /dev/null
74 +++ b/dev-python/pygame_sdl2/pygame_sdl2-6.99.12.4-r1.ebuild
75 @@ -0,0 +1,44 @@
76 +# Copyright 1999-2019 Gentoo Authors
77 +# Distributed under the terms of the GNU General Public License v2
78 +
79 +EAPI=7
80 +
81 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
82 +inherit distutils-r1
83 +
84 +PYSDL="${PN}-2.1.0"
85 +
86 +DESCRIPTION="Reimplementation of portions of the pygame API using SDL2"
87 +HOMEPAGE="https://github.com/renpy/pygame_sdl2"
88 +SRC_URI="http://www.renpy.org/dl/${PV}/${PYSDL}-for-renpy-${PV}.tar.gz"
89 +
90 +LICENSE="LGPL-2.1 ZLIB"
91 +SLOT="0"
92 +KEYWORDS="~amd64 ~x86"
93 +IUSE=""
94 +
95 +BDEPEND="
96 + dev-python/cython[${PYTHON_USEDEP}]
97 +"
98 +DEPEND="
99 + dev-python/numpy[${PYTHON_USEDEP}]
100 + media-libs/libpng:0
101 + media-libs/libsdl2[video]
102 + media-libs/sdl2-image[png,jpeg]
103 + >=media-libs/sdl2-mixer-2.0.2
104 + media-libs/sdl2-ttf
105 + virtual/jpeg:62
106 +"
107 +RDEPEND="${DEPEND}"
108 +
109 +S=${WORKDIR}/${PYSDL}-for-renpy-${PV}
110 +
111 +PATCHES=( "${FILESDIR}/pygame_sdl2-6.99.12.4-mixer.patch" )
112 +
113 +# PyGame distribution for this version has some pregenerated files;
114 +# we need to remove them
115 +python_prepare_all()
116 +{
117 + rm -r "${S}"/gen{,3} || die
118 + distutils-r1_python_prepare_all
119 +}