diff options
Diffstat (limited to 'dev-python/python-rtmidi')
-rw-r--r-- | dev-python/python-rtmidi/Manifest | 4 | ||||
-rw-r--r-- | dev-python/python-rtmidi/files/python-rtmidi-1.4.9-unbundle_rtmidi.patch | 60 | ||||
-rw-r--r-- | dev-python/python-rtmidi/metadata.xml | 12 | ||||
-rw-r--r-- | dev-python/python-rtmidi/python-rtmidi-1.4.9.ebuild | 52 |
4 files changed, 128 insertions, 0 deletions
diff --git a/dev-python/python-rtmidi/Manifest b/dev-python/python-rtmidi/Manifest new file mode 100644 index 000000000000..cc9b91e41419 --- /dev/null +++ b/dev-python/python-rtmidi/Manifest @@ -0,0 +1,4 @@ +AUX python-rtmidi-1.4.9-unbundle_rtmidi.patch 2139 BLAKE2B 04782e01de9d01a9f4d44c7f856527173227da94f81d2b7338c1e437194be53d0130bb8b03bd3fdc5b7e71d58f7514f476e817066ce5ce80dd530e78a355e2ab SHA512 d02951fe7f84a9b356765a734bdaa010a56562a86cdc1b54077ad25359339fb299080727f59f95273e842ad537192192f0705806d76f6aaf6022d36a0355ab53 +DIST python-rtmidi-1.4.9.tar.gz 251238 BLAKE2B dda4052e893839f88a6756306f8ff4e89ee66ad9716d374efbb7b92a8e9074e98c8d5df0cc82aa3c6e0c77a78fe9b997079623a5147c03eeea9128dfb7605215 SHA512 91c5a0f807549fbe9d87df6e40b8c3db0f9be753616ba51804900195d02120cd972e39c69dd99e60e4ea1b1d9831d0b956b64ce71b2fe03422efc57bccf5cb70 +EBUILD python-rtmidi-1.4.9.ebuild 1168 BLAKE2B 688b922cd52b746cea5ba0b0d747afdf6b43f355f2823c31de653cec500a156f2f8523df34010a3b6b6eba6c77064efea96236bb2be129af51915c603b28266d SHA512 1008bf277276c1daf1dc1a757a190f1bf53497d6618fbaa5f6e54ade77b6ead54b87e5c737f6d9ff8fb835e2096fb5b6058cfbbf0e09d5578f2cd5af6ea0aabe +MISC metadata.xml 388 BLAKE2B b1bce0f609aae5a298c26c80c3dc3aa33eadf32c9de9da22f4a4f808d1cfd8c769b095d12f2264cf9dd04cdbec8a0fb7202b10c04bb43f9112146023aadd398d SHA512 012ad743d364b9266bef852d159235f27b172ec7fceff43737fe8a67478f991dc53532b021c02d8ffc2eea19cdc568046cf90e440afefb46dcdad275a33f71e3 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 +} |