diff mbox series

[meta-python] python3-pyaudio: Fix cross builds

Message ID 20230727030243.182987-1-raj.khem@gmail.com
State New
Headers show
Series [meta-python] python3-pyaudio: Fix cross builds | expand

Commit Message

Khem Raj July 27, 2023, 3:02 a.m. UTC
Do not poison include paths with build system include and lib dirs
these paths get appended to cflags/ldflags when building the c extention

Fixes
| /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/python3-pyaudio/0.2.13-r0/recipe-sysroot/usr/include/python3.11/pyconfig.h:23:10: fatal error: 'python3.11/pyconfig-32.h' file not found
|    23 | #include <python3.11/pyconfig-32.h>
|       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
| 1 error generated.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Trevor Gamblin <tgamblin@baylibre.com>
---
 ...paths-into-build-machine-system-dirs.patch | 28 +++++++++++++++++++
 .../python/python3-pyaudio_0.2.13.bb          |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pyaudio/0001-Remove-absolute-paths-into-build-machine-system-dirs.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pyaudio/0001-Remove-absolute-paths-into-build-machine-system-dirs.patch b/meta-python/recipes-devtools/python/python3-pyaudio/0001-Remove-absolute-paths-into-build-machine-system-dirs.patch
new file mode 100644
index 0000000000..a71902a362
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pyaudio/0001-Remove-absolute-paths-into-build-machine-system-dirs.patch
@@ -0,0 +1,28 @@ 
+From d94518b558c1812aecb87d8ef19d75c2df1b98a5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 26 Jul 2023 19:54:19 -0700
+Subject: [PATCH] Remove absolute paths into build machine system dirs
+
+This ensures that it does not add /usr/include and /usr/local/include/
+into cflags
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ setup.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/setup.py
++++ b/setup.py
+@@ -111,11 +111,6 @@ def setup_extension():
+         # the standard portaudio cmake settings. For details, see:
+         # https://devblogs.microsoft.com/cppblog/vcpkg-updates-static-linking-is-now-available/
+         extra_compile_args += ["/MT"]
+-    else:
+-        # GNU/Linux and other posix-like OSes will dynamically link to
+-        # portaudio, installed by the package manager.
+-        include_dirs += ['/usr/local/include', '/usr/include']
+-        external_libraries_path += ['/usr/local/lib', '/usr/lib']
+ 
+     return Extension(
+         'pyaudio._portaudio',
diff --git a/meta-python/recipes-devtools/python/python3-pyaudio_0.2.13.bb b/meta-python/recipes-devtools/python/python3-pyaudio_0.2.13.bb
index dbeed9c2d8..1f0b5cf6e8 100644
--- a/meta-python/recipes-devtools/python/python3-pyaudio_0.2.13.bb
+++ b/meta-python/recipes-devtools/python/python3-pyaudio_0.2.13.bb
@@ -10,6 +10,8 @@  SRC_URI[sha256sum] = "26bccc81e4243d1c0ff5487e6b481de6329fcd65c79365c267cef38f36
 
 inherit pypi setuptools3
 
+SRC_URI += "file://0001-Remove-absolute-paths-into-build-machine-system-dirs.patch"
+
 DEPENDS += "portaudio-v19"
 
 RDEPENDS:${PN} += "portaudio-v19"