summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2025-09-10 15:24:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-15 17:57:23 +0100
commitf86653b66614783c45617e55aa7b6ee3c8bbec39 (patch)
tree49f19dbbc306fc20af4bc674d5c8e7ce1290c08b
parentc03aa1cdfd1ddc00ca45f89a046892c5c8ec8d12 (diff)
downloadpoky-f86653b66614783c45617e55aa7b6ee3c8bbec39.tar.gz
meson: Backport patches to support dependencies on header-only Boost libs
With Boost 1.89.0, the Boost.System library was made header-only. Since this is a frequent library to have as dependency in meson.build files, this resulted in build failures. Backport two patches so that Boost dependencies on header-only libraries work as expected. (From OE-Core rev: 0cda83cf02169da37e196cb6827177192c5c298c) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Check-for-header-only-Boost-libraries.patch58
-rw-r--r--meta/recipes-devtools/meson/meson/0002-Boost-python-must-have-a-library-component.patch34
-rw-r--r--meta/recipes-devtools/meson/meson_1.9.0.bb2
3 files changed, 94 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson/0001-Check-for-header-only-Boost-libraries.patch b/meta/recipes-devtools/meson/meson/0001-Check-for-header-only-Boost-libraries.patch
new file mode 100644
index 0000000000..3d2810aff9
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-Check-for-header-only-Boost-libraries.patch
@@ -0,0 +1,58 @@
1From f16897135c394d36656da0078613864076300e07 Mon Sep 17 00:00:00 2001
2From: Jussi Pakkanen <jussi.pakkanen@mailbox.org>
3Date: Fri, 29 Aug 2025 14:57:06 +0300
4Subject: [PATCH] Check for header only Boost libraries.
5
6Upstream-Status: Backport [https://github.com/mesonbuild/meson/commit/6a9a81619c139d0f6ae3d265f7366e61615d92a1]
7Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
8---
9 mesonbuild/dependencies/boost.py | 22 ++++++++++++++++++++--
10 1 file changed, 20 insertions(+), 2 deletions(-)
11
12diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
13index 662f985..e153e8f 100644
14--- a/mesonbuild/dependencies/boost.py
15+++ b/mesonbuild/dependencies/boost.py
16@@ -452,6 +452,10 @@ class BoostDependency(SystemDependency):
17 break
18 libs = sorted(set(libs))
19
20+ any_libs_found = len(libs) > 0
21+ if not any_libs_found:
22+ return False
23+
24 modules = ['boost_' + x for x in self.modules]
25 for inc in inc_dirs:
26 mlog.debug(f' - found boost {inc.version} include dir: {inc.path}')
27@@ -462,7 +466,7 @@ class BoostDependency(SystemDependency):
28 mlog.debug(f' - {j}')
29
30 # 3. Select the libraries matching the requested modules
31- not_found: T.List[str] = []
32+ not_found_as_libs: T.List[str] = []
33 selected_modules: T.List[BoostLibraryFile] = []
34 for mod in modules:
35 found = False
36@@ -472,7 +476,21 @@ class BoostDependency(SystemDependency):
37 found = True
38 break
39 if not found:
40- not_found += [mod]
41+ not_found_as_libs += [mod]
42+
43+ # If a lib is not found, but an include directory exists,
44+ # assume it is a header only module.
45+ not_found: T.List[str] = []
46+ for boost_modulename in not_found_as_libs:
47+ assert boost_modulename.startswith('boost_')
48+ include_subdir = boost_modulename.replace('boost_', 'boost/', 1)
49+ headerdir_found = False
50+ for inc_dir in inc_dirs:
51+ if (inc_dir.path / include_subdir).is_dir():
52+ headerdir_found = True
53+ break
54+ if not headerdir_found:
55+ not_found.append(boost_modulename)
56
57 # log the result
58 mlog.debug(' - found:')
diff --git a/meta/recipes-devtools/meson/meson/0002-Boost-python-must-have-a-library-component.patch b/meta/recipes-devtools/meson/meson/0002-Boost-python-must-have-a-library-component.patch
new file mode 100644
index 0000000000..c03c47534e
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0002-Boost-python-must-have-a-library-component.patch
@@ -0,0 +1,34 @@
1From d0644d543f4df39cf2ba14337000ee019cb20b6d Mon Sep 17 00:00:00 2001
2From: Jussi Pakkanen <jussi.pakkanen@mailbox.org>
3Date: Fri, 29 Aug 2025 22:51:48 +0300
4Subject: [PATCH] Boost python must have a library component.
5
6Upstream-Status: Backport [https://github.com/mesonbuild/meson/commit/80917ca8c1a5af499cc6e004ad5d5a050da9045e]
7Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
8---
9 mesonbuild/dependencies/boost.py | 5 +++++
10 1 file changed, 5 insertions(+)
11
12diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
13index e153e8f..fdb35d4 100644
14--- a/mesonbuild/dependencies/boost.py
15+++ b/mesonbuild/dependencies/boost.py
16@@ -440,6 +440,8 @@ class BoostDependency(SystemDependency):
17 mlog.debug(' - potential library dirs: {}'.format([x.as_posix() for x in lib_dirs]))
18 mlog.debug(' - potential include dirs: {}'.format([x.path.as_posix() for x in inc_dirs]))
19
20+ must_have_library = ['boost_python']
21+
22 # 2. Find all boost libraries
23 libs: T.List[BoostLibraryFile] = []
24 for i in lib_dirs:
25@@ -483,6 +485,9 @@ class BoostDependency(SystemDependency):
26 not_found: T.List[str] = []
27 for boost_modulename in not_found_as_libs:
28 assert boost_modulename.startswith('boost_')
29+ if boost_modulename in must_have_library:
30+ not_found.append(boost_modulename)
31+ continue
32 include_subdir = boost_modulename.replace('boost_', 'boost/', 1)
33 headerdir_found = False
34 for inc_dir in inc_dirs:
diff --git a/meta/recipes-devtools/meson/meson_1.9.0.bb b/meta/recipes-devtools/meson/meson_1.9.0.bb
index 6f5a623dc7..10ac7d9697 100644
--- a/meta/recipes-devtools/meson/meson_1.9.0.bb
+++ b/meta/recipes-devtools/meson/meson_1.9.0.bb
@@ -14,6 +14,8 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \
14 file://0001-python-module-do-not-manipulate-the-environment-when.patch \ 14 file://0001-python-module-do-not-manipulate-the-environment-when.patch \
15 file://0001-Make-CPU-family-warnings-fatal.patch \ 15 file://0001-Make-CPU-family-warnings-fatal.patch \
16 file://0002-Support-building-allarch-recipes-again.patch \ 16 file://0002-Support-building-allarch-recipes-again.patch \
17 file://0001-Check-for-header-only-Boost-libraries.patch \
18 file://0002-Boost-python-must-have-a-library-component.patch \
17 " 19 "
18SRC_URI[sha256sum] = "cd27277649b5ed50d19875031de516e270b22e890d9db65ed9af57d18ebc498d" 20SRC_URI[sha256sum] = "cd27277649b5ed50d19875031de516e270b22e890d9db65ed9af57d18ebc498d"
19UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$" 21UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$"