Gentoo Archives: gentoo-commits

From: Slawek Lis <slis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/Kivy/files/, dev-python/Kivy/
Date: Wed, 03 Jan 2018 08:31:13
Message-Id: 1514968238.9297efe754fb1e7e470dfe3f1081f3dacb8fee46.slis@gentoo
1 commit: 9297efe754fb1e7e470dfe3f1081f3dacb8fee46
2 Author: Slawomir Lis <slis <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 3 08:30:38 2018 +0000
4 Commit: Slawek Lis <slis <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 3 08:30:38 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9297efe7
7
8 dev-python/Kivy: Patch fixing bug with sdl-mixer
9
10 Bug id: 636012
11
12 Package-Manager: Portage-2.3.19, Repoman-2.3.6
13
14 dev-python/Kivy/Kivy-1.10.0.ebuild | 6 +-
15 dev-python/Kivy/files/modplug-fix.patch | 109 ++++++++++++++++++++++++++++++++
16 2 files changed, 114 insertions(+), 1 deletion(-)
17
18 diff --git a/dev-python/Kivy/Kivy-1.10.0.ebuild b/dev-python/Kivy/Kivy-1.10.0.ebuild
19 index 8e2cb32ef0b..0a913ae26c1 100644
20 --- a/dev-python/Kivy/Kivy-1.10.0.ebuild
21 +++ b/dev-python/Kivy/Kivy-1.10.0.ebuild
22 @@ -1,4 +1,4 @@
23 -# Copyright 1999-2017 Gentoo Foundation
24 +# Copyright 1999-2018 Gentoo Foundation
25 # Distributed under the terms of the GNU General Public License v2
26
27 EAPI=6
28 @@ -38,6 +38,10 @@ DEPEND="${RDEPEND}
29
30 S="${WORKDIR}/${P,,}"
31
32 +PATCHES=(
33 + "${FILESDIR}/modplug-fix.patch"
34 +)
35 +
36 python_prepare_all() {
37 # sed -e '/data_files=/d' -i "${S}/setup.py" || die
38 # sed -e 's/PYTHON = python/PYTHON ?= python/' -i Makefile || die
39
40 diff --git a/dev-python/Kivy/files/modplug-fix.patch b/dev-python/Kivy/files/modplug-fix.patch
41 new file mode 100644
42 index 00000000000..18abe6e8f80
43 --- /dev/null
44 +++ b/dev-python/Kivy/files/modplug-fix.patch
45 @@ -0,0 +1,109 @@
46 +From 3b85f3e1c292b3f6c3f226490f52a2ab78251730 Mon Sep 17 00:00:00 2001
47 +From: Terje Skjaeveland <terje.skjaeveland@×××××.com>
48 +Date: Sun, 29 Oct 2017 12:35:46 +0100
49 +Subject: [PATCH] audio_sdl2: Update for mixer v2.0.2 support
50 +
51 +Flags MIX_INIT_MODPLUG was removed, and MIX_INIT_FLUIDSYNTH was
52 +renamed to MIX_INIT_MID.
53 +---
54 + kivy/core/audio/audio_sdl2.pyx | 45 +++++++++++++++++++++++++++++-------------
55 + kivy/lib/sdl2.pxi | 4 ++--
56 + 2 files changed, 33 insertions(+), 16 deletions(-)
57 +
58 +diff --git a/kivy/core/audio/audio_sdl2.pyx b/kivy/core/audio/audio_sdl2.pyx
59 +index 2ab569fe60..c6f26be5c8 100644
60 +--- a/kivy/core/audio/audio_sdl2.pyx
61 ++++ b/kivy/core/audio/audio_sdl2.pyx
62 +@@ -15,9 +15,23 @@ Depending the compilation of SDL2 mixer and/or installed libraries:
63 + * ogg since 1.9.1 (mixer needs libvorbis/libogg)
64 + * flac since 1.9.1 (mixer needs libflac)
65 + * mp3 since 1.9.1 (mixer needs libsmpeg/libmad; only use mad for GPL apps)
66 ++ * Since 1.10.1 + mixer 2.0.2, mpg123 can also be used
67 + * sequenced formats since 1.9.1 (midi, mod, s3m, etc. Mixer needs
68 + libmodplug or libmikmod)
69 +
70 ++.. Note::
71 ++
72 ++ Sequenced format support changed with mixer v2.0.2. If mixer is
73 ++ linked with one of libmodplug or libmikmod, format support for
74 ++ both libraries is assumed. This will work perfectly with formats
75 ++ upported by both libraries, but if you were to try to load an
76 ++ obscure format (like `apun` file with mikmod only), it will fail.
77 ++
78 ++ * Kivy <= 1.10.0: will fail to build with mixer >= 2.0.2
79 ++ will report correct format support with < 2.0.2
80 ++ * Kivy >= 1.10.1: will build with old and new mixer, and
81 ++ will "guesstimate" sequenced format support
82 ++
83 + .. Warning::
84 +
85 + Sequenced formats use the SDL2 Mixer music channel, you can only play
86 +@@ -57,8 +71,13 @@ cdef mix_init():
87 + mix_is_init = -1
88 + return 0
89 +
90 ++ # In mixer 2.0.2, MIX_INIT_MODPLUG is now implied by MIX_INIT_MOD,
91 ++ # and MIX_INIT_FLUIDSYNTH was renamed to MIX_INIT_MID. In previous
92 ++ # versions, we requested both _MODPLUG and _MOD + _FLUIDSYNTH.
93 ++ # 0x20 used to be MIX_INIT_FLUIDSYNTH, now MIX_INIT_MID
94 ++ # 0x4 used to be MIX_INIT_MODPLUG before 2.0.2
95 + want_flags = MIX_INIT_FLAC | MIX_INIT_OGG | MIX_INIT_MP3
96 +- want_flags |= MIX_INIT_MOD | MIX_INIT_MODPLUG | MIX_INIT_FLUIDSYNTH
97 ++ want_flags |= MIX_INIT_MOD | 0x20 | 0x4
98 +
99 + mix_flags = Mix_Init(want_flags)
100 +
101 +@@ -244,25 +263,23 @@ class MusicSDL2(Sound):
102 + @staticmethod
103 + def extensions():
104 + mix_init()
105 ++ # FIXME: this should probably evolve to use the new has_music()
106 ++ # interface to determine format support
107 +
108 + # Assume native midi support (defaults to enabled), but may use
109 + # modplug, fluidsynth or timidity in reality. It may also be
110 + # disabled completely, in which case loading it will fail
111 + extensions = set(['mid', 'midi'])
112 +
113 +- # libmodplug, may be incomplete
114 +- if mix_flags & MIX_INIT_MODPLUG:
115 +- extensions.update(['669', 'abc', 'amf', 'ams', 'dbm', 'dmf',
116 +- 'dsm', 'far', 'it', 'j2b', 'mdl', 'med',
117 +- 'mod', 'mt2', 'mtm', 'okt', 'pat', 'psm',
118 +- 'ptm', 's3m', 'stm', 'ult', 'umx', 'xm'])
119 +-
120 +- # libmikmod, may be incomplete
121 +- if mix_flags & MIX_INIT_MOD:
122 +- extensions.update(['669', 'amf', 'apun', 'dsm', 'far', 'gdm',
123 +- 'gt2', 'it', 'med', 'mod', 'mtm', 'okt',
124 +- 's3m', 'stm', 'stx', 'ult', 'umx', 'uni',
125 +- 'xm'])
126 ++ # libmodplug and libmikmod, may be incomplete.
127 ++ # 0x4 is for mixer < 2.0.2, MIX_INIT_MODPLUG
128 ++ if mix_flags & (MIX_INIT_MOD | 0x4):
129 ++ extensions.update(['669', 'abc', 'amf', 'ams', 'apun', 'dbm',
130 ++ 'dmf', 'dsm', 'far', 'gdm', 'it', 'j2b',
131 ++ 'mdl', 'med', 'mod', 'mt2', 'mtm', 'okt',
132 ++ 'pat', 'psm', 'ptm', 's3m', 'stm', 'stx',
133 ++ 'ult', 'umx', 'uni', 'xm'])
134 ++
135 + return list(extensions)
136 +
137 + def __init__(self, **kwargs):
138 +diff --git a/kivy/lib/sdl2.pxi b/kivy/lib/sdl2.pxi
139 +index 07d055c903..ad62ce8023 100644
140 +--- a/kivy/lib/sdl2.pxi
141 ++++ b/kivy/lib/sdl2.pxi
142 +@@ -881,10 +881,10 @@ cdef extern from "SDL_mixer.h":
143 + ctypedef enum MIX_InitFlags:
144 + MIX_INIT_FLAC = 0x00000001
145 + MIX_INIT_MOD = 0x00000002
146 +- MIX_INIT_MODPLUG = 0x00000004
147 ++ MIX_INIT_MODPLUG = 0x00000004 # Removed in mixer 2.0.2
148 + MIX_INIT_MP3 = 0x00000008
149 + MIX_INIT_OGG = 0x00000010
150 +- MIX_INIT_FLUIDSYNTH = 0x00000020
151 ++ MIX_INIT_MID = 0x00000020 # Previously _FLUIDSYNTH
152 +
153 + cdef int MIX_MAX_VOLUME
154 +