diff options
Diffstat (limited to 'meta/recipes-devtools/meson')
17 files changed, 253 insertions, 519 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc deleted file mode 100644 index d5d71c67b6..0000000000 --- a/meta/recipes-devtools/meson/meson.inc +++ /dev/null @@ -1,32 +0,0 @@ -HOMEPAGE = "http://mesonbuild.com" -SUMMARY = "A high performance build system" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" - -SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ - file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \ - file://0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch \ - file://0001-Linker-rules-move-cross_args-in-front-of-output_args.patch \ - file://0003-native_bindir.patch \ - file://0001-python-module-do-not-manipulate-the-environment-when.patch \ - file://disable-rpath-handling.patch \ - file://cross-libdir.patch \ - file://0001-modules-windows-split-WINDRES-env-variable.patch \ - file://0002-environment.py-detect-windows-also-if-the-system-str.patch \ - " -SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd" -SRC_URI[md5sum] = "0267b0871266056184c484792572c682" - -SRC_URI_append_class-native = " \ - file://0001-Make-CPU-family-warnings-fatal.patch \ - file://0002-Support-building-allarch-recipes-again.patch \ -" - -UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases" - -inherit setuptools3 - -RDEPENDS_${PN} = "ninja python3-core python3-modules" - -FILES_${PN} += "${datadir}/polkit-1" diff --git a/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch b/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch deleted file mode 100644 index 97778c32eb..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 4676224dbdff0f7107e8cbdbe0eab19c855f1454 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 17 Nov 2017 13:18:28 +0200 -Subject: [PATCH] Linker rules: move {cross_args} in front of {output_args} - -The previous order was found to break linking in some cases -(e.g. when -no-pic -fno-PIC was present in {cross_args}. - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/backend/ninjabackend.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py -index bb281e1..969b70e 100644 ---- a/mesonbuild/backend/ninjabackend.py -+++ b/mesonbuild/backend/ninjabackend.py -@@ -1501,7 +1501,7 @@ int dummy; - rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing - ''' - else: -- command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n' -+ command_template = ' command = {executable} $ARGS {cross_args} {output_args} $in $LINK_ARGS $aliasing\n' - command = command_template.format( - executable=' '.join(compiler.get_linker_exelist()), - cross_args=' '.join(cross_args), --- -2.15.0 - 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 fbc3f5ad82..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 @@ -From 2db829d865bb6464ac15dbb4a58c9a675e296866 Mon Sep 17 00:00:00 2001 +From b77cbe67df5fa0998946503f207c256ee740bb5f 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 @@ -7,30 +7,39 @@ Upstream-Status: Inappropriate [OE specific] Signed-off-by: Ross Burton <ross.burton@intel.com> --- + mesonbuild/envconfig.py | 4 ++-- mesonbuild/environment.py | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) + 2 files changed, 4 insertions(+), 6 deletions(-) +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index 07f1229..a35c356 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -285,8 +285,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(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 2ccd31e..5fcf9df 100644 +index 2ba2054..d798e3b 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py -@@ -265,9 +265,7 @@ def detect_cpu_family(compilers): - # below. +@@ -359,10 +359,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 -@@ -1232,7 +1230,7 @@ class MachineInfo: - - 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) - - endian = literal['endian'] - if endian not in ('little', 'big'): 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 11fd9ed3ac..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.cross_info.config["properties"].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-modules-windows-split-WINDRES-env-variable.patch b/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch deleted file mode 100644 index c334e6dd66..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5293d0f5067b2aeefe9ce3c175c972de367589bc Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Wed, 13 Feb 2019 17:43:54 +0100 -Subject: [PATCH] modules/windows: split WINDRES env variable - -As it may contain not just the binary, but also the arguments to it. - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/modules/windows.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py -index d185d89..dbaeb9b 100644 ---- a/mesonbuild/modules/windows.py -+++ b/mesonbuild/modules/windows.py -@@ -56,7 +56,7 @@ class WindowsModule(ExtensionModule): - if 'WINDRES' in os.environ: - # Pick-up env var WINDRES if set. This is often used for - # specifying an arch-specific windres. -- rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True) -+ rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES').split(), silent=True) - - if not rescomp or not rescomp.found(): - # Take windres from the config file after the environment, which is 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..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 @@ -From 3cb2c811dc6d4890342afa5b709cd30cf7b8f3ca Mon Sep 17 00:00:00 2001 +From e85683698aa3556bf14fc6d35f2c067f16af520b 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 @@ -8,36 +8,30 @@ 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 9aea6bd..8c13ede 100644 +--- a/mesonbuild/dependencies/python.py ++++ b/mesonbuild/dependencies/python.py +@@ -380,9 +380,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: +@@ -391,8 +388,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 81548cdfb8..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 @@ -From f8419d5f279f1fb9b5e7eead4f1579bce7cb0e4e Mon Sep 17 00:00:00 2001 +From 6fb8db54929b40e1fd7ac949ef44f0d37df0bae9 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 @@ -9,18 +9,18 @@ Upstream-Status: Inappropriate [OE specific] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> --- - mesonbuild/environment.py | 1 + + mesonbuild/envconfig.py | 1 + 1 file changed, 1 insertion(+) -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 5fcf9df..b4fc0dc 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -72,6 +72,7 @@ from .compilers import ( - build_filename = 'meson.build' +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index a35c356..436355f 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -38,6 +38,7 @@ from pathlib import Path + known_cpu_families = ( + 'allarch', 'aarch64', + 'alpha', 'arc', - 'arm', diff --git a/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch b/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch deleted file mode 100644 index 1be5d66329..0000000000 --- a/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7bf4c2c02eb7fe1bf24b23e3ba2d7df36495e0aa Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Wed, 13 Feb 2019 17:45:09 +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/environment.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index b4fc0dc..845077e 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -1247,7 +1247,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/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 da477454cb..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() + "-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/cross-libdir.patch b/meta/recipes-devtools/meson/meson/cross-libdir.patch deleted file mode 100644 index 2bd4fb3f9e..0000000000 --- a/meta/recipes-devtools/meson/meson/cross-libdir.patch +++ /dev/null @@ -1,41 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From ce24f0d6a9be22ba61d80cd254e0409de2eaffd7 Mon Sep 17 00:00:00 2001 -From: Jussi Pakkanen <jpakkane@gmail.com> -Date: Thu, 27 Dec 2018 23:43:35 +0200 -Subject: [PATCH] Default libdir is "lib" when cross compiling. Closes #2535. - ---- - docs/markdown/snippets/crosslib.md | 7 +++++++ - mesonbuild/coredata.py | 8 ++++++++ - run_unittests.py | 13 +++++++++++++ - 3 files changed, 28 insertions(+) - create mode 100644 docs/markdown/snippets/crosslib.md - -diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py -index d70c23038c..4e2f3e008c 100644 ---- a/mesonbuild/coredata.py -+++ b/mesonbuild/coredata.py -@@ -299,6 +299,7 @@ def __init__(self, options): - # Only to print a warning if it changes between Meson invocations. - self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '') - self.config_files = self.__load_config_files(options.native_file) -+ self.libdir_cross_fixup() - - @staticmethod - def __load_config_files(filenames): -@@ -348,6 +349,13 @@ def __load_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: -+ self.builtins['libdir'].value = 'lib' -+ - def sanitize_prefix(self, prefix): - if not os.path.isabs(prefix): - raise MesonException('prefix value {!r} must be an absolute path' 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/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 diff --git a/meta/recipes-devtools/meson/meson_0.49.2.bb b/meta/recipes-devtools/meson/meson_0.49.2.bb deleted file mode 100644 index de9b905c12..0000000000 --- a/meta/recipes-devtools/meson/meson_0.49.2.bb +++ /dev/null @@ -1,4 +0,0 @@ -include meson.inc - -BBCLASSEXTEND = "native" - 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..5b0d82fe9f --- /dev/null +++ b/meta/recipes-devtools/meson/meson_1.3.1.bb @@ -0,0 +1,158 @@ +HOMEPAGE = "http://mesonbuild.com" +SUMMARY = "A high performance build system" +DESCRIPTION = "Meson is a build system designed to increase programmer \ +productivity. It does this by providing a fast, simple and easy to use \ +interface for modern software development tools and practices." + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" + +GITHUB_BASE_URI = "https://github.com/mesonbuild/meson/releases/" +SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \ + file://meson-setup.py \ + file://meson-wrapper \ + file://0001-python-module-do-not-manipulate-the-environment-when.patch \ + file://0001-Make-CPU-family-warnings-fatal.patch \ + file://0002-Support-building-allarch-recipes-again.patch \ + " +SRC_URI[sha256sum] = "6020568bdede1643d4fb41e28215be38eff5d52da28ac7d125457c59e0032ad7" +UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$" + +inherit python_setuptools_build_meta github-releases + +RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" + +FILES:${PN} += "${datadir}/polkit-1" + +do_install:append () { + # As per the same issue in the python recipe itself: + # Unfortunately the following pyc files are non-deterministc due to 'frozenset' + # being written without strict ordering, even with PYTHONHASHSEED = 0 + # Upstream is discussing ways to solve the issue properly, until then let's + # just not install the problematic files. + # More info: http://benno.id.au/blog/2013/01/15/python-determinism + rm -f ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* +} + +BBCLASSEXTEND = "native nativesdk" + +inherit meson-routines + +# The cross file logic is similar but not identical to that in meson.bbclass, +# since it's generating for an SDK rather than a cross-compile. Important +# differences are: +# - We can't set vars like CC, CXX, etc. yet because they will be filled in with +# real paths by meson-setup.sh when the SDK is extracted. +# - Some overrides aren't needed, since the SDK injects paths that take care of +# them. +def var_list2str(var, d): + items = d.getVar(var).split() + return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) + +def generate_native_link_template(d): + val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', + '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', + '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', + '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', + '-Wl,--allow-shlib-undefined' + ] + build_arch = d.getVar('BUILD_ARCH') + if 'x86_64' in build_arch: + loader = 'ld-linux-x86-64.so.2' + elif 'i686' in build_arch: + loader = 'ld-linux.so.2' + elif 'aarch64' in build_arch: + loader = 'ld-linux-aarch64.so.1' + elif 'ppc64le' in build_arch: + loader = 'ld64.so.2' + elif 'loongarch64' in build_arch: + loader = 'ld-linux-loongarch-lp64d.so.1' + elif 'riscv64' in build_arch: + loader = 'ld-linux-riscv64-lp64d.so.1' + + if loader: + val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] + + return repr(val) + +install_templates() { + install -d ${D}${datadir}/meson + + cat >${D}${datadir}/meson/meson.native.template <<EOF +[binaries] +c = ${@meson_array('BUILD_CC', d)} +cpp = ${@meson_array('BUILD_CXX', d)} +ar = ${@meson_array('BUILD_AR', d)} +nm = ${@meson_array('BUILD_NM', d)} +strip = ${@meson_array('BUILD_STRIP', d)} +readelf = ${@meson_array('BUILD_READELF', d)} +pkg-config = 'pkg-config-native' + +[built-in options] +c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] +c_link_args = ${@generate_native_link_template(d)} +cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] +cpp_link_args = ${@generate_native_link_template(d)} +[properties] +sys_root = '@OECORE_NATIVE_SYSROOT' +EOF + + cat >${D}${datadir}/meson/meson.cross.template <<EOF +[binaries] +c = @CC +cpp = @CXX +ar = @AR +nm = @NM +strip = @STRIP +pkg-config = 'pkg-config' + +[built-in options] +c_args = @CFLAGS +c_link_args = @LDFLAGS +cpp_args = @CPPFLAGS +cpp_link_args = @LDFLAGS + +[properties] +needs_exe_wrapper = true +sys_root = @OECORE_TARGET_SYSROOT + +[host_machine] +system = '$host_system' +cpu_family = '$host_cpu_family' +cpu = '$host_cpu' +endian = '$host_endian' +EOF +} + +do_install:append:class-nativesdk() { + host_system=${SDK_OS} + host_cpu_family=${@meson_cpu_family("SDK_ARCH", d)} + host_cpu=${SDK_ARCH} + host_endian=${@meson_endian("SDK", d)} + install_templates + + install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d + install -m 0755 ${UNPACKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ + + # We need to wrap the real meson with a thin env setup wrapper. + mv ${D}${bindir}/meson ${D}${bindir}/meson.real + install -m 0755 ${UNPACKDIR}/meson-wrapper ${D}${bindir}/meson +} + +FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" + +do_install:append:class-native() { + host_system=${HOST_OS} + host_cpu_family=${@meson_cpu_family("HOST_ARCH", d)} + host_cpu=${HOST_ARCH} + host_endian=${@meson_endian("HOST", d)} + install_templates + + install -d ${D}${datadir}/post-relocate-setup.d + install -m 0755 ${UNPACKDIR}/meson-setup.py ${D}${datadir}/post-relocate-setup.d/ + + # We need to wrap the real meson with a thin wrapper that substitues native/cross files + # when running in a direct SDK environment. + mv ${D}${bindir}/meson ${D}${bindir}/meson.real + install -m 0755 ${UNPACKDIR}/meson-wrapper ${D}${bindir}/meson +} diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb deleted file mode 100644 index 1549357a55..0000000000 --- a/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb +++ /dev/null @@ -1,71 +0,0 @@ -include meson.inc - -inherit nativesdk -inherit siteinfo - -SRC_URI += "file://meson-setup.py \ - file://meson-wrapper" - -def meson_endian(prefix, d): - arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS") - sitedata = siteinfo_data_for_machine(arch, os, d) - if "endian-little" in sitedata: - return "little" - elif "endian-big" in sitedata: - return "big" - else: - bb.fatal("Cannot determine endianism for %s-%s" % (arch, os)) - -MESON_TOOLCHAIN_ARGS = "${BUILDSDK_CC_ARCH}${TOOLCHAIN_OPTIONS}" -MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CFLAGS}" -MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CXXFLAGS}" -MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_LDFLAGS}" - -# The cross file logic is similar but not identical to that in meson.bbclass, -# since it's generating for an SDK rather than a cross-compile. Important -# differences are: -# - We can't set vars like CC, CXX, etc. yet because they will be filled in with -# real paths by meson-setup.sh when the SDK is extracted. -# - Some overrides aren't needed, since the SDK injects paths that take care of -# them. -do_install_append() { - install -d ${D}${datadir}/meson - cat >${D}${datadir}/meson/meson.cross.template <<EOF -[binaries] -c = @CC -cpp = @CXX -ar = @AR -nm = @NM -ld = @LD -strip = @STRIP -pkgconfig = 'pkg-config' - -[properties] -needs_exe_wrapper = true -c_args = @CFLAGS -c_link_args = @LDFLAGS -cpp_args = @CPPFLAGS -cpp_link_args = @LDFLAGS - -[host_machine] -system = '${SDK_OS}' -cpu_family = '${SDK_ARCH}' -cpu = '${SDK_ARCH}' -endian = '${@meson_endian("SDK", d)}' -EOF - - install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d - install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ - - # We need to wrap the real meson with a thin env setup wrapper. - mv ${D}${bindir}/meson ${D}${bindir}/meson.real - install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson -} - -RDEPENDS_${PN} += "\ - nativesdk-ninja \ - nativesdk-python3 \ - nativesdk-python3-setuptools \ - " - -FILES_${PN} += "${datadir}/meson ${SDKPATHNATIVE}" |