1 |
commit: 33ffa7fb1ba486448a52409fd1104ddc206a4eda |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 29 00:38:34 2022 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 29 00:39:03 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33ffa7fb |
7 |
|
8 |
dev-python/mido: new package, add 1.2.10 |
9 |
|
10 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
11 |
|
12 |
dev-python/mido/Manifest | 1 + |
13 |
.../python-rtmidi-1.4.9-unbundle_rtmidi.patch | 60 ++++++++++++++++++++++ |
14 |
dev-python/mido/metadata.xml | 16 ++++++ |
15 |
dev-python/mido/mido-1.2.10.ebuild | 27 ++++++++++ |
16 |
4 files changed, 104 insertions(+) |
17 |
|
18 |
diff --git a/dev-python/mido/Manifest b/dev-python/mido/Manifest |
19 |
new file mode 100644 |
20 |
index 000000000000..49be2c8dad04 |
21 |
--- /dev/null |
22 |
+++ b/dev-python/mido/Manifest |
23 |
@@ -0,0 +1 @@ |
24 |
+DIST mido-1.2.10.tar.gz 103070 BLAKE2B 84e39cd7f52947f50dc31bac5abb7752e736c867817fbd711e768f1ef182990671633c24bb5726fb428f312f2497d15da560b307ddfeea3399d06330183e9668 SHA512 f21040acda9d084b7449ba52c3d036c637a172a84cdf6975adab999d78d24977be0cba3bd7287253e4a3b6de5044ef01a82de6d19316a22410bc96e9eca6128f |
25 |
|
26 |
diff --git a/dev-python/mido/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch b/dev-python/mido/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch |
27 |
new file mode 100644 |
28 |
index 000000000000..ecd9f53b108c |
29 |
--- /dev/null |
30 |
+++ b/dev-python/mido/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch |
31 |
@@ -0,0 +1,60 @@ |
32 |
+--- a/setup.py |
33 |
++++ b/setup.py |
34 |
+@@ -102,7 +102,7 @@ |
35 |
+ |
36 |
+ # Set up options for compiling the _rtmidi Extension |
37 |
+ if cythonize: |
38 |
+- sources = [join(SRC_DIR, "_rtmidi.pyx"), join(SRC_DIR, "rtmidi", "RtMidi.cpp")] |
39 |
++ sources = [join(SRC_DIR, "_rtmidi.pyx")] |
40 |
+ elif exists(join(SRC_DIR, "_rtmidi.cpp")): |
41 |
+ cythonize = lambda x: x # noqa |
42 |
+ sources = [join(SRC_DIR, "_rtmidi.cpp"), join(SRC_DIR, "rtmidi", "RtMidi.cpp")] |
43 |
+@@ -145,18 +145,18 @@ |
44 |
+ |
45 |
+ |
46 |
+ if sys.platform.startswith('linux'): |
47 |
+- if alsa and find_library('asound'): |
48 |
+- define_macros.append(("__LINUX_ALSA__", None)) |
49 |
+- libraries.append('asound') |
50 |
+- |
51 |
+- if jack: |
52 |
+- check_for_jack(define_macros, libraries) |
53 |
+- |
54 |
+ if not find_library('pthread'): |
55 |
+ sys.exit("The 'pthread' library is required to build python-rtmidi on" |
56 |
+ "Linux. Please install the libc6 development package.") |
57 |
++ if not find_library('rtmidi'): |
58 |
++ sys.exit("Failed to find librtmidi") |
59 |
+ |
60 |
+ libraries.append("pthread") |
61 |
++ |
62 |
++ res = subprocess.check_output(['pkg-config', '--variable', 'includedir', 'rtmidi']) |
63 |
++ rtmidi_include_dir = res.decode().strip() |
64 |
++ include_dirs.append(rtmidi_include_dir) |
65 |
++ libraries.append('rtmidi') |
66 |
+ elif sys.platform.startswith('darwin'): |
67 |
+ if jack: |
68 |
+ check_for_jack(define_macros, libraries) |
69 |
+@@ -197,7 +197,7 @@ |
70 |
+ # Finally, set up our distribution |
71 |
+ setup( |
72 |
+ packages=['rtmidi'], |
73 |
+- ext_modules=cythonize(extensions), |
74 |
++ ext_modules=cythonize(extensions, include_path=[ rtmidi_include_dir ]), |
75 |
+ tests_require=[], # Test dependencies are handled by tox |
76 |
+ # On systems without a RTC (e.g. Raspberry Pi), system time will be the |
77 |
+ # Unix epoch when booted without network connection, which makes zip fail, |
78 |
+--- a/tests/test_rtmidi.py |
79 |
++++ b/tests/test_rtmidi.py |
80 |
+@@ -54,11 +54,6 @@ |
81 |
+ else: |
82 |
+ self.assertEqual(res, rtmidi.API_UNSPECIFIED) |
83 |
+ |
84 |
+- def test_get_rtmidi_version(self): |
85 |
+- version = rtmidi.get_rtmidi_version() |
86 |
+- self.assertTrue(isinstance(version, string_types)) |
87 |
+- self.assertEqual(version, '4.0.0') |
88 |
+- |
89 |
+ |
90 |
+ class BaseTests: |
91 |
+ NOTE_ON = [0x90, 48, 100] |
92 |
|
93 |
diff --git a/dev-python/mido/metadata.xml b/dev-python/mido/metadata.xml |
94 |
new file mode 100644 |
95 |
index 000000000000..0751ee0b29fc |
96 |
--- /dev/null |
97 |
+++ b/dev-python/mido/metadata.xml |
98 |
@@ -0,0 +1,16 @@ |
99 |
+<?xml version="1.0" encoding="UTF-8"?> |
100 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
101 |
+<pkgmetadata> |
102 |
+ <maintainer type="person"> |
103 |
+ <email>marecki@g.o</email> |
104 |
+ <name>Marek Szuba</name> |
105 |
+ </maintainer> |
106 |
+ <upstream> |
107 |
+ <remote-id type="pypi">mido</remote-id> |
108 |
+ <remote-id type="github">mido/mido</remote-id> |
109 |
+ </upstream> |
110 |
+ <use> |
111 |
+ <flag name="portmidi">Support using <pkg>media-libs/portmidi</pkg> as MIDI back-end</flag> |
112 |
+ <flag name="rtmidi">Support using <pkg>media-libs/rtmidi</pkg> as MIDI back-end</flag> |
113 |
+ </use> |
114 |
+</pkgmetadata> |
115 |
|
116 |
diff --git a/dev-python/mido/mido-1.2.10.ebuild b/dev-python/mido/mido-1.2.10.ebuild |
117 |
new file mode 100644 |
118 |
index 000000000000..3288fa2bd953 |
119 |
--- /dev/null |
120 |
+++ b/dev-python/mido/mido-1.2.10.ebuild |
121 |
@@ -0,0 +1,27 @@ |
122 |
+# Copyright 1999-2022 Gentoo Authors |
123 |
+# Distributed under the terms of the GNU General Public License v2 |
124 |
+ |
125 |
+EAPI=8 |
126 |
+ |
127 |
+PYTHON_COMPAT=( python3_{8..11} ) |
128 |
+DISTUTILS_USE_PEP517=setuptools |
129 |
+ |
130 |
+inherit distutils-r1 |
131 |
+ |
132 |
+DESCRIPTION="MIDI Objects, a library for working with MIDI messages and ports" |
133 |
+HOMEPAGE=" |
134 |
+ https://pypi.org/project/mido/ |
135 |
+ https://github.com/mido/mido |
136 |
+" |
137 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
138 |
+ |
139 |
+LICENSE="MIT" |
140 |
+SLOT="0" |
141 |
+KEYWORDS="~amd64" |
142 |
+IUSE="+portmidi rtmidi" |
143 |
+ |
144 |
+RDEPEND="portmidi? ( media-libs/portmidi ) |
145 |
+ rtmidi? ( dev-python/python-rtmidi[${PYTHON_USEDEP}] )" |
146 |
+ |
147 |
+distutils_enable_sphinx docs |
148 |
+distutils_enable_tests pytest |