Skip to content

Commit 365620c

Browse files
committed
meson: update to 1.7
meson 1.7 needed for some of the tools. Signed-off-by: Anas Nashif <[email protected]>
1 parent e4cace3 commit 365620c

13 files changed

+266
-256
lines changed

meta-zephyr-sdk/recipes-devtools/meson/meson.inc

Lines changed: 0 additions & 37 deletions
This file was deleted.

meta-zephyr-sdk/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
1-
From 6c4eef1d92e9e42fdbc888365cab3c95fb33c605 Mon Sep 17 00:00:00 2001
1+
From 32c4ccfbdc8649f595a79e7fd1bd39d6f8325340 Mon Sep 17 00:00:00 2001
22
From: Ross Burton <[email protected]>
33
Date: Tue, 3 Jul 2018 13:59:09 +0100
44
Subject: [PATCH] Make CPU family warnings fatal
55

66
Upstream-Status: Inappropriate [OE specific]
77
Signed-off-by: Ross Burton <[email protected]>
8-
98
---
10-
mesonbuild/envconfig.py | 2 +-
11-
mesonbuild/environment.py | 4 +---
12-
2 files changed, 2 insertions(+), 4 deletions(-)
9+
mesonbuild/envconfig.py | 4 ++--
10+
mesonbuild/environment.py | 6 ++----
11+
2 files changed, 4 insertions(+), 6 deletions(-)
1312

1413
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15-
index 307aac3..66fb7ec 100644
14+
index 86bad9b..9703315 100644
1615
--- a/mesonbuild/envconfig.py
1716
+++ b/mesonbuild/envconfig.py
18-
@@ -267,7 +267,7 @@ class MachineInfo(HoldableObject):
17+
@@ -277,8 +277,8 @@ class MachineInfo(HoldableObject):
18+
'but is missing {}.'.format(minimum_literal - set(literal)))
1919

2020
cpu_family = literal['cpu_family']
21-
if cpu_family not in known_cpu_families:
21+
- if cpu_family not in known_cpu_families:
2222
- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new')
23+
+ if cpu_family not in known_cpu_families and cpu_family != "riscv":
2324
+ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family))
2425

2526
endian = literal['endian']
2627
if endian not in ('little', 'big'):
2728
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
28-
index 71286a5..179917e 100644
29+
index 71a2f3a..4cbeabe 100644
2930
--- a/mesonbuild/environment.py
3031
+++ b/mesonbuild/environment.py
31-
@@ -352,9 +352,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
32-
trial = 'ppc64'
32+
@@ -416,10 +416,8 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
33+
if compilers and not any_compiler_has_define(compilers, '__mips64'):
34+
trial = 'mips'
3335

34-
if trial not in known_cpu_families:
36+
- if trial not in known_cpu_families:
3537
- mlog.warning(f'Unknown CPU family {trial!r}, please report this at '
3638
- 'https://github.com/mesonbuild/meson/issues/new with the '
3739
- 'output of `uname -a` and `cat /proc/cpuinfo`')
40+
+ if trial not in known_cpu_families and trail != "riscv":
3841
+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial)
3942

4043
return trial
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 6f33fb67097beeb17e2345aaec3bda4a57b0b138 Mon Sep 17 00:00:00 2001
2+
From: Ross Burton <[email protected]>
3+
Date: Wed, 20 Nov 2024 13:09:38 +0000
4+
Subject: [PATCH] dependencies/dev: prepend sysroot when searching for GTest
5+
sources
6+
7+
Don't hardcode paths in /usr when looking for the GTest sources, as in
8+
cross-compile or other builds with a sysroot this will find the host
9+
sources, not ones that we want to use in the sysroot.
10+
11+
Closes #12690.
12+
13+
Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/13934]
14+
Signed-off-by: Ross Burton <[email protected]>
15+
---
16+
mesonbuild/dependencies/dev.py | 4 +++-
17+
1 file changed, 3 insertions(+), 1 deletion(-)
18+
19+
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
20+
index 94f51ff69..cceb1756c 100644
21+
--- a/mesonbuild/dependencies/dev.py
22+
+++ b/mesonbuild/dependencies/dev.py
23+
@@ -56,7 +56,9 @@ class GTestDependencySystem(SystemDependency):
24+
def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
25+
super().__init__(name, environment, kwargs, language='cpp')
26+
self.main = kwargs.get('main', False)
27+
- self.src_dirs = ['/usr/src/gtest/src', '/usr/src/googletest/googletest/src']
28+
+
29+
+ sysroot = environment.properties[self.for_machine].get_sys_root() or ""
30+
+ self.src_dirs = [sysroot + '/usr/src/gtest/src', sysroot + '/usr/src/googletest/googletest/src']
31+
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
32+
self.is_found = False
33+
return
34+
--
35+
2.34.1
36+

meta-zephyr-sdk/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch

Lines changed: 0 additions & 36 deletions
This file was deleted.

meta-zephyr-sdk/recipes-devtools/meson/meson/0001-is_debianlike-always-return-False.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,36 @@
1-
From 2264e67d7c2c22ca634fd26ea8ada6f0344ab280 Mon Sep 17 00:00:00 2001
1+
From f264b7fd2c86edfd5db77da264e8bf05f5e2bfeb Mon Sep 17 00:00:00 2001
22
From: Alexander Kanavin <[email protected]>
33
Date: Mon, 19 Nov 2018 14:24:26 +0100
44
Subject: [PATCH] python module: do not manipulate the environment when calling
55
pkg-config
66

77
Upstream-Status: Inappropriate [oe-core specific]
88
Signed-off-by: Alexander Kanavin <[email protected]>
9-
109
---
11-
mesonbuild/modules/python.py | 12 ------------
12-
1 file changed, 12 deletions(-)
10+
mesonbuild/dependencies/python.py | 6 +-----
11+
1 file changed, 1 insertion(+), 5 deletions(-)
1312

