Skip to content

Commit e2a58e4

Browse files
committed
meta-zephyr-sdk: Upgrade meson to 0.59.1
This commit upgrades the meson package version from 0.55.1, which is provided by the current Poky distribution used, to 0.59.1. Meson 0.58.2 or above is required for building QEMU 6.2. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 7340560 commit e2a58e4

11 files changed

+379
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HOMEPAGE = "http://mesonbuild.com"
2+
SUMMARY = "A high performance build system"
3+
DESCRIPTION = "Meson is a build system designed to increase programmer \
4+
productivity. It does this by providing a fast, simple and easy to use \
5+
interface for modern software development tools and practices."
6+
7+
LICENSE = "Apache-2.0"
8+
LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
9+
10+
SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \
11+
file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \
12+
file://0001-python-module-do-not-manipulate-the-environment-when.patch \
13+
file://disable-rpath-handling.patch \
14+
file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
15+
file://0001-Make-CPU-family-warnings-fatal.patch \
16+
file://0002-Support-building-allarch-recipes-again.patch \
17+
"
18+
SRC_URI[sha256sum] = "db586a451650d46bbe10984a87b79d9bcdc1caebf38d8e189f8848f8d502356d"
19+
20+
UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
21+
UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar"
22+
23+
inherit setuptools3
24+
25+
RDEPENDS_${PN} = "ninja python3-modules python3-pkg-resources"
26+
27+
FILES_${PN} += "${datadir}/polkit-1"
28+
29+
do_install_append () {
30+
# As per the same issue in the python recipe itself:
31+
# Unfortunately the following pyc files are non-deterministc due to 'frozenset'
32+
# being written without strict ordering, even with PYTHONHASHSEED = 0
33+
# Upstream is discussing ways to solve the issue properly, until then let's
34+
# just not install the problematic files.
35+
# More info: http://benno.id.au/blog/2013/01/15/python-determinism
36+
rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython*
37+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 6c4eef1d92e9e42fdbc888365cab3c95fb33c605 Mon Sep 17 00:00:00 2001
2+
From: Ross Burton <[email protected]>
3+
Date: Tue, 3 Jul 2018 13:59:09 +0100
4+
Subject: [PATCH] Make CPU family warnings fatal
5+
6+
Upstream-Status: Inappropriate [OE specific]
7+
Signed-off-by: Ross Burton <[email protected]>
8+
9+
---
10+
mesonbuild/envconfig.py | 2 +-
11+
mesonbuild/environment.py | 4 +---
12+
2 files changed, 2 insertions(+), 4 deletions(-)
13+
14+
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15+
index 307aac3..66fb7ec 100644
16+
--- a/mesonbuild/envconfig.py
17+
+++ b/mesonbuild/envconfig.py
18+
@@ -267,7 +267,7 @@ class MachineInfo(HoldableObject):
19+
20+
cpu_family = literal['cpu_family']
21+
if cpu_family not in known_cpu_families:
22+
- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new')
23+
+ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family))
24+
25+
endian = literal['endian']
26+
if endian not in ('little', 'big'):
27+
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
28+
index 71286a5..179917e 100644
29+
--- a/mesonbuild/environment.py
30+
+++ b/mesonbuild/environment.py
31+
@@ -352,9 +352,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
32+
trial = 'ppc64'
33+
34+
if trial not in known_cpu_families:
35+
- mlog.warning(f'Unknown CPU family {trial!r}, please report this at '
36+
- 'https://github.com/mesonbuild/meson/issues/new with the '
37+
- 'output of `uname -a` and `cat /proc/cpuinfo`')
38+
+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial)
39+
40+
return trial
41+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 2f9c59e0489e569c5382404667c10f5c200a72ad Mon Sep 17 00:00:00 2001
2+
From: Alexander Kanavin <[email protected]>
3+
Date: Fri, 4 Aug 2017 16:16:41 +0300
4+
Subject: [PATCH] gtkdoc: fix issues that arise when cross-compiling
5+
6+
Specifically:
7+
1) Make it possible to specify a wrapper for executing binaries
8+
(usually, some kind of target hardware emulator, such as qemu)
9+
2) Explicitly provide CC and LD via command line, as otherwise gtk-doc will
10+
try to guess them, incorrectly.
11+
3) If things break down, print the full command with arguments,
12+
not just the binary name.
13+
4) Correctly determine the compiler/linker executables and cross-options when cross-compiling
14+
15+
Upstream-Status: Pending
16+
Signed-off-by: Alexander Kanavin <[email protected]>
17+
18+
---
19+
mesonbuild/modules/gnome.py | 4 ++++
20+
1 file changed, 4 insertions(+)
21+
22+
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
23+
index dc2979e..c9ff9bd 100644
24+
--- a/mesonbuild/modules/gnome.py
25+
+++ b/mesonbuild/modules/gnome.py
26+
@@ -1053,6 +1053,10 @@ class GnomeModule(ExtensionModule):
27+
args.append(f'--{program_name}={path}')
28+
if namespace:
29+
args.append('--namespace=' + namespace)
30+
+ gtkdoc_exe_wrapper = state.environment.properties.host.get('gtkdoc_exe_wrapper', None)
31+
+ if gtkdoc_exe_wrapper is not None:
32+
+ args.append('--run=' + gtkdoc_exe_wrapper)
33+
+
34+
args += self._unpack_args('--htmlargs=', 'html_args', kwargs)
35+
args += self._unpack_args('--scanargs=', 'scan_args', kwargs)
36+
args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From f8f67c8d5c3f374b1e30e2d40cb56a79f0544471 Mon Sep 17 00:00:00 2001
2+
From: Alexander Kanavin <[email protected]>
3+
Date: Thu, 18 Apr 2019 17:36:11 +0200
4+
Subject: [PATCH] modules/python.py: do not substitute python's install prefix
5+
with meson's
6+
7+
Not sure why this is being done, but it
8+
a) relies on Python's internal variable substitution which may break in the future
9+
b) shouldn't be necessary as Python's prefix ought to be correct in the first place
10+
11+
Upstream-Status: Pending
12+
Signed-off-by: Alexander Kanavin <[email protected]>
13+
14+
---
15+
mesonbuild/modules/python.py | 6 +++---
16+
1 file changed, 3 insertions(+), 3 deletions(-)
17+
18+
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
19+
index eda70ce..18edd15 100644
20+
--- a/mesonbuild/modules/python.py
21+
+++ b/mesonbuild/modules/python.py
22+
@@ -251,7 +251,7 @@ INTROSPECT_COMMAND = '''import sysconfig
23+
import json
24+
import sys
25+
26+
-install_paths = sysconfig.get_paths(scheme='posix_prefix', vars={'base': '', 'platbase': '', 'installed_base': ''})
27+
+install_paths = sysconfig.get_paths(scheme='posix_prefix')
28+
29+
def links_against_libpython():
30+
from distutils.core import Distribution, Extension
31+
@@ -280,8 +280,8 @@ class PythonInstallation(ExternalProgramHolder):
32+
self.variables = info['variables']
33+
self.paths = info['paths']
34+
install_paths = info['install_paths']
35+
- self.platlib_install_path = os.path.join(prefix, install_paths['platlib'][1:])
36+
- self.purelib_install_path = os.path.join(prefix, install_paths['purelib'][1:])
37+
+ self.platlib_install_path = install_paths['platlib']
38+
+ self.purelib_install_path = install_paths['purelib']
39+
self.version = info['version']
40+
self.platform = info['platform']
41+
self.is_pypy = info['is_pypy']
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 2264e67d7c2c22ca634fd26ea8ada6f0344ab280 Mon Sep 17 00:00:00 2001
2+
From: Alexander Kanavin <[email protected]>
3+
Date: Mon, 19 Nov 2018 14:24:26 +0100
4+
Subject: [PATCH] python module: do not manipulate the environment when calling
5+
pkg-config
6+
7+
Upstream-Status: Inappropriate [oe-core specific]
8+
Signed-off-by: Alexander Kanavin <[email protected]>
9+
10+
---
11+
mesonbuild/modules/python.py | 12 ------------
12+
1 file changed, 12 deletions(-)
13+
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')
21+
22+
- os.environ.pop('PKG_CONFIG_PATH', None)
23+
-
24+
- if pkg_libdir:
25+
- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
26+
-
27+
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')
43+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 656bf55fed01df2d2e2ad6d9d9887173cb16b85c Mon Sep 17 00:00:00 2001
2+
From: Peter Kjellerstedt <[email protected]>
3+
Date: Thu, 26 Jul 2018 16:32:49 +0200
4+
Subject: [PATCH 2/2] Support building allarch recipes again
5+
6+
This registers "allarch" as a known CPU family.
7+
8+
Upstream-Status: Inappropriate [OE specific]
9+
Signed-off-by: Peter Kjellerstedt <[email protected]>
10+
---
11+
mesonbuild/envconfig.py | 1 +
12+
1 file changed, 1 insertion(+)
13+
14+
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15+
index 4d58c91..ff01ad1 100644
16+
--- a/mesonbuild/envconfig.py
17+
+++ b/mesonbuild/envconfig.py
18+
@@ -36,6 +36,7 @@ from pathlib import Path
19+
20+
21+
known_cpu_families = (
22+
+ 'allarch',
23+
'aarch64',
24+
'alpha',
25+
'arc',
26+
--
27+
2.24.0
28+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 27bbd3c9d8d86de545fcf6608564a14571c98a61 Mon Sep 17 00:00:00 2001
2+
From: Richard Purdie <[email protected]>
3+
Date: Fri, 23 Nov 2018 15:28:28 +0000
4+
Subject: [PATCH] meson: Disable rpath stripping at install time
5+
6+
We need to allow our rpaths generated through the compiler flags to make it into
7+
our binaries. Therefore disable the meson manipulations of these unless there
8+
is a specific directive to do something differently in the project.
9+
10+
RP 2018/11/23
11+
12+
Upstream-Status: Submitted [https://github.com/mesonbuild/meson/issues/2567]
13+
14+
---
15+
mesonbuild/minstall.py | 7 +++++--
16+
1 file changed, 5 insertions(+), 2 deletions(-)
17+
18+
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
19+
index 212568a..06366d4 100644
20+
--- a/mesonbuild/minstall.py
21+
+++ b/mesonbuild/minstall.py
22+
@@ -653,8 +653,11 @@ class Installer:
23+
if file_copied:
24+
self.did_install_something = True
25+
try:
26+
- self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path,
27+
- install_name_mappings, verbose=False)
28+
+ if install_rpath:
29+
+ self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path,
30+
+ install_name_mappings, verbose=False)
31+
+ else:
32+
+ print("RPATH changes at install time disabled")
33+
except SystemExit as e:
34+
if isinstance(e.code, int) and e.code == 0:
35+
pass
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import string
5+
import sys
6+
7+
class Template(string.Template):
8+
delimiter = "@"
9+
10+
class Environ():
11+
def __getitem__(self, name):
12+
val = os.environ[name]
13+
val = val.split()
14+
if len(val) > 1:
15+
val = ["'%s'" % x for x in val]
16+
val = ', '.join(val)
17+
val = '[%s]' % val
18+
elif val:
19+
val = "'%s'" % val.pop()
20+
return val
21+
22+
try:
23+
sysroot = os.environ['OECORE_NATIVE_SYSROOT']
24+
except KeyError:
25+
print("Not in environment setup, bailing")
26+
sys.exit(1)
27+
28+
template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template')
29+
cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"])
30+
31+
with open(template_file) as in_file:
32+
template = in_file.read()
33+
output = Template(template).substitute(Environ())
34+
with open(cross_file, "w") as out_file:
35+
out_file.write(output)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
4+
echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2
5+
fi
6+
7+
# If these are set to a cross-compile path, meson will get confused and try to
8+
# use them as native tools. Unset them to prevent this, as all the cross-compile
9+
# config is already in meson.cross.
10+
unset CC CXX CPP LD AR NM STRIP
11+
12+
exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
13+
--cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
14+
"$@"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include meson.inc
2+
3+
BBCLASSEXTEND = "native"
4+

0 commit comments

Comments
 (0)