commit:     04429885a2d8b6d95e3e0da0377be05104e9f883
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 16 21:11:37 2023 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Fri Jun 16 21:18:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04429885

dev-python/python-rtmidi: fix building against newer meson-python

Since 0.13.0, meson-python throws an error if a package is split
between purelib and platlib. Upstream did attempt to use the "pure"
keyword to account for the mixed nature of this module but
unfortunately, they appear to have got it wrong.

Closes: https://bugs.gentoo.org/908457
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../files/python-rtmidi-1.5.1-meson_pure.patch     | 29 ++++++++++++++++++++++
 .../python-rtmidi/python-rtmidi-1.5.1.ebuild       |  4 +++
 2 files changed, 33 insertions(+)

diff --git 
a/dev-python/python-rtmidi/files/python-rtmidi-1.5.1-meson_pure.patch 
b/dev-python/python-rtmidi/files/python-rtmidi-1.5.1-meson_pure.patch
new file mode 100644
index 000000000000..fba3f395812c
--- /dev/null
+++ b/dev-python/python-rtmidi/files/python-rtmidi-1.5.1-meson_pure.patch
@@ -0,0 +1,29 @@
+--- a/meson.build
++++ b/meson.build
+@@ -6,7 +6,7 @@
+     default_options: [
+         'warning_level=2'
+     ],
+-    meson_version: '>=0.63.0'
++    meson_version: '>=0.64.0'
+ )
+ 
+ cpp = meson.get_compiler('cpp')
+@@ -69,7 +69,7 @@
+ endif # Platform detection
+ 
+ pymod = import('python')
+-python = pymod.find_installation(get_option('python'), required: true)
++python = pymod.find_installation(get_option('python'), required: true, pure: 
false)
+ 
+ # Generate _rtmidi extension source
+ subdir('src')
+--- a/rtmidi/meson.build
++++ b/rtmidi/meson.build
+@@ -78,6 +78,5 @@
+ python.install_sources(
+     python_sources,
+     version_py,
+-    pure: true,
+     subdir: 'rtmidi',
+ )

diff --git a/dev-python/python-rtmidi/python-rtmidi-1.5.1.ebuild 
b/dev-python/python-rtmidi/python-rtmidi-1.5.1.ebuild
index ed64baccc94b..abefc8615ade 100644
--- a/dev-python/python-rtmidi/python-rtmidi-1.5.1.ebuild
+++ b/dev-python/python-rtmidi/python-rtmidi-1.5.1.ebuild
@@ -4,6 +4,7 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{9..11} )
+DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=meson-python
 PYPI_NO_NORMALIZE=1
 
@@ -33,6 +34,7 @@ BDEPEND="<dev-python/cython-2.99[${PYTHON_USEDEP}]
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.5.1-build_backend.patch
+       "${FILESDIR}"/${PN}-1.5.1-meson_pure.patch
        "${FILESDIR}"/${PN}-1.5.1-unbundle_rtmidi.patch
 )
 
@@ -45,6 +47,8 @@ src_prepare() {
        # Just in case
        rm -r src/rtmidi || die
        rm src/_rtmidi.cpp || die
+
+       DISTUTILS_ARGS=( -Dwheel=true )
 }
 
 python_test() {

Reply via email to