summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2022-09-29 01:35:53 +0100
committerMarek Szuba <marecki@gentoo.org>2022-09-29 01:39:02 +0100
commit6117d33a3ef05727723316ced984a4f74e133478 (patch)
treebabdaca145cc49de24d179abadb5e5de39e36b79 /dev-python/python-rtmidi
parentdev-lang/nim: drop old 1.6.2 (diff)
downloadgentoo-6117d33a3ef05727723316ced984a4f74e133478.tar.gz
gentoo-6117d33a3ef05727723316ced984a4f74e133478.tar.bz2
gentoo-6117d33a3ef05727723316ced984a4f74e133478.zip
dev-python/python-rtmidi: new package, add 1.4.9
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'dev-python/python-rtmidi')
-rw-r--r--dev-python/python-rtmidi/Manifest1
-rw-r--r--dev-python/python-rtmidi/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch60
-rw-r--r--dev-python/python-rtmidi/metadata.xml12
-rw-r--r--dev-python/python-rtmidi/python-rtmidi-1.4.9.ebuild52
4 files changed, 125 insertions, 0 deletions
diff --git a/dev-python/python-rtmidi/Manifest b/dev-python/python-rtmidi/Manifest
new file mode 100644
index 000000000000..0cb23d6df4d8
--- /dev/null
+++ b/dev-python/python-rtmidi/Manifest
@@ -0,0 +1 @@
+DIST python-rtmidi-1.4.9.tar.gz 251238 BLAKE2B dda4052e893839f88a6756306f8ff4e89ee66ad9716d374efbb7b92a8e9074e98c8d5df0cc82aa3c6e0c77a78fe9b997079623a5147c03eeea9128dfb7605215 SHA512 91c5a0f807549fbe9d87df6e40b8c3db0f9be753616ba51804900195d02120cd972e39c69dd99e60e4ea1b1d9831d0b956b64ce71b2fe03422efc57bccf5cb70
diff --git a/dev-python/python-rtmidi/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch b/dev-python/python-rtmidi/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch
new file mode 100644
index 000000000000..ecd9f53b108c
--- /dev/null
+++ b/dev-python/python-rtmidi/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch
@@ -0,0 +1,60 @@
+--- a/setup.py
++++ b/setup.py
+@@ -102,7 +102,7 @@
+
+ # Set up options for compiling the _rtmidi Extension
+ if cythonize:
+- sources = [join(SRC_DIR, "_rtmidi.pyx"), join(SRC_DIR, "rtmidi", "RtMidi.cpp")]
++ sources = [join(SRC_DIR, "_rtmidi.pyx")]
+ elif exists(join(SRC_DIR, "_rtmidi.cpp")):
+ cythonize = lambda x: x # noqa
+ sources = [join(SRC_DIR, "_rtmidi.cpp"), join(SRC_DIR, "rtmidi", "RtMidi.cpp")]
+@@ -145,18 +145,18 @@
+
+
+ if sys.platform.startswith('linux'):
+- if alsa and find_library('asound'):
+- define_macros.append(("__LINUX_ALSA__", None))
+- libraries.append('asound')
+-
+- if jack:
+- check_for_jack(define_macros, libraries)
+-
+ if not find_library('pthread'):
+ sys.exit("The 'pthread' library is required to build python-rtmidi on"
+ "Linux. Please install the libc6 development package.")
++ if not find_library('rtmidi'):
++ sys.exit("Failed to find librtmidi")
+
+ libraries.append("pthread")
++
++ res = subprocess.check_output(['pkg-config', '--variable', 'includedir', 'rtmidi'])
++ rtmidi_include_dir = res.decode().strip()
++ include_dirs.append(rtmidi_include_dir)
++ libraries.append('rtmidi')
+ elif sys.platform.startswith('darwin'):
+ if jack:
+ check_for_jack(define_macros, libraries)
+@@ -197,7 +197,7 @@
+ # Finally, set up our distribution
+ setup(
+ packages=['rtmidi'],
+- ext_modules=cythonize(extensions),
++ ext_modules=cythonize(extensions, include_path=[ rtmidi_include_dir ]),
+ tests_require=[], # Test dependencies are handled by tox
+ # On systems without a RTC (e.g. Raspberry Pi), system time will be the
+ # Unix epoch when booted without network connection, which makes zip fail,
+--- a/tests/test_rtmidi.py
++++ b/tests/test_rtmidi.py
+@@ -54,11 +54,6 @@
+ else:
+ self.assertEqual(res, rtmidi.API_UNSPECIFIED)
+
+- def test_get_rtmidi_version(self):
+- version = rtmidi.get_rtmidi_version()
+- self.assertTrue(isinstance(version, string_types))
+- self.assertEqual(version, '4.0.0')
+-
+
+ class BaseTests:
+ NOTE_ON = [0x90, 48, 100]
diff --git a/dev-python/python-rtmidi/metadata.xml b/dev-python/python-rtmidi/metadata.xml
new file mode 100644
index 000000000000..93ee6355d770
--- /dev/null
+++ b/dev-python/python-rtmidi/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>marecki@gentoo.org</email>
+ <name>Marek Szuba</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">python-rtmidi</remote-id>
+ <remote-id type="github">SpotlightKid/python-rtmidi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/python-rtmidi/python-rtmidi-1.4.9.ebuild b/dev-python/python-rtmidi/python-rtmidi-1.4.9.ebuild
new file mode 100644
index 000000000000..0c8c966de3fc
--- /dev/null
+++ b/dev-python/python-rtmidi/python-rtmidi-1.4.9.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit distutils-r1
+
+DESCRIPTION="Python bindings for media-libs/rtmidi implemented using Cython"
+HOMEPAGE="
+ https://pypi.org/project/python-rtmidi/
+ https://spotlightkid.github.io/python-rtmidi/
+"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+alsa jack"
+
+# Most of these tests do not play nicely with the sandbox, some only
+# work with exactly the same version of rtmidi as the bundled one, and
+# several fail even with disabled sandbox unless there are actual MIDI
+# I/O devices present.
+RESTRICT="test"
+
+DEPEND="media-libs/rtmidi[alsa?,jack?]"
+RDEPEND="${DEPEND}"
+BDEPEND="dev-python/cython[${PYTHON_USEDEP}]
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.9-unbundle_rtmidi.patch
+)
+
+distutils_enable_sphinx docs
+distutils_enable_tests unittest
+
+src_prepare() {
+ distutils-r1_src_prepare
+
+ # Just in case
+ rm -r src/rtmidi || die
+ rm src/_rtmidi.cpp || die
+}
+
+python_test() {
+ cd "${T}" || die
+ eunittest "${S}"/tests
+}