diff options
Diffstat (limited to 'meta/recipes-devtools/meson')
11 files changed, 337 insertions, 315 deletions
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 new file mode 100644 index 0000000000..94129b2f25 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch @@ -0,0 +1,44 @@ +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 | 4 ++-- + mesonbuild/environment.py | 6 ++---- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index 0e9cd23..b44e60c 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -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(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 af69f64..248d6dd 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -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(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-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 1912e94358..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ /dev/null @@ -1,113 +0,0 @@ -From c5692cac9c555664281377a82bf8b1e46934f437 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 1/3] 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 | 18 +++++++++++++++--- - mesonbuild/scripts/gtkdochelper.py | 9 +++++++-- - 2 files changed, 22 insertions(+), 5 deletions(-) - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index 56765a5..4f7fe30 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -769,6 +769,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('--gtkdoc-exe-wrapper=' + 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) -@@ -796,14 +800,22 @@ This will become a hard error in the future.''') - raise MesonException( - 'Gir include dirs should be include_directories().') - cflags.update(get_include_args(inc_dirs)) -+ -+ cross_c_args = " ".join(state.environment.cross_info.config["properties"].get('c_args', "")) -+ cross_link_args = " ".join(state.environment.cross_info.config["properties"].get('c_link_args', "")) -+ - if cflags: -- args += ['--cflags=%s' % ' '.join(cflags)] -+ args += ['--cflags=%s %s' % (cross_c_args,' '.join(cflags))] - if ldflags: -- args += ['--ldflags=%s' % ' '.join(ldflags)] -+ args += ['--ldflags=%s %s' % (cross_link_args, ' '.join(ldflags))] - compiler = state.environment.coredata.compilers.get('c') -- if compiler: -+ cross_compiler = state.environment.coredata.cross_compilers.get('c') -+ if compiler and not state.environment.is_cross_build(): - args += ['--cc=%s' % ' '.join(compiler.get_exelist())] - args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())] -+ elif cross_compiler and state.environment.is_cross_build(): -+ args += ['--cc=%s' % ' '.join(cross_compiler.get_exelist())] -+ args += ['--ld=%s' % ' '.join(cross_compiler.get_linker_exelist())] - - return args - -diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py -index 4406b28..b846827 100644 ---- a/mesonbuild/scripts/gtkdochelper.py -+++ b/mesonbuild/scripts/gtkdochelper.py -@@ -44,13 +44,14 @@ parser.add_argument('--ignore-headers', dest='ignore_headers', default='') - parser.add_argument('--namespace', dest='namespace', default='') - parser.add_argument('--mode', dest='mode', default='') - parser.add_argument('--installdir', dest='install_dir') -+parser.add_argument('--gtkdoc-exe-wrapper', dest='gtkdoc_exe_wrapper') - - def gtkdoc_run_check(cmd, cwd): - # Put stderr into stdout since we want to print it out anyway. - # This preserves the order of messages. - p, out = Popen_safe(cmd, cwd=cwd, stderr=subprocess.STDOUT)[0:2] - if p.returncode != 0: -- err_msg = ["{!r} failed with status {:d}".format(cmd[0], p.returncode)] -+ err_msg = ["{!r} failed with status {:d}".format(cmd, p.returncode)] - if out: - err_msg.append(out) - raise MesonException('\n'.join(err_msg)) -@@ -58,7 +59,7 @@ def gtkdoc_run_check(cmd, cwd): - def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, - main_file, module, - html_args, scan_args, fixxref_args, mkdb_args, -- gobject_typesfile, scanobjs_args, ld, cc, ldflags, cflags, -+ gobject_typesfile, scanobjs_args, gtkdoc_exe_wrapper, ld, cc, ldflags, cflags, - html_assets, content_files, ignore_headers, namespace, - expand_content_files, mode): - print("Building documentation for %s" % module) -@@ -111,6 +112,9 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, - if gobject_typesfile: - scanobjs_cmd = ['gtkdoc-scangobj'] + scanobjs_args + ['--types=' + gobject_typesfile, - '--module=' + module, -+ '--run=' + gtkdoc_exe_wrapper, -+ '--cc=' + cc, -+ '--ld=' + ld, - '--cflags=' + cflags, - '--ldflags=' + ldflags, - '--ld=' + ld] -@@ -207,6 +211,7 @@ def run(args): - mkdbargs, - options.gobject_typesfile, - scanobjsargs, -+ options.gtkdoc_exe_wrapper, - options.ld, - options.cc, - options.ldflags, --- -2.15.0 - 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 new file mode 100644 index 0000000000..9f3f516a5c --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch @@ -0,0 +1,36 @@ +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 + pkg-config + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + mesonbuild/dependencies/python.py | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +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 + +- 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: + 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 new file mode 100644 index 0000000000..fa5ea57d5b --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch @@ -0,0 +1,25 @@ +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 + +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 b44e60c..c70e8cb 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -28,6 +28,7 @@ from pathlib import Path + + + known_cpu_families = ( ++ 'allarch', + 'aarch64', + 'alpha', + 'arc', 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 ded42d14f7..0000000000 --- a/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 972667e0d789a6969a5d79249404f3539f891810 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 1/2] 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 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index 4f7fe30..9610cf6 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -390,8 +390,6 @@ class GnomeModule(ExtensionModule): - raise MesonException('Gir takes one argument') - if kwargs.get('install_dir'): - raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"') -- giscanner = find_program('g-ir-scanner', 'Gir') -- gicompiler = find_program('g-ir-compiler', 'Gir') - girtarget = args[0] - while hasattr(girtarget, 'held_object'): - girtarget = girtarget.held_object -@@ -402,6 +400,8 @@ class GnomeModule(ExtensionModule): - self.gir_dep = PkgConfigDependency('gobject-introspection-1.0', - state.environment, - {'native': True}) -+ 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', {}) - pkgargs = self.gir_dep.get_compile_args() - except Exception: - raise MesonException('gobject-introspection dependency was not found, gir cannot be generated.') --- -2.15.0 - 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 8911dd6b34..0000000000 --- a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch +++ /dev/null @@ -1,109 +0,0 @@ -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 | 14 +++++++++----- - mesonbuild/dependencies/ui.py | 6 +++--- - 2 files changed, 12 insertions(+), 8 deletions(-) - -diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py -index 0ef33722f196..b3f7e7c06822 100644 ---- a/mesonbuild/dependencies/base.py -+++ b/mesonbuild/dependencies/base.py -@@ -130,7 +130,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): -@@ -149,7 +149,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') - -@@ -414,10 +414,14 @@ class PkgConfigDependency(ExternalDependency): - return s.format(self.__class__.__name__, self.name, self.is_found, - self.version_reqs) - -- def _call_pkgbin(self, args, env=None): -+ def _call_pkgbin(self, args, env=None, use_native=False): - if not env: - env = os.environ -- p, out = Popen_safe([self.pkgbin] + args, env=env)[0:2] -+ if use_native: -+ pkgbin = [self.pkgbin + "-native"] -+ else: -+ pkgbin = [self.pkgbin] -+ p, out = Popen_safe(pkgbin + args, env=env)[0:2] - return p.returncode, out.strip() - - def _convert_mingw_paths(self, args): -@@ -499,7 +503,7 @@ class PkgConfigDependency(ExternalDependency): - self.is_libtool = True - self.link_args.append(lib) - -- 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: -@@ -512,7 +516,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 1db518c12477..4ed1d041f6f4 100644 ---- a/mesonbuild/dependencies/ui.py -+++ b/mesonbuild/dependencies/ui.py -@@ -239,7 +239,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') - -@@ -359,7 +359,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 - -@@ -369,7 +369,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) - - - # There are three different ways of depending on SDL2: diff --git a/meta/recipes-devtools/meson/meson/meson-setup.py b/meta/recipes-devtools/meson/meson/meson-setup.py new file mode 100755 index 0000000000..daaa551de2 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/meson-setup.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +import os +import string +import sys + +class Template(string.Template): + delimiter = "@" + +class Environ(): + def __getitem__(self, name): + val = os.environ[name] + 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: + sysroot = os.environ['OECORE_NATIVE_SYSROOT'] +except KeyError: + print("Not in environment setup, bailing") + sys.exit(1) + +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 new file mode 100755 index 0000000000..7455985297 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/meson-wrapper @@ -0,0 +1,31 @@ +#!/bin/sh + +if [ -z "$OECORE_NATIVE_SYSROOT" ]; then + 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 +# use them as native tools. Unset them to prevent this, as all the cross-compile +# 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" \ + "$@" \ + $MESON_SETUP_OPTS diff --git a/meta/recipes-devtools/meson/meson_0.44.0.bb b/meta/recipes-devtools/meson/meson_0.44.0.bb deleted file mode 100644 index d9c691c7f8..0000000000 --- a/meta/recipes-devtools/meson/meson_0.44.0.bb +++ /dev/null @@ -1,21 +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}/${BP}.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 \ - " -SRC_URI[md5sum] = "26a7ca93ec9cea5facb365664261f9c6" -SRC_URI[sha256sum] = "50f9b12b77272ef6ab064d26b7e06667f07fa9f931e6a20942bba2216ba4281b" -UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases" - -inherit setuptools3 - -RDEPENDS_${PN} = "ninja python3-core python3-modules" - -BBCLASSEXTEND = "native" diff --git a/meta/recipes-devtools/meson/meson_1.4.0.bb b/meta/recipes-devtools/meson/meson_1.4.0.bb new file mode 100644 index 0000000000..5db100ff1c --- /dev/null +++ b/meta/recipes-devtools/meson/meson_1.4.0.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] = "8fd6630c25c27f1489a8a0392b311a60481a3c161aa699b330e25935b750138d" +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 +} |