summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/meson')
-rw-r--r--meta/recipes-devtools/meson/meson.inc32
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch32
-rw-r--r--meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch36
-rw-r--r--meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch41
-rw-r--r--meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch54
-rw-r--r--meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch6
-rw-r--r--meta/recipes-devtools/meson/meson/0003-native_bindir.patch126
-rw-r--r--meta/recipes-devtools/meson/meson/cross-prop-default.patch23
-rw-r--r--meta/recipes-devtools/meson/meson/disable-rpath-handling.patch35
-rwxr-xr-xmeta/recipes-devtools/meson/meson/meson-setup.py8
-rwxr-xr-xmeta/recipes-devtools/meson/meson/meson-wrapper23
-rw-r--r--meta/recipes-devtools/meson/meson_0.57.1.bb4
-rw-r--r--meta/recipes-devtools/meson/meson_1.3.1.bb158
-rw-r--r--meta/recipes-devtools/meson/nativesdk-meson_0.57.1.bb66
14 files changed, 231 insertions, 413 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
deleted file mode 100644
index 622c22affd..0000000000
--- a/meta/recipes-devtools/meson/meson.inc
+++ /dev/null
@@ -1,32 +0,0 @@
1HOMEPAGE = "http://mesonbuild.com"
2SUMMARY = "A high performance build system"
3DESCRIPTION = "Meson is a build system designed to increase programmer \
4productivity. It does this by providing a fast, simple and easy to use \
5interface for modern software development tools and practices."
6
7LICENSE = "Apache-2.0"
8LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
9
10SRC_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://0003-native_bindir.patch \
13 file://0001-python-module-do-not-manipulate-the-environment-when.patch \
14 file://disable-rpath-handling.patch \
15 file://cross-prop-default.patch \
16 file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
17 "
18SRC_URI[sha256sum] = "72e1c782ba9bda204f4a1ed57f98d027d7b6eb9414c723eebbd6ec7f1955c8a6"
19
20SRC_URI_append_class-native = " \
21 file://0001-Make-CPU-family-warnings-fatal.patch \
22 file://0002-Support-building-allarch-recipes-again.patch \
23"
24
25UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
26UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar"
27
28inherit setuptools3
29
30RDEPENDS_${PN} = "ninja python3-modules python3-pkg-resources"
31
32FILES_${PN} += "${datadir}/polkit-1"
diff --git a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
index 0808891a27..8ea7c35950 100644
--- a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
+++ b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
@@ -1,4 +1,4 @@
1From 76934bcbf2cfa7304e8864e28c51f58adda0392f Mon Sep 17 00:00:00 2001 1From b77cbe67df5fa0998946503f207c256ee740bb5f Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com> 2From: Ross Burton <ross.burton@intel.com>
3Date: Tue, 3 Jul 2018 13:59:09 +0100 3Date: Tue, 3 Jul 2018 13:59:09 +0100
4Subject: [PATCH] Make CPU family warnings fatal 4Subject: [PATCH] Make CPU family warnings fatal
@@ -7,34 +7,38 @@ Upstream-Status: Inappropriate [OE specific]
7Signed-off-by: Ross Burton <ross.burton@intel.com> 7Signed-off-by: Ross Burton <ross.burton@intel.com>
8 8
9--- 9---
10 mesonbuild/envconfig.py | 2 +- 10 mesonbuild/envconfig.py | 4 ++--
11 mesonbuild/environment.py | 4 +--- 11 mesonbuild/environment.py | 6 ++----
12 2 files changed, 2 insertions(+), 4 deletions(-) 12 2 files changed, 4 insertions(+), 6 deletions(-)
13 13
14diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py 14diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15index ba35d16..2d3c34c 100644 15index 07f1229..a35c356 100644
16--- a/mesonbuild/envconfig.py 16--- a/mesonbuild/envconfig.py
17+++ b/mesonbuild/envconfig.py 17+++ b/mesonbuild/envconfig.py
18@@ -262,7 +262,7 @@ class MachineInfo: 18@@ -285,8 +285,8 @@ class MachineInfo(HoldableObject):
19 'but is missing {}.'.format(minimum_literal - set(literal)))
19 20
20 cpu_family = literal['cpu_family'] 21 cpu_family = literal['cpu_family']
21 if cpu_family not in known_cpu_families: 22- if cpu_family not in known_cpu_families:
22- mlog.warning('Unknown CPU family {}, please report this at https://github.com/mesonbuild/meson/issues/new'.format(cpu_family)) 23- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new')
24+ if cpu_family not in known_cpu_families and cpu_family != "riscv":
23+ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family)) 25+ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family))
24 26
25 endian = literal['endian'] 27 endian = literal['endian']
26 if endian not in ('little', 'big'): 28 if endian not in ('little', 'big'):
27diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py 29diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
28index 756dd81..4d2c2b6 100644 30index 2ba2054..d798e3b 100644
29--- a/mesonbuild/environment.py 31--- a/mesonbuild/environment.py
30+++ b/mesonbuild/environment.py 32+++ b/mesonbuild/environment.py
31@@ -434,9 +434,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str: 33@@ -359,10 +359,8 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
32 trial = 'ppc64' 34 if compilers and not any_compiler_has_define(compilers, '__mips64'):
35 trial = 'mips'
33 36
34 if trial not in known_cpu_families: 37- if trial not in known_cpu_families:
35- mlog.warning('Unknown CPU family {!r}, please report this at ' 38- mlog.warning(f'Unknown CPU family {trial!r}, please report this at '
36- 'https://github.com/mesonbuild/meson/issues/new with the ' 39- 'https://github.com/mesonbuild/meson/issues/new with the '
37- 'output of `uname -a` and `cat /proc/cpuinfo`'.format(trial)) 40- 'output of `uname -a` and `cat /proc/cpuinfo`')
41+ if trial not in known_cpu_families and trail != "riscv":
38+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) 42+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial)
39 43
40 return trial 44 return trial
diff --git a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
deleted file mode 100644
index 471f1500da..0000000000
--- a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From d3ef01a4208a801acad380a4aaceb6a21f8fa603 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 4 Aug 2017 16:16:41 +0300
4Subject: [PATCH] gtkdoc: fix issues that arise when cross-compiling
5
6Specifically:
71) Make it possible to specify a wrapper for executing binaries
8(usually, some kind of target hardware emulator, such as qemu)
92) Explicitly provide CC and LD via command line, as otherwise gtk-doc will
10try to guess them, incorrectly.
113) If things break down, print the full command with arguments,
12not just the binary name.
134) Correctly determine the compiler/linker executables and cross-options when cross-compiling
14
15Upstream-Status: Pending
16Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
17
18---
19 mesonbuild/modules/gnome.py | 4 ++++
20 1 file changed, 4 insertions(+)
21
22diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
23index bcf77b9..6a4b472 100644
24--- a/mesonbuild/modules/gnome.py
25+++ b/mesonbuild/modules/gnome.py
26@@ -974,6 +974,10 @@ This will become a hard error in the future.''')
27 args.append('--{}={}'.format(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)
diff --git a/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch b/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch
deleted file mode 100644
index 231414fcb6..0000000000
--- a/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From f8f67c8d5c3f374b1e30e2d40cb56a79f0544471 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 18 Apr 2019 17:36:11 +0200
4Subject: [PATCH] modules/python.py: do not substitute python's install prefix
5 with meson's
6
7Not sure why this is being done, but it
8a) relies on Python's internal variable substitution which may break in the future
9b) shouldn't be necessary as Python's prefix ought to be correct in the first place
10
11Upstream-Status: Pending
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13
14---
15 mesonbuild/modules/python.py | 6 +++---
16 1 file changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
19index 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']
diff --git a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch
index eb0e90dbdd..2e0a4b1bbe 100644
--- a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch
+++ b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch
@@ -1,4 +1,4 @@
1From 689e28c49b85311f93f39df70cbee702fc44afb6 Mon Sep 17 00:00:00 2001 1From e85683698aa3556bf14fc6d35f2c067f16af520b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 19 Nov 2018 14:24:26 +0100 3Date: Mon, 19 Nov 2018 14:24:26 +0100
4Subject: [PATCH] python module: do not manipulate the environment when calling 4Subject: [PATCH] python module: do not manipulate the environment when calling
@@ -8,36 +8,30 @@ Upstream-Status: Inappropriate [oe-core specific]
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9 9
10--- 10---
11 mesonbuild/modules/python.py | 12 ------------ 11 mesonbuild/dependencies/python.py | 6 +-----
12 1 file changed, 12 deletions(-) 12 1 file changed, 1 insertion(+), 5 deletions(-)
13 13
14diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py 14diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
15index 07be318..b770603 100644 15index 9aea6bd..8c13ede 100644
16--- a/mesonbuild/modules/python.py 16--- a/mesonbuild/dependencies/python.py
17+++ b/mesonbuild/modules/python.py 17+++ b/mesonbuild/dependencies/python.py
18@@ -71,11 +71,6 @@ class PythonDependency(ExternalDependency): 18@@ -380,9 +380,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
19 old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR') 19 empty.name = 'python'
20 old_pkg_path = os.environ.get('PKG_CONFIG_PATH') 20 return empty
21 21
22- os.environ.pop('PKG_CONFIG_PATH', None) 22- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None)
23- 23- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None)
24- if pkg_libdir: 24- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
25- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
26-
27 try: 25 try:
28 self.pkgdep = PkgConfigDependency(pkg_name, environment, kwargs) 26 return PythonPkgConfigDependency(name, env, kwargs, installation, True)
29 mlog.debug('Found "{}" via pkgconfig lookup in LIBPC ({})'.format(pkg_name, pkg_libdir)) 27 finally:
30@@ -84,13 +79,6 @@ class PythonDependency(ExternalDependency): 28@@ -391,8 +388,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
31 mlog.debug('"{}" could not be found in LIBPC ({})'.format(pkg_name, pkg_libdir)) 29 os.environ[name] = value
32 mlog.debug(e) 30 elif name in os.environ:
33 31 del os.environ[name]
34- if old_pkg_path is not None: 32- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir)
35- os.environ['PKG_CONFIG_PATH'] = old_pkg_path 33- set_env('PKG_CONFIG_PATH', old_pkg_path)
36- 34+ pass
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('"{}" could not be found in LIBPC ({}), this is likely due to a relocated python installation'.format(pkg_name, pkg_libdir))
43 35
36 candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation))
37 # We only need to check both, if a python install has a LIBPC. It might point to the wrong location,
diff --git a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
index ddc34c2f49..a8396f30bb 100644
--- a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
+++ b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
@@ -1,4 +1,4 @@
1From 6efb6114836fd4a1e012aa03b37f3beeeb22b466 Mon Sep 17 00:00:00 2001 1From 6fb8db54929b40e1fd7ac949ef44f0d37df0bae9 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com> 2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Thu, 26 Jul 2018 16:32:49 +0200 3Date: Thu, 26 Jul 2018 16:32:49 +0200
4Subject: [PATCH] Support building allarch recipes again 4Subject: [PATCH] Support building allarch recipes again
@@ -13,10 +13,10 @@ Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
13 1 file changed, 1 insertion(+) 13 1 file changed, 1 insertion(+)
14 14
15diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py 15diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
16index 2d3c34c..b9e7908 100644 16index a35c356..436355f 100644
17--- a/mesonbuild/envconfig.py 17--- a/mesonbuild/envconfig.py
18+++ b/mesonbuild/envconfig.py 18+++ b/mesonbuild/envconfig.py
19@@ -36,6 +36,7 @@ from pathlib import Path 19@@ -38,6 +38,7 @@ from pathlib import Path
20 20
21 21
22 known_cpu_families = ( 22 known_cpu_families = (
diff --git a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch b/meta/recipes-devtools/meson/meson/0003-native_bindir.patch
deleted file mode 100644
index ed85116c4f..0000000000
--- a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch
+++ /dev/null
@@ -1,126 +0,0 @@
1From 1546e1f95a119175b7a4e4272a26dd85505e5ede Mon Sep 17 00:00:00 2001
2From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
3Date: Wed, 15 Nov 2017 15:05:01 +0100
4Subject: [PATCH] native_bindir
5
6Some libraries, like QT, have pre-processors that convert their input
7files into something that the cross-compiler can process. We find the
8path of those pre-processors via pkg-config-native instead of
9pkg-config.
10
11This path forces the use of pkg-config-native for host_bins arguments.
12
13There are some discussions upstream to merge this patch, but I presonaly believe
14that is is OE only. https://github.com/mesonbuild/meson/issues/1849#issuecomment-303730323
15
16Upstream-Status: Inappropriate [OE specific]
17Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
18
19---
20 mesonbuild/dependencies/base.py | 19 +++++++++++--------
21 mesonbuild/dependencies/ui.py | 6 +++---
22 2 files changed, 14 insertions(+), 11 deletions(-)
23
24diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
25index cd77b4b..7e3f338 100644
26--- a/mesonbuild/dependencies/base.py
27+++ b/mesonbuild/dependencies/base.py
28@@ -192,7 +192,7 @@ class Dependency:
29 def get_exe_args(self, compiler):
30 return []
31
32- def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str:
33+ def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str:
34 raise DependencyException('{!r} is not a pkgconfig dependency'.format(self.name))
35
36 def get_configtool_variable(self, variable_name):
37@@ -280,7 +280,7 @@ class InternalDependency(Dependency):
38 return True
39 return any(d.is_built() for d in self.ext_deps)
40
41- def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str:
42+ def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str:
43 raise DependencyException('Method "get_pkgconfig_variable()" is '
44 'invalid for an internal dependency')
45
46@@ -658,8 +658,11 @@ class PkgConfigDependency(ExternalDependency):
47 return s.format(self.__class__.__name__, self.name, self.is_found,
48 self.version_reqs)
49
50- def _call_pkgbin_real(self, args, env):
51- cmd = self.pkgbin.get_command() + args
52+ def _call_pkgbin_real(self, args, env, use_native=False):
53+ if use_native:
54+ cmd = [self.pkgbin.get_command()[0] + "-native"] + args
55+ else:
56+ cmd = self.pkgbin.get_command() + args
57 p, out, err = Popen_safe(cmd, env=env)
58 rc, out, err = p.returncode, out.strip(), err.strip()
59 call = ' '.join(cmd)
60@@ -685,7 +688,7 @@ class PkgConfigDependency(ExternalDependency):
61 env['PKG_CONFIG_LIBDIR'] = new_pkg_config_libdir
62 mlog.debug('PKG_CONFIG_LIBDIR: ' + new_pkg_config_libdir)
63
64- def _call_pkgbin(self, args, env=None):
65+ def _call_pkgbin(self, args, env=None, use_native=False):
66 # Always copy the environment since we're going to modify it
67 # with pkg-config variables
68 if env is None:
69@@ -699,7 +702,7 @@ class PkgConfigDependency(ExternalDependency):
70 targs = tuple(args)
71 cache = PkgConfigDependency.pkgbin_cache
72 if (self.pkgbin, targs, fenv) not in cache:
73- cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env)
74+ cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env, use_native)
75 return cache[(self.pkgbin, targs, fenv)]
76
77 def _convert_mingw_paths(self, args: T.List[str]) -> T.List[str]:
78@@ -905,7 +908,7 @@ class PkgConfigDependency(ExternalDependency):
79 (self.name, out_raw))
80 self.link_args, self.raw_link_args = self._search_libs(out, out_raw)
81
82- def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str:
83+ def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str:
84 options = ['--variable=' + variable_name, self.name]
85
86 if 'define_variable' in kwargs:
87@@ -918,7 +921,7 @@ class PkgConfigDependency(ExternalDependency):
88
89 options = ['--define-variable=' + '='.join(definition)] + options
90
91- ret, out, err = self._call_pkgbin(options)
92+ ret, out, err = self._call_pkgbin(options, use_native=use_native)
93 variable = ''
94 if ret != 0:
95 if self.required:
96diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
97index d897d76..a598d2e 100644
98--- a/mesonbuild/dependencies/ui.py
99+++ b/mesonbuild/dependencies/ui.py
100@@ -325,7 +325,7 @@ class QtBaseDependency(ExternalDependency):
101 self.bindir = self.get_pkgconfig_host_bins(core)
102 if not self.bindir:
103 # If exec_prefix is not defined, the pkg-config file is broken
104- prefix = core.get_pkgconfig_variable('exec_prefix', {})
105+ prefix = core.get_pkgconfig_variable('exec_prefix', {}, use_native=True)
106 if prefix:
107 self.bindir = os.path.join(prefix, 'bin')
108
109@@ -528,7 +528,7 @@ class Qt4Dependency(QtBaseDependency):
110 applications = ['moc', 'uic', 'rcc', 'lupdate', 'lrelease']
111 for application in applications:
112 try:
113- return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}))
114+ return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}, use_native=True))
115 except MesonException:
116 pass
117
118@@ -538,7 +538,7 @@ class Qt5Dependency(QtBaseDependency):
119 QtBaseDependency.__init__(self, 'qt5', env, kwargs)
120
121 def get_pkgconfig_host_bins(self, core):
122- return core.get_pkgconfig_variable('host_bins', {})
123+ return core.get_pkgconfig_variable('host_bins', {}, use_native=True)
124
125 def get_private_includes(self, mod_inc_dir, module):
126 return _qt_get_private_includes(mod_inc_dir, module, self.version)
diff --git a/meta/recipes-devtools/meson/meson/cross-prop-default.patch b/meta/recipes-devtools/meson/meson/cross-prop-default.patch
deleted file mode 100644
index 772395e879..0000000000
--- a/meta/recipes-devtools/meson/meson/cross-prop-default.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1meson.build files that use cc.run() in native builds can silently fallback to
2meson.get_cross_property() in cross builds without an exe-wrapper, but there's
3no way to know that this is happening.
4
5As the defaults may be pessimistic (for example, disabling the support for a
6feature that should be enabled) emit a warning when the default is used, so that
7the recipe can explicitly set the cross property as relevant.
8
9Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/5071]
10Signed-off-by: Ross Burton <ross.burton@intel.com>
11
12diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
13index 3c3cfae0..10e741ae 100644
14--- a/mesonbuild/interpreter.py
15+++ b/mesonbuild/interpreter.py
16@@ -1890,6 +1890,7 @@ class MesonMain(InterpreterObject):
17 return props[propname]
18 except Exception:
19 if len(args) == 2:
20+ mlog.warning('Cross property %s is using default value %s' % (propname, args[1]))
21 return args[1]
22 raise InterpreterException('Unknown cross property: %s.' % propname)
23
diff --git a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch b/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch
deleted file mode 100644
index 7c766c61b0..0000000000
--- a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From 27bbd3c9d8d86de545fcf6608564a14571c98a61 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Fri, 23 Nov 2018 15:28:28 +0000
4Subject: [PATCH] meson: Disable rpath stripping at install time
5
6We need to allow our rpaths generated through the compiler flags to make it into
7our binaries. Therefore disable the meson manipulations of these unless there
8is a specific directive to do something differently in the project.
9
10RP 2018/11/23
11
12Upstream-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
18diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
19index 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
diff --git a/meta/recipes-devtools/meson/meson/meson-setup.py b/meta/recipes-devtools/meson/meson/meson-setup.py
index 7ac4e3ad47..daaa551de2 100755
--- a/meta/recipes-devtools/meson/meson/meson-setup.py
+++ b/meta/recipes-devtools/meson/meson/meson-setup.py
@@ -27,9 +27,17 @@ except KeyError:
27 27
28template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template') 28template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template')
29cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"]) 29cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"])
30native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template')
31native_file = os.path.join(sysroot, 'usr/share/meson/meson.native')
30 32
31with open(template_file) as in_file: 33with open(template_file) as in_file:
32 template = in_file.read() 34 template = in_file.read()
33 output = Template(template).substitute(Environ()) 35 output = Template(template).substitute(Environ())
34 with open(cross_file, "w") as out_file: 36 with open(cross_file, "w") as out_file:
35 out_file.write(output) 37 out_file.write(output)
38
39with 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)
diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
index d4ffe60f9a..7455985297 100755
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ b/meta/recipes-devtools/meson/meson/meson-wrapper
@@ -1,7 +1,11 @@
1#!/bin/sh 1#!/bin/sh
2 2
3if [ -z "$OECORE_NATIVE_SYSROOT" ]; then 3if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
4 echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2 4 exec "meson.real" "$@"
5fi
6
7if [ -z "$SSL_CERT_DIR" ]; then
8 export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
5fi 9fi
6 10
7# If these are set to a cross-compile path, meson will get confused and try to 11# If these are set to a cross-compile path, meson will get confused and try to
@@ -9,6 +13,19 @@ fi
9# config is already in meson.cross. 13# config is already in meson.cross.
10unset CC CXX CPP LD AR NM STRIP 14unset CC CXX CPP LD AR NM STRIP
11 15
16case "$1" in
17setup|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 ;;
19esac
20
21if [ "$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\"
27fi
28
12exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ 29exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
13 --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \ 30 "$@" \
14 "$@" 31 $MESON_SETUP_OPTS
diff --git a/meta/recipes-devtools/meson/meson_0.57.1.bb b/meta/recipes-devtools/meson/meson_0.57.1.bb
deleted file mode 100644
index de9b905c12..0000000000
--- a/meta/recipes-devtools/meson/meson_0.57.1.bb
+++ /dev/null
@@ -1,4 +0,0 @@
1include meson.inc
2
3BBCLASSEXTEND = "native"
4
diff --git a/meta/recipes-devtools/meson/meson_1.3.1.bb b/meta/recipes-devtools/meson/meson_1.3.1.bb
new file mode 100644
index 0000000000..9cc0cc31ab
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson_1.3.1.bb
@@ -0,0 +1,158 @@
1HOMEPAGE = "http://mesonbuild.com"
2SUMMARY = "A high performance build system"
3DESCRIPTION = "Meson is a build system designed to increase programmer \
4productivity. It does this by providing a fast, simple and easy to use \
5interface for modern software development tools and practices."
6
7LICENSE = "Apache-2.0"
8LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
9
10GITHUB_BASE_URI = "https://github.com/mesonbuild/meson/releases/"
11SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \
12 file://meson-setup.py \
13 file://meson-wrapper \
14 file://0001-python-module-do-not-manipulate-the-environment-when.patch \
15 file://0001-Make-CPU-family-warnings-fatal.patch \
16 file://0002-Support-building-allarch-recipes-again.patch \
17 "
18SRC_URI[sha256sum] = "6020568bdede1643d4fb41e28215be38eff5d52da28ac7d125457c59e0032ad7"
19UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$"
20
21inherit python_setuptools_build_meta github-releases
22
23RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources"
24
25FILES:${PN} += "${datadir}/polkit-1"
26
27do_install:append () {
28 # As per the same issue in the python recipe itself:
29 # Unfortunately the following pyc files are non-deterministc due to 'frozenset'
30 # being written without strict ordering, even with PYTHONHASHSEED = 0
31 # Upstream is discussing ways to solve the issue properly, until then let's
32 # just not install the problematic files.
33 # More info: http://benno.id.au/blog/2013/01/15/python-determinism
34 rm -f ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython*
35}
36
37BBCLASSEXTEND = "native nativesdk"
38
39inherit meson-routines
40
41# The cross file logic is similar but not identical to that in meson.bbclass,
42# since it's generating for an SDK rather than a cross-compile. Important
43# differences are:
44# - We can't set vars like CC, CXX, etc. yet because they will be filled in with
45# real paths by meson-setup.sh when the SDK is extracted.
46# - Some overrides aren't needed, since the SDK injects paths that take care of
47# them.
48def var_list2str(var, d):
49 items = d.getVar(var).split()
50 return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items)
51
52def generate_native_link_template(d):
53 val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}',
54 '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
55 '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}',
56 '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
57 '-Wl,--allow-shlib-undefined'
58 ]
59 build_arch = d.getVar('BUILD_ARCH')
60 if 'x86_64' in build_arch:
61 loader = 'ld-linux-x86-64.so.2'
62 elif 'i686' in build_arch:
63 loader = 'ld-linux.so.2'
64 elif 'aarch64' in build_arch:
65 loader = 'ld-linux-aarch64.so.1'
66 elif 'ppc64le' in build_arch:
67 loader = 'ld64.so.2'
68 elif 'loongarch64' in build_arch:
69 loader = 'ld-linux-loongarch-lp64d.so.1'
70 elif 'riscv64' in build_arch:
71 loader = 'ld-linux-riscv64-lp64d.so.1'
72
73 if loader:
74 val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader]
75
76 return repr(val)
77
78install_templates() {
79 install -d ${D}${datadir}/meson
80
81 cat >${D}${datadir}/meson/meson.native.template <<EOF
82[binaries]
83c = ${@meson_array('BUILD_CC', d)}
84cpp = ${@meson_array('BUILD_CXX', d)}
85ar = ${@meson_array('BUILD_AR', d)}
86nm = ${@meson_array('BUILD_NM', d)}
87strip = ${@meson_array('BUILD_STRIP', d)}
88readelf = ${@meson_array('BUILD_READELF', d)}
89pkgconfig = 'pkg-config-native'
90
91[built-in options]
92c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
93c_link_args = ${@generate_native_link_template(d)}
94cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
95cpp_link_args = ${@generate_native_link_template(d)}
96[properties]
97sys_root = '@OECORE_NATIVE_SYSROOT'
98EOF
99
100 cat >${D}${datadir}/meson/meson.cross.template <<EOF
101[binaries]
102c = @CC
103cpp = @CXX
104ar = @AR
105nm = @NM
106strip = @STRIP
107pkgconfig = 'pkg-config'
108
109[built-in options]
110c_args = @CFLAGS
111c_link_args = @LDFLAGS
112cpp_args = @CPPFLAGS
113cpp_link_args = @LDFLAGS
114
115[properties]
116needs_exe_wrapper = true
117sys_root = @OECORE_TARGET_SYSROOT
118
119[host_machine]
120system = '$host_system'
121cpu_family = '$host_cpu_family'
122cpu = '$host_cpu'
123endian = '$host_endian'
124EOF
125}
126
127do_install:append:class-nativesdk() {
128 host_system=${SDK_OS}
129 host_cpu_family=${@meson_cpu_family("SDK_ARCH", d)}
130 host_cpu=${SDK_ARCH}
131 host_endian=${@meson_endian("SDK", d)}
132 install_templates
133
134 install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
135 install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
136
137 # We need to wrap the real meson with a thin env setup wrapper.
138 mv ${D}${bindir}/meson ${D}${bindir}/meson.real
139 install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson
140}
141
142FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}"
143
144do_install:append:class-native() {
145 host_system=${HOST_OS}
146 host_cpu_family=${@meson_cpu_family("HOST_ARCH", d)}
147 host_cpu=${HOST_ARCH}
148 host_endian=${@meson_endian("HOST", d)}
149 install_templates
150
151 install -d ${D}${datadir}/post-relocate-setup.d
152 install -m 0755 ${WORKDIR}/meson-setup.py ${D}${datadir}/post-relocate-setup.d/
153
154 # We need to wrap the real meson with a thin wrapper that substitues native/cross files
155 # when running in a direct SDK environment.
156 mv ${D}${bindir}/meson ${D}${bindir}/meson.real
157 install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson
158}
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.57.1.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.57.1.bb
deleted file mode 100644
index 8778cab124..0000000000
--- a/meta/recipes-devtools/meson/nativesdk-meson_0.57.1.bb
+++ /dev/null
@@ -1,66 +0,0 @@
1include meson.inc
2
3inherit siteinfo
4inherit nativesdk
5
6SRC_URI += "file://meson-setup.py \
7 file://meson-wrapper"
8
9def meson_endian(prefix, d):
10 arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS")
11 sitedata = siteinfo_data_for_machine(arch, os, d)
12 if "endian-little" in sitedata:
13 return "little"
14 elif "endian-big" in sitedata:
15 return "big"
16 else:
17 bb.fatal("Cannot determine endianism for %s-%s" % (arch, os))
18
19# The cross file logic is similar but not identical to that in meson.bbclass,
20# since it's generating for an SDK rather than a cross-compile. Important
21# differences are:
22# - We can't set vars like CC, CXX, etc. yet because they will be filled in with
23# real paths by meson-setup.sh when the SDK is extracted.
24# - Some overrides aren't needed, since the SDK injects paths that take care of
25# them.
26do_install_append() {
27 install -d ${D}${datadir}/meson
28 cat >${D}${datadir}/meson/meson.cross.template <<EOF
29[binaries]
30c = @CC
31cpp = @CXX
32ar = @AR
33nm = @NM
34strip = @STRIP
35pkgconfig = 'pkg-config'
36
37[properties]
38needs_exe_wrapper = true
39c_args = @CFLAGS
40c_link_args = @LDFLAGS
41cpp_args = @CPPFLAGS
42cpp_link_args = @LDFLAGS
43sys_root = @OECORE_TARGET_SYSROOT
44
45[host_machine]
46system = '${SDK_OS}'
47cpu_family = '${SDK_ARCH}'
48cpu = '${SDK_ARCH}'
49endian = '${@meson_endian("SDK", d)}'
50EOF
51
52 install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
53 install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
54
55 # We need to wrap the real meson with a thin env setup wrapper.
56 mv ${D}${bindir}/meson ${D}${bindir}/meson.real
57 install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson
58}
59
60RDEPENDS_${PN} += "\
61 nativesdk-ninja \
62 nativesdk-python3 \
63 nativesdk-python3-setuptools \
64 "
65
66FILES_${PN} += "${datadir}/meson ${SDKPATHNATIVE}"