diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson')
16 files changed, 83 insertions, 672 deletions
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 adde1e271f..94129b2f25 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,40 +1,43 @@ -From 4b4b3d4932d928f05dbd74d730a3c8a5ac371e1d Mon Sep 17 00:00:00 2001 +From c61c93f43b70ba0670d41e841bff9f2a7186cc2f Mon Sep 17 00:00:00 2001 From: Ross Burton <ross.burton@intel.com> Date: Tue, 3 Jul 2018 13:59:09 +0100 Subject: [PATCH] Make CPU family warnings fatal Upstream-Status: Inappropriate [OE specific] Signed-off-by: Ross Burton <ross.burton@intel.com> - --- - mesonbuild/envconfig.py | 2 +- - mesonbuild/environment.py | 4 +--- - 2 files changed, 2 insertions(+), 4 deletions(-) + mesonbuild/envconfig.py | 4 ++-- + mesonbuild/environment.py | 6 ++---- + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index 5309ef4..3f0a399 100644 +index 0e9cd23..b44e60c 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -178,7 +178,7 @@ class MachineInfo: +@@ -276,8 +276,8 @@ class MachineInfo(HoldableObject): + 'but is missing {}.'.format(minimum_literal - set(literal))) cpu_family = literal['cpu_family'] - if cpu_family not in known_cpu_families: -- mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % cpu_family) -+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % cpu_family) +- if cpu_family not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new') ++ if cpu_family not in known_cpu_families and cpu_family != "riscv": ++ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family)) endian = literal['endian'] if endian not in ('little', 'big'): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 3031a82..ecd18d0 100644 +index af69f64..248d6dd 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py -@@ -242,9 +242,7 @@ def detect_cpu_family(compilers): - trial = 'parisc' +@@ -379,10 +379,8 @@ def detect_cpu_family(compilers: CompilersDict) -> str: + if compilers and not any_compiler_has_define(compilers, '__mips64'): + trial = 'mips' - if trial not in known_cpu_families: -- mlog.warning('Unknown CPU family {!r}, please report this at ' -- 'https://github.com/mesonbuild/meson/issues/new with the' -- 'output of `uname -a` and `cat /proc/cpuinfo`'.format(trial)) +- if trial not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {trial!r}, please report this at ' +- 'https://github.com/mesonbuild/meson/issues/new with the ' +- 'output of `uname -a` and `cat /proc/cpuinfo`') ++ if trial not in known_cpu_families and trail != "riscv": + raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) return trial diff --git a/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch b/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch deleted file mode 100644 index f6043190af..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 63b78b7990c5d60f7bc674a26f655caa0bec3c49 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 25 Mar 2019 17:17:06 +0100 -Subject: [PATCH] environment.py: detect windows also if the system string - contains 'mingw' - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/envconfig.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index f2510c1..5309ef4 100644 ---- a/mesonbuild/envconfig.py -+++ b/mesonbuild/envconfig.py -@@ -194,7 +194,7 @@ class MachineInfo: - """ - Machine is windows? - """ -- return self.system == 'windows' -+ return self.system == 'windows' or 'mingw' in self.system - - def is_cygwin(self): - """ 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 7c3238bf91..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1afbf5ccff56e582229c8f673f50aedf2b24117e Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 4 Aug 2017 16:16:41 +0300 -Subject: [PATCH] gtkdoc: fix issues that arise when cross-compiling - -Specifically: -1) Make it possible to specify a wrapper for executing binaries -(usually, some kind of target hardware emulator, such as qemu) -2) Explicitly provide CC and LD via command line, as otherwise gtk-doc will -try to guess them, incorrectly. -3) If things break down, print the full command with arguments, -not just the binary name. -4) Correctly determine the compiler/linker executables and cross-options when cross-compiling - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - mesonbuild/modules/gnome.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index bf49770..7c5a363 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -972,6 +972,10 @@ This will become a hard error in the future.''') - '--mode=' + mode] - if namespace: - args.append('--namespace=' + namespace) -+ gtkdoc_exe_wrapper = state.environment.properties.host.get('gtkdoc_exe_wrapper', None) -+ if gtkdoc_exe_wrapper is not None: -+ args.append('--run=' + gtkdoc_exe_wrapper) -+ - args += self._unpack_args('--htmlargs=', 'html_args', kwargs) - args += self._unpack_args('--scanargs=', 'scan_args', kwargs) - args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs) diff --git a/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch deleted file mode 100644 index fadb2734f4..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 63e79329b5dd00882f0cea56a6d907a831b94171 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 25 Mar 2019 18:52:48 +0100 -Subject: [PATCH] mesonbuild/environment.py: check environment for various - binaries - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/environment.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 6e5d689..bbfd87d 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -398,7 +398,7 @@ class Environment: - config = MesonConfigFile.from_config_parser( - coredata.load_configs(self.coredata.cross_files, 'cross')) - self.properties.host = Properties(config.get('properties', {}), False) -- self.binaries.host = BinaryTable(config.get('binaries', {}), False) -+ self.binaries.host = BinaryTable(config.get('binaries', {}), True) - if 'host_machine' in config: - self.machines.host = MachineInfo.from_literal(config['host_machine']) - if 'target_machine' in config: --- -2.17.1 - diff --git a/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch deleted file mode 100644 index 8334714541..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d9da5e7a16a9397e22a8900fac4b60b40d7f00de Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 25 Mar 2019 18:18:33 +0100 -Subject: [PATCH] mesonbuild/environment.py: do not determine whether a build - is cross by comparing architectures - -This can, and does, go wrong when our host architecture is same as the target one(e.g. x86_64). - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - mesonbuild/environment.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index d4f0630..c584fa4 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -483,7 +483,7 @@ class Environment: - self.first_invocation = True - - def is_cross_build(self): -- return self.coredata.cross_file is not None -+ return self.need_exe_wrapper() - - def dump_coredata(self): - return coredata.save(self.coredata, self.get_build_dir()) 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 a25c392270..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 1d178fb2928d325e339b15972890ceced863d3ec Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 18 Apr 2019 17:36:11 +0200 -Subject: [PATCH] modules/python.py: do not substitute python's install prefix - with meson's - -Not sure why this is being done, but it -a) relies on Python's internal variable substitution which may break in the future -b) shouldn't be necessary as Python's prefix ought to be correct in the first place - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/modules/python.py | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index 6e2c63b..f5a37ac 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -254,7 +254,7 @@ import sysconfig - import json - import sys - --install_paths = sysconfig.get_paths(scheme='posix_prefix', vars={'base': '', 'platbase': '', 'installed_base': ''}) -+install_paths = sysconfig.get_paths(scheme='posix_prefix') - - def links_against_libpython(): - from distutils.core import Distribution, Extension -@@ -279,12 +279,11 @@ class PythonInstallation(ExternalProgramHolder): - ExternalProgramHolder.__init__(self, python) - self.interpreter = interpreter - self.subproject = self.interpreter.subproject -- prefix = self.interpreter.environment.coredata.get_builtin_option('prefix') - self.variables = info['variables'] - self.paths = info['paths'] - install_paths = info['install_paths'] -- self.platlib_install_path = os.path.join(prefix, install_paths['platlib'][1:]) -- self.purelib_install_path = os.path.join(prefix, install_paths['purelib'][1:]) -+ self.platlib_install_path = install_paths['platlib'] -+ self.purelib_install_path = install_paths['purelib'] - self.version = info['version'] - self.platform = info['platform'] - 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 bf715d1e9f..9f3f516a5c 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 @@ -From 3cb2c811dc6d4890342afa5b709cd30cf7b8f3ca Mon Sep 17 00:00:00 2001 +From b4c0602a56d3517ab66b98a7dbb69defe77d29a3 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Mon, 19 Nov 2018 14:24:26 +0100 Subject: [PATCH] python module: do not manipulate the environment when calling @@ -6,38 +6,31 @@ Subject: [PATCH] python module: do not manipulate the environment when calling Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - --- - mesonbuild/modules/python.py | 12 ------------ - 1 file changed, 12 deletions(-) + mesonbuild/dependencies/python.py | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index 9cfbd6f..3ff687a 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -75,11 +75,6 @@ class PythonDependency(ExternalDependency): - old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR') - old_pkg_path = os.environ.get('PKG_CONFIG_PATH') +diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py +index b9b17f8..a305afb 100644 +--- a/mesonbuild/dependencies/python.py ++++ b/mesonbuild/dependencies/python.py +@@ -381,9 +381,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + empty.name = 'python' + return empty -- os.environ.pop('PKG_CONFIG_PATH', None) -- -- if pkg_libdir: -- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir -- +- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) +- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) +- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir try: - self.pkgdep = PkgConfigDependency('python-{}'.format(pkg_version), environment, kwargs) - mlog.debug('Found "python-{}" via pkgconfig lookup in LIBPC ({})'.format(pkg_version, pkg_libdir)) -@@ -88,13 +83,6 @@ class PythonDependency(ExternalDependency): - mlog.debug('"python-{}" could not be found in LIBPC ({})'.format(pkg_version, pkg_libdir)) - mlog.debug(e) - -- if old_pkg_path is not None: -- os.environ['PKG_CONFIG_PATH'] = old_pkg_path -- -- if old_pkg_libdir is not None: -- os.environ['PKG_CONFIG_LIBDIR'] = old_pkg_libdir -- else: -- os.environ.pop('PKG_CONFIG_LIBDIR', None) - else: - mlog.debug('"python-{}" could not be found in LIBPC ({}), this is likely due to a relocated python installation'.format(pkg_version, pkg_libdir)) + return PythonPkgConfigDependency(name, env, kwargs, installation, True) + finally: +@@ -392,8 +389,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + os.environ[name] = value + elif name in os.environ: + del os.environ[name] +- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir) +- set_env('PKG_CONFIG_PATH', old_pkg_path) ++ pass + candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation)) + # 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 e47e555324..fa5ea57d5b 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 @@ -From 2164655328ec4e47335fc9033813274365491ad8 Mon Sep 17 00:00:00 2001 +From 7f69bfabb87d311d7409ea6699f7dee8e9b3a95b Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt <pkj@axis.com> Date: Thu, 26 Jul 2018 16:32:49 +0200 Subject: [PATCH] Support building allarch recipes again @@ -7,20 +7,19 @@ This registers "allarch" as a known CPU family. Upstream-Status: Inappropriate [OE specific] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> - --- mesonbuild/envconfig.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index 3f0a399..4509e09 100644 +index b44e60c..c70e8cb 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -34,6 +34,7 @@ from . import mlog +@@ -28,6 +28,7 @@ from pathlib import Path known_cpu_families = ( + 'allarch', 'aarch64', + 'alpha', 'arc', - 'arm', diff --git a/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch b/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch deleted file mode 100644 index 61b26bb883..0000000000 --- a/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 9ccaed380780178c4dab3a681f652ac7cd27452d Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 4 Aug 2017 16:18:47 +0300 -Subject: [PATCH] gobject-introspection: determine g-ir-scanner and - g-ir-compiler paths from pkgconfig - -Do not hardcode the name of those binaries; gobject-introspection -provides them via pkgconfig, and they can be set to something else -(for example when cross-compiling). - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - mesonbuild/modules/gnome.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index 7c5a363..0002498 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -744,15 +744,15 @@ class GnomeModule(ExtensionModule): - if kwargs.get('install_dir'): - raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"') - -- giscanner = self.interpreter.find_program_impl('g-ir-scanner') -- gicompiler = self.interpreter.find_program_impl('g-ir-compiler') -- - girtargets = [self._unwrap_gir_target(arg, state) for arg in args] - - if len(girtargets) > 1 and any([isinstance(el, build.Executable) for el in girtargets]): - raise MesonException('generate_gir only accepts a single argument when one of the arguments is an executable') - - self.gir_dep, pkgargs = self._get_gir_dep(state) -+ giscanner = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {}) -+ gicompiler = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {}) -+ - - ns = kwargs.pop('namespace') - nsversion = kwargs.pop('nsversion') 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 2b22531dd0..0000000000 --- a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch +++ /dev/null @@ -1,125 +0,0 @@ -From e762d85c823adfefc27ba6128c7b997aa50166ce Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> -Date: Wed, 15 Nov 2017 15:05:01 +0100 -Subject: [PATCH] native_bindir - -Some libraries, like QT, have pre-processors that convert their input -files into something that the cross-compiler can process. We find the -path of those pre-processors via pkg-config-native instead of -pkg-config. - -This path forces the use of pkg-config-native for host_bins arguments. - -There are some discussions upstream to merge this patch, but I presonaly believe -that is is OE only. https://github.com/mesonbuild/meson/issues/1849#issuecomment-303730323 - -Upstream-Status: Inappropriate [OE specific] -Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - ---- - mesonbuild/dependencies/base.py | 19 +++++++++++-------- - mesonbuild/dependencies/ui.py | 6 +++--- - 2 files changed, 14 insertions(+), 11 deletions(-) - -diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py -index 6d3678f..90fdb80 100644 ---- a/mesonbuild/dependencies/base.py -+++ b/mesonbuild/dependencies/base.py -@@ -146,7 +146,7 @@ class Dependency: - def need_threads(self): - return False - -- def get_pkgconfig_variable(self, variable_name, kwargs): -+ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False): - raise DependencyException('{!r} is not a pkgconfig dependency'.format(self.name)) - - def get_configtool_variable(self, variable_name): -@@ -183,7 +183,7 @@ class InternalDependency(Dependency): - self.sources = sources - self.ext_deps = ext_deps - -- def get_pkgconfig_variable(self, variable_name, kwargs): -+ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False): - raise DependencyException('Method "get_pkgconfig_variable()" is ' - 'invalid for an internal dependency') - -@@ -523,15 +523,18 @@ class PkgConfigDependency(ExternalDependency): - return s.format(self.__class__.__name__, self.name, self.is_found, - self.version_reqs) - -- def _call_pkgbin_real(self, args, env): -- cmd = self.pkgbin.get_command() + args -+ def _call_pkgbin_real(self, args, env, use_native=False): -+ if use_native: -+ cmd = [self.pkgbin.get_command()[0] + "-native"] + args -+ else: -+ cmd = self.pkgbin.get_command() + args - p, out = Popen_safe(cmd, env=env)[0:2] - rc, out = p.returncode, out.strip() - call = ' '.join(cmd) - mlog.debug("Called `{}` -> {}\n{}".format(call, rc, out)) - return rc, out - -- def _call_pkgbin(self, args, env=None): -+ def _call_pkgbin(self, args, env=None, use_native=False): - if env is None: - fenv = env - env = os.environ -@@ -540,7 +543,7 @@ class PkgConfigDependency(ExternalDependency): - targs = tuple(args) - cache = PkgConfigDependency.pkgbin_cache - if (self.pkgbin, targs, fenv) not in cache: -- cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env) -+ cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env, use_native) - return cache[(self.pkgbin, targs, fenv)] - - def _convert_mingw_paths(self, args): -@@ -718,7 +721,7 @@ class PkgConfigDependency(ExternalDependency): - (self.name, out_raw)) - self.link_args, self.raw_link_args = self._search_libs(out, out_raw) - -- def get_pkgconfig_variable(self, variable_name, kwargs): -+ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False): - options = ['--variable=' + variable_name, self.name] - - if 'define_variable' in kwargs: -@@ -731,7 +734,7 @@ class PkgConfigDependency(ExternalDependency): - - options = ['--define-variable=' + '='.join(definition)] + options - -- ret, out = self._call_pkgbin(options) -+ ret, out = self._call_pkgbin(options, use_native=use_native) - variable = '' - if ret != 0: - if self.required: -diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py -index 197d22c..c683d21 100644 ---- a/mesonbuild/dependencies/ui.py -+++ b/mesonbuild/dependencies/ui.py -@@ -285,7 +285,7 @@ class QtBaseDependency(ExternalDependency): - self.bindir = self.get_pkgconfig_host_bins(core) - if not self.bindir: - # If exec_prefix is not defined, the pkg-config file is broken -- prefix = core.get_pkgconfig_variable('exec_prefix', {}) -+ prefix = core.get_pkgconfig_variable('exec_prefix', {}, use_native=True) - if prefix: - self.bindir = os.path.join(prefix, 'bin') - -@@ -427,7 +427,7 @@ class Qt4Dependency(QtBaseDependency): - applications = ['moc', 'uic', 'rcc', 'lupdate', 'lrelease'] - for application in applications: - try: -- return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {})) -+ return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}, use_native=True)) - except MesonException: - pass - -@@ -437,7 +437,7 @@ class Qt5Dependency(QtBaseDependency): - QtBaseDependency.__init__(self, 'qt5', env, kwargs) - - def get_pkgconfig_host_bins(self, core): -- return core.get_pkgconfig_variable('host_bins', {}) -+ return core.get_pkgconfig_variable('host_bins', {}, use_native=True) - - def get_private_includes(self, mod_inc_dir, module): - return _qt_get_private_includes(mod_inc_dir, module, self.version) diff --git a/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch b/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch deleted file mode 100644 index 6c2949c0e8..0000000000 --- a/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 07ae4f949b8402cff178dd12c210d9a726ffe2da Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Mon, 18 Mar 2019 17:27:57 +0000 -Subject: [PATCH] mesonbuild: allow multiple --cross-file options - -Just like --native-file, allow multiple --cross-file options. This is mostly -unifying the logic between cross_files and config_files. - -Upstream-Status: Backport [will be in 0.50.1] -Signed-off-by: Ross Burton <ross.burton@intel.com> - ---- - .../markdown/snippets/multiple-cross-files.md | 3 ++ - mesonbuild/backend/backends.py | 3 +- - mesonbuild/coredata.py | 52 +++---------------- - mesonbuild/environment.py | 5 +- - mesonbuild/msetup.py | 4 +- - mesonbuild/munstable_coredata.py | 5 +- - 6 files changed, 20 insertions(+), 52 deletions(-) - create mode 100644 docs/markdown/snippets/multiple-cross-files.md - -diff --git a/docs/markdown/snippets/multiple-cross-files.md b/docs/markdown/snippets/multiple-cross-files.md -new file mode 100644 -index 0000000..de229be ---- /dev/null -+++ b/docs/markdown/snippets/multiple-cross-files.md -@@ -0,0 +1,3 @@ -+## Multipe cross files can be specified -+ -+`--cross-file` can be passed multiple times, with the configuration files overlaying the same way as `--native-file`. -diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py -index 4d35d22..5b270d3 100644 ---- a/mesonbuild/backend/backends.py -+++ b/mesonbuild/backend/backends.py -@@ -788,8 +788,7 @@ class Backend: - deps = [os.path.join(self.build_to_src, df) - for df in self.interpreter.get_build_def_files()] - if self.environment.is_cross_build(): -- deps.append(os.path.join(self.build_to_src, -- self.environment.coredata.cross_file)) -+ deps.extend(self.environment.coredata.cross_files) - deps.append('meson-private/coredata.dat') - if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')): - deps.append(os.path.join(self.build_to_src, 'meson_options.txt')) -diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py -index 066ad30..d80e9a0 100644 ---- a/mesonbuild/coredata.py -+++ b/mesonbuild/coredata.py -@@ -265,7 +265,7 @@ class CoreData: - self.compiler_options = PerMachine({}, {}, {}) - self.base_options = {} - self.external_preprocess_args = PerMachine({}, {}, {}) # CPPFLAGS only -- self.cross_file = self.__load_cross_file(options.cross_file) -+ self.cross_files = self.__load_config_files(options.cross_file) - self.compilers = OrderedDict() - self.cross_compilers = OrderedDict() - self.deps = OrderedDict() -@@ -276,57 +276,19 @@ class CoreData: - - @staticmethod - def __load_config_files(filenames): -+ # Need to try and make the passed filenames absolute because when the -+ # files are parsed later we'll have chdir()d. - if not filenames: - return [] - filenames = [os.path.abspath(os.path.expanduser(os.path.expanduser(f))) - for f in filenames] - return filenames - -- @staticmethod -- def __load_cross_file(filename): -- """Try to load the cross file. -- -- If the filename is None return None. If the filename is an absolute -- (after resolving variables and ~), return that absolute path. Next, -- check if the file is relative to the current source dir. If the path -- still isn't resolved do the following: -- Windows: -- - Error -- *: -- - $XDG_DATA_HOME/meson/cross (or ~/.local/share/meson/cross if -- undefined) -- - $XDG_DATA_DIRS/meson/cross (or -- /usr/local/share/meson/cross:/usr/share/meson/cross if undefined) -- - Error -- -- Non-Windows follows the Linux path and will honor XDG_* if set. This -- simplifies the implementation somewhat. -- """ -- if filename is None: -- return None -- filename = os.path.expanduser(os.path.expandvars(filename)) -- if os.path.isabs(filename): -- return filename -- path_to_try = os.path.abspath(filename) -- if os.path.isfile(path_to_try): -- return path_to_try -- if sys.platform != 'win32': -- paths = [ -- os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')), -- ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') -- for path in paths: -- path_to_try = os.path.join(path, 'meson', 'cross', filename) -- if os.path.isfile(path_to_try): -- return path_to_try -- raise MesonException('Cannot find specified cross file: ' + filename) -- -- raise MesonException('Cannot find specified cross file: ' + filename) -- - def libdir_cross_fixup(self): - # By default set libdir to "lib" when cross compiling since - # getting the "system default" is always wrong on multiarch - # platforms as it gets a value like lib/x86_64-linux-gnu. -- if self.cross_file is not None: -+ if self.cross_files: - self.builtins['libdir'].value = 'lib' - - def sanitize_prefix(self, prefix): -@@ -642,8 +604,8 @@ def read_cmd_line_file(build_dir, options): - options.cmd_line_options = d - - properties = config['properties'] -- if options.cross_file is None: -- options.cross_file = properties.get('cross_file', None) -+ if not options.cross_file: -+ options.cross_file = ast.literal_eval(properties.get('cross_file', '[]')) - if not options.native_file: - # This will be a string in the form: "['first', 'second', ...]", use - # literal_eval to get it into the list of strings. -@@ -654,7 +616,7 @@ def write_cmd_line_file(build_dir, options): - config = CmdLineFileParser() - - properties = {} -- if options.cross_file is not None: -+ if options.cross_file: - properties['cross_file'] = options.cross_file - if options.native_file: - properties['native_file'] = options.native_file -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index c25ef33..4c1c5ac 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -394,8 +394,9 @@ class Environment: - self.binaries.build = BinaryTable(config.get('binaries', {})) - self.paths.build = Directories(**config.get('paths', {})) - -- if self.coredata.cross_file is not None: -- config = MesonConfigFile.parse_datafile(self.coredata.cross_file) -+ if self.coredata.cross_files: -+ config = MesonConfigFile.from_config_parser( -+ coredata.load_configs(self.coredata.cross_files, 'cross')) - self.properties.host = Properties(config.get('properties', {}), False) - self.binaries.host = BinaryTable(config.get('binaries', {}), False) - if 'host_machine' in config: -diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py -index 023afdb..6e8ca83 100644 ---- a/mesonbuild/msetup.py -+++ b/mesonbuild/msetup.py -@@ -29,7 +29,9 @@ from .mesonlib import MesonException - - def add_arguments(parser): - coredata.register_builtin_arguments(parser) -- parser.add_argument('--cross-file', default=None, -+ parser.add_argument('--cross-file', -+ default=[], -+ action='append', - help='File describing cross compilation environment.') - parser.add_argument('--native-file', - default=[], -diff --git a/mesonbuild/munstable_coredata.py b/mesonbuild/munstable_coredata.py -index 78f3f34..913f942 100644 ---- a/mesonbuild/munstable_coredata.py -+++ b/mesonbuild/munstable_coredata.py -@@ -81,8 +81,9 @@ def run(options): - print('Last seen PKGCONFIG enviroment variable value: ' + v) - elif k == 'version': - print('Meson version: ' + v) -- elif k == 'cross_file': -- print('Cross File: ' + (v or 'None')) -+ elif k == 'cross_files': -+ if v: -+ print('Cross File: ' + ' '.join(v)) - elif k == 'config_files': - if v: - print('Native File: ' + ' '.join(v)) 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 @@ -meson.build files that use cc.run() in native builds can silently fallback to -meson.get_cross_property() in cross builds without an exe-wrapper, but there's -no way to know that this is happening. - -As the defaults may be pessimistic (for example, disabling the support for a -feature that should be enabled) emit a warning when the default is used, so that -the recipe can explicitly set the cross property as relevant. - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/5071] -Signed-off-by: Ross Burton <ross.burton@intel.com> - -diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py -index 3c3cfae0..10e741ae 100644 ---- a/mesonbuild/interpreter.py -+++ b/mesonbuild/interpreter.py -@@ -1890,6 +1890,7 @@ class MesonMain(InterpreterObject): - return props[propname] - except Exception: - if len(args) == 2: -+ mlog.warning('Cross property %s is using default value %s' % (propname, args[1])) - return args[1] - raise InterpreterException('Unknown cross property: %s.' % propname) - 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 4b1fb57dd4..0000000000 --- a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch +++ /dev/null @@ -1,26 +0,0 @@ -We need to allow our rpaths generated through the compiler flags to make it into -our binaries. Therefore disable the meson manipulations of these unless there -is a specific directive to do something differently in the project. - -RP 2018/11/23 - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/issues/2567] - -Index: meson-0.47.2/mesonbuild/minstall.py -=================================================================== ---- meson-0.47.2.orig/mesonbuild/minstall.py -+++ meson-0.47.2/mesonbuild/minstall.py -@@ -486,8 +486,11 @@ class Installer: - printed_symlink_error = True - if os.path.isfile(outname): - try: -- depfixer.fix_rpath(outname, install_rpath, final_path, -- install_name_mappings, verbose=False) -+ if install_rpath: -+ depfixer.fix_rpath(outname, install_rpath, final_path, -+ install_name_mappings, verbose=False) -+ else: -+ print("RPATH changes at install time disabled") - except SystemExit as e: - if isinstance(e.code, int) and e.code == 0: - pass diff --git a/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch b/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch deleted file mode 100644 index 2056763db5..0000000000 --- a/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch +++ /dev/null @@ -1,53 +0,0 @@ -From d57dd1092e84e08ee15d7063b6c56bd6d864f2e1 Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Mon, 18 Mar 2019 16:16:56 +0000 -Subject: [PATCH] load_configs: generalise the search path - -Instead of hard-coding the fact that load_configs() searches for files under -meson/native, pass in the subdirectory allowing the cross-file code to use the -same logic. - -Upstream-Status: Backport -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/coredata.py | 6 +++--- - mesonbuild/environment.py | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py -index fba90fa369..6e60917d10 100644 ---- a/mesonbuild/coredata.py -+++ b/mesonbuild/coredata.py -@@ -211,8 +211,8 @@ def is_auto(self): - return self.value == 'auto' - - --def load_configs(filenames): -- """Load native files.""" -+def load_configs(filenames, subdir): -+ """Load configuration files from a named subdirectory.""" - def gen(): - for f in filenames: - f = os.path.expanduser(os.path.expandvars(f)) -@@ -225,7 +225,7 @@ def gen(): - os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')), - ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') - for path in paths: -- path_to_try = os.path.join(path, 'meson', 'native', f) -+ path_to_try = os.path.join(path, 'meson', subdir, f) - if os.path.isfile(path_to_try): - yield path_to_try - break -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 58adb06960..92a00dd7bf 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -408,7 +408,7 @@ def __init__(self, source_dir, build_dir, options): - - if self.coredata.config_files is not None: - config = MesonConfigFile.from_config_parser( -- coredata.load_configs(self.coredata.config_files)) -+ coredata.load_configs(self.coredata.config_files, 'native')) - self.binaries.build = BinaryTable(config.get('binaries', {})) - self.paths.build = Directories(**config.get('paths', {})) - diff --git a/meta/recipes-devtools/meson/meson/meson-setup.py b/meta/recipes-devtools/meson/meson/meson-setup.py index 808e2a062f..daaa551de2 100755 --- a/meta/recipes-devtools/meson/meson/meson-setup.py +++ b/meta/recipes-devtools/meson/meson/meson-setup.py @@ -10,9 +10,13 @@ class Template(string.Template): class Environ(): def __getitem__(self, name): val = os.environ[name] - val = ["'%s'" % x for x in val.split()] - val = ', '.join(val) - val = '[%s]' % val + val = val.split() + if len(val) > 1: + val = ["'%s'" % x for x in val] + val = ', '.join(val) + val = '[%s]' % val + elif val: + val = "'%s'" % val.pop() return val try: @@ -23,9 +27,17 @@ except KeyError: template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template') cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"]) +native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template') +native_file = os.path.join(sysroot, 'usr/share/meson/meson.native') with open(template_file) as in_file: template = in_file.read() output = Template(template).substitute(Environ()) with open(cross_file, "w") as out_file: out_file.write(output) + +with open(native_template_file) as in_file: + template = in_file.read() + output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']}) + with open(native_file, "w") as out_file: + 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 @@ #!/bin/sh if [ -z "$OECORE_NATIVE_SYSROOT" ]; then - echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2 + exec "meson.real" "$@" +fi + +if [ -z "$SSL_CERT_DIR" ]; then + export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/" fi # If these are set to a cross-compile path, meson will get confused and try to @@ -9,6 +13,19 @@ fi # config is already in meson.cross. unset CC CXX CPP LD AR NM STRIP +case "$1" in +setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help) MESON_CMD="$1" ;; +*) echo meson-wrapper: Implicit setup command assumed; MESON_CMD=setup ;; +esac + +if [ "$MESON_CMD" = "setup" ]; then + MESON_SETUP_OPTS=" \ + --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \ + --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \ + " + echo meson-wrapper: Running meson with setup options: \"$MESON_SETUP_OPTS\" +fi + exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ - --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \ - "$@" + "$@" \ + $MESON_SETUP_OPTS |