public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-rtmidi/files/, dev-python/python-rtmidi/
Date: Thu, 29 Sep 2022 00:39:08 +0000 (UTC)	[thread overview]
Message-ID: <1664411942.6117d33a3ef05727723316ced984a4f74e133478.marecki@gentoo> (raw)

commit:     6117d33a3ef05727723316ced984a4f74e133478
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 00:35:53 2022 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 00:39:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6117d33a

dev-python/python-rtmidi: new package, add 1.4.9

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 dev-python/python-rtmidi/Manifest                  |  1 +
 .../python-rtmidi-1.4.9-unbundle_rtmidi.patch      | 60 ++++++++++++++++++++++
 dev-python/python-rtmidi/metadata.xml              | 12 +++++
 .../python-rtmidi/python-rtmidi-1.4.9.ebuild       | 52 +++++++++++++++++++
 4 files changed, 125 insertions(+)

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
+}


             reply	other threads:[~2022-09-29  0:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29  0:39 Marek Szuba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-06-13 15:08 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-rtmidi/files/, dev-python/python-rtmidi/ Marek Szuba
2023-07-24 11:33 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1664411942.6117d33a3ef05727723316ced984a4f74e133478.marecki@gentoo \
    --to=marecki@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox