Date: Wednesday, January 25, 2023 @ 01:03:54 Author: grawlinson Revision: 1388191
addpkg: python-rtmidi 1.4.9-3 Added: python-rtmidi/ python-rtmidi/repos/ python-rtmidi/trunk/ python-rtmidi/trunk/PKGBUILD python-rtmidi/trunk/unbundle-rtmidi.patch -----------------------+ PKGBUILD | 58 +++++++++++++++++++++++++++++++++++++++++++++++ unbundle-rtmidi.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) Added: python-rtmidi/trunk/PKGBUILD =================================================================== --- python-rtmidi/trunk/PKGBUILD (rev 0) +++ python-rtmidi/trunk/PKGBUILD 2023-01-25 01:03:54 UTC (rev 1388191) @@ -0,0 +1,58 @@ +# Maintainer: George Rawlinson <[email protected]> +# Contributor: OSAMC <https://github.com/osam-cologne/archlinux-proaudio> +# Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de> + +pkgname=python-rtmidi +pkgver=1.4.9 +pkgrel=3 +pkgdesc='Python bindings for the MIDI I/O library RtMidi' +arch=('x86_64') +url='https://github.com/SpotlightKid/python-rtmidi' +license=('MIT') +depends=('python' 'rtmidi') +makedepends=( + 'git' + 'python-build' + 'python-installer' + 'python-wheel' + 'python-setuptools' + 'cython' + 'alsa-lib' + 'jack' +) +_commit='0a5aa06d46485cb2dab836bd20205f60efb95eed' +source=( + "$pkgname::git+$url#commit=$_commit" + 'unbundle-rtmidi.patch' +) +b2sums=('SKIP' + 'b27c438fa93c00fd458fd8083302838ad0ca96c09c89f0993c6fdc09681f8eccddca53445925c1b437860faa488115d2bc33076a202a5dd730f44cef298c9831') + +pkgver() { + cd "$pkgname" + + git describe --tags | sed 's/^v//' +} + +prepare() { + cd "$pkgname" + + # use system rtmidi + patch -p1 -i "$srcdir/unbundle-rtmidi.patch" +} + +build() { + cd "$pkgname" + + python -m build --wheel --no-isolation +} + +package() { + depends+=('libasound.so' 'libjack.so') + cd "$pkgname" + + python -m installer --destdir="$pkgdir" dist/*.whl + + # license + install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt +} Added: python-rtmidi/trunk/unbundle-rtmidi.patch =================================================================== --- python-rtmidi/trunk/unbundle-rtmidi.patch (rev 0) +++ python-rtmidi/trunk/unbundle-rtmidi.patch 2023-01-25 01:03:54 UTC (rev 1388191) @@ -0,0 +1,59 @@ +--- 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,13 @@ + + + if sys.platform.startswith('linux'): +- if alsa and find_library('asound'): +- define_macros.append(("__LINUX_ALSA__", None)) +- libraries.append('asound') ++ if not find_library('rtmidi'): ++ sys.exit("Failed to find librtmidi") + +- 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.") +- +- 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 +192,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]
