public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2 3/9] python3-numpy: backport a Meson patch to fix pkg-config lookups
Date: Mon,  9 Feb 2026 12:56:21 +0000	[thread overview]
Message-ID: <20260209125628.640221-3-ross.burton@arm.com> (raw)
In-Reply-To: <20260209125628.640221-1-ross.burton@arm.com>

When Meson uses pkg-config to introspect the Python install it resets
PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR to the location that the running
python3 says is the library directory. However, when it writes to
PKG_CONFIG_LIBDIR it uses the _target_ library directory without
prefixing this with the sysroot, which breaks the build if _LIBDIR is
the primary search path.

This has been fixed in Meson since 1.10.0[1] but numpy has a vendored
fork of Meson that is currently at 1.9.2, so backport the specific fix
to solve this problem.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../python3-numpy/0001-python-sysroot.patch   | 34 +++++++++++++++++++
 .../python/python3-numpy_2.3.5.bb             |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-numpy/0001-python-sysroot.patch

diff --git a/meta/recipes-devtools/python/python3-numpy/0001-python-sysroot.patch b/meta/recipes-devtools/python/python3-numpy/0001-python-sysroot.patch
new file mode 100644
index 0000000000..b22c123493
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy/0001-python-sysroot.patch
@@ -0,0 +1,34 @@
+From c40218577305f5953ef63d943c26a27c5a931770 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Wed, 21 Jan 2026 14:12:36 +0000
+Subject: [PATCH] Add sysroot to pkgconfig libdir
+
+When Meson uses pkg-config to introspect the Python install it resets PKG_CONFIG_PATH
+and PKG_CONFIG_LIBDIR. However, when it writes to PKG_CONFIG_LIBDIR it uses the
+_target_ library directory without prefixing this with the sysroot, which breaks 
+the build if _LIBDIR is the primary search path.
+
+This has been fixed in Meson since 1.10.0[1] but numpy has a vendored fork of Meson
+that is currently at 1.9.2, so backport the specific fix to solve this problem.
+
+[1] meson 59c3dd1fd ("python: add a python.build_config option (PEP 739)")
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ vendored-meson/meson/mesonbuild/dependencies/python.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/vendored-meson/meson/mesonbuild/dependencies/python.py b/vendored-meson/meson/mesonbuild/dependencies/python.py
+index 7f9bd20..fdcf714 100644
+--- a/vendored-meson/meson/mesonbuild/dependencies/python.py
++++ b/vendored-meson/meson/mesonbuild/dependencies/python.py
+@@ -412,6 +412,8 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
+     if DependencyMethods.PKGCONFIG in methods:
+         if from_installation:
+             pkg_libdir = installation.info['variables'].get('LIBPC')
++            sysroot = env.properties[for_machine].get_sys_root() or ''
++            pkg_libdir = sysroot + pkg_libdir
+             pkg_embed = '-embed' if embed and mesonlib.version_compare(installation.info['version'], '>=3.8') else ''
+             pkg_name = f'python-{pkg_version}{pkg_embed}'
+ 
diff --git a/meta/recipes-devtools/python/python3-numpy_2.3.5.bb b/meta/recipes-devtools/python/python3-numpy_2.3.5.bb
index 55b8091ff8..78972c98d3 100644
--- a/meta/recipes-devtools/python/python3-numpy_2.3.5.bb
+++ b/meta/recipes-devtools/python/python3-numpy_2.3.5.bb
@@ -11,6 +11,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \
            file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
            file://fix_reproducibility.patch \
            file://run-ptest \
+           file://0001-python-sysroot.patch \
            "
 SRC_URI[sha256sum] = "784db1dcdab56bf0517743e746dfb0f885fc68d948aba86eeec2cba234bdf1c0"
 
-- 
2.43.0



  parent reply	other threads:[~2026-02-09 12:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09 12:56 [PATCH v2 1/9] pkgconfig: inherit the pkgconfig class Ross Burton
2026-02-09 12:56 ` [PATCH v2 2/9] perf: " Ross Burton
2026-02-09 12:56 ` Ross Burton [this message]
2026-02-09 12:56 ` [PATCH v2 4/9] classes/pkgconfig: move variable exports to the class Ross Burton
2026-02-09 12:56 ` [PATCH v2 5/9] classes/pkgconfig: rationalise variable usage Ross Burton
2026-02-09 12:56 ` [PATCH v2 6/9] qemu: extend PKG_CONFIG_LIBDIR when using the host search path Ross Burton
2026-02-09 12:56 ` [PATCH v2 7/9] pkgconf: small cleanups Ross Burton
2026-02-09 12:56 ` [PATCH v2 8/9] pkgconf: add pkg-config-native to the nativesdk package Ross Burton
2026-02-09 12:56 ` [PATCH v2 9/9] kernel: remove pkg-config variables for old (<5.15) kernels Ross Burton
2026-02-23 17:01   ` [OE-core] " Bruce Ashfield

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=20260209125628.640221-3-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=openembedded-core@lists.openembedded.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