14-
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
15-
index 422155b..aaf5844 100644
16-
--- a/mesonbuild/modules/python.py
17-
+++ b/mesonbuild/modules/python.py
18-
@@ -70,11 +70,6 @@ class PythonDependency(ExternalDependency):
19-
old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR')
20-
old_pkg_path = os.environ.get('PKG_CONFIG_PATH')
13+
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
14+
index 326e605..f5eb50f 100644
15+
--- a/mesonbuild/dependencies/python.py
16+
+++ b/mesonbuild/dependencies/python.py
17+
@@ -403,9 +403,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
18+
empty.name = 'python'
19+
return empty
2120

22-
- os.environ.pop('PKG_CONFIG_PATH', None)
23-
-
24-
- if pkg_libdir:
25-
- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
26-
-
21+
- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None)
22+
- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None)
23+
- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
2724
try:
28-
self.pkgdep = PkgConfigDependency(pkg_name, environment, kwargs)
29-
mlog.debug(f'Found "{pkg_name}" via pkgconfig lookup in LIBPC ({pkg_libdir})')
30-
@@ -83,13 +78,6 @@ class PythonDependency(ExternalDependency):
31-
mlog.debug(f'"{pkg_name}" could not be found in LIBPC ({pkg_libdir})')
32-
mlog.debug(e)
33-
34-
- if old_pkg_path is not None:
35-
- os.environ['PKG_CONFIG_PATH'] = old_pkg_path
36-
-
37-
- if old_pkg_libdir is not None:
38-
- os.environ['PKG_CONFIG_LIBDIR'] = old_pkg_libdir
39-
- else:
40-
- os.environ.pop('PKG_CONFIG_LIBDIR', None)
41-
else:
42-
mlog.debug(f'"{pkg_name}" could not be found in LIBPC ({pkg_libdir}), this is likely due to a relocated python installation')
25+
return PythonPkgConfigDependency(name, env, kwargs, installation, True)
26+
finally:
27+
@@ -414,8 +411,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
28+
os.environ[name] = value
29+
elif name in os.environ:
30+
del os.environ[name]
31+
- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir)
32+
- set_env('PKG_CONFIG_PATH', old_pkg_path)
33+
+ pass
4334

35+
candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation))
36+
# We only need to check both, if a python install has a LIBPC. It might point to the wrong location,
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 656bf55fed01df2d2e2ad6d9d9887173cb16b85c Mon Sep 17 00:00:00 2001
1+
From bcdd72ed1956e0a1b1b725e552fa391c549c2099 Mon Sep 17 00:00:00 2001
22
From: Peter Kjellerstedt <[email protected]>
33
Date: Thu, 26 Jul 2018 16:32:49 +0200
4-
Subject: [PATCH 2/2] Support building allarch recipes again
4+
Subject: [PATCH] Support building allarch recipes again
55

66
This registers "allarch" as a known CPU family.
77

@@ -12,17 +12,14 @@ Signed-off-by: Peter Kjellerstedt <[email protected]>
1212
1 file changed, 1 insertion(+)
1313

1414
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15-
index 4d58c91..ff01ad1 100644
15+
index 9703315..74f2477 100644
1616
--- a/mesonbuild/envconfig.py
1717
+++ b/mesonbuild/envconfig.py
18-
@@ -36,6 +36,7 @@ from pathlib import Path
18+
@@ -28,6 +28,7 @@ from pathlib import Path
1919

2020

2121
known_cpu_families = (
2222
+ 'allarch',
2323
'aarch64',
2424
'alpha',
2525
'arc',
26-
--
27-
2.24.0
28-

meta-zephyr-sdk/recipes-devtools/meson/meson/disable-rpath-handling.patch

Lines changed: 0 additions & 35 deletions
This file was deleted.

meta-zephyr-sdk/recipes-devtools/meson/meson/meson-setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ def __getitem__(self, name):
2727

2828
template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template')
2929
cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"])
30+
native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template')
31+
native_file = os.path.join(sysroot, 'usr/share/meson/meson.native')
3032

3133
with open(template_file) as in_file:
3234
template = in_file.read()
3335
output = Template(template).substitute(Environ())
3436
with open(cross_file, "w") as out_file:
3537
out_file.write(output)
38+
39+
with open(native_template_file) as in_file:
40+
template = in_file.read()
41+
output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']})
42+
with open(native_file, "w") as out_file:
43+
out_file.write(output)
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
#!/bin/sh
22

33
if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
4-
echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2
4+
exec "meson.real" "$@"
5+
fi
6+
7+
if [ -z "$SSL_CERT_DIR" ]; then
8+
export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
59
fi
610

711
# If these are set to a cross-compile path, meson will get confused and try to
812
# use them as native tools. Unset them to prevent this, as all the cross-compile
913
# config is already in meson.cross.
1014
unset CC CXX CPP LD AR NM STRIP
1115

16+
case "$1" in
17+
setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help) MESON_CMD="$1" ;;
18+
*) echo meson-wrapper: Implicit setup command assumed; MESON_CMD=setup ;;
19+
esac
20+
21+
if [ "$MESON_CMD" = "setup" ]; then
22+
MESON_SETUP_OPTS=" \
23+
--cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
24+
--native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
25+
"
26+
echo meson-wrapper: Running meson with setup options: \"$MESON_SETUP_OPTS\"
27+
fi
28+
1229
exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
13-
--cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
14-
"$@"
30+
"$@" \
31+
$MESON_SETUP_OPTS

0 commit comments

Comments
 (0)