Commit 97e44238b8960d994837b9b576ed68791b680c36

Authored by Eric Lee
1 parent 9f152feb83
Exists in smarcimx8m-rocko

Upgrade menson version to 0.47.2 to fix the broken build

Showing 15 changed files with 672 additions and 0 deletions Side-by-side Diff

recipes-devtools/meson/meson.inc
  1 +HOMEPAGE = "http://mesonbuild.com"
  2 +SUMMARY = "A high performance build system"
  3 +
  4 +LICENSE = "Apache-2.0"
  5 +LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
  6 +
  7 +SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \
  8 + file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \
  9 + file://0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch \
  10 + file://0001-Linker-rules-move-cross_args-in-front-of-output_args.patch \
  11 + file://0003-native_bindir.patch \
  12 + file://gi-flags.patch \
  13 + file://gtkdoc-flags.patch \
  14 + file://0001-python-module-do-not-manipulate-the-environment-when.patch \
  15 + file://disable-rpath-handling.patch \
  16 + "
  17 +SRC_URI[sha256sum] = "92d8afd921751261e36151643464efd3394162f69efbe8cd53e0a66b1cf395eb"
  18 +SRC_URI[md5sum] = "31bda3519d8c0eb3438267268a78085e"
  19 +
  20 +SRC_URI_append_class-native = " \
  21 + file://0002-Make-CPU-family-warnings-fatal.patch \
  22 + file://0001-Support-building-allarch-recipes-again.patch \
  23 +"
  24 +
  25 +UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
  26 +
  27 +inherit setuptools3
  28 +
  29 +RDEPENDS_${PN} = "ninja python3-core python3-modules"
  30 +
  31 +FILES_${PN} += "${datadir}/polkit-1"
recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch
  1 +From 4676224dbdff0f7107e8cbdbe0eab19c855f1454 Mon Sep 17 00:00:00 2001
  2 +From: Alexander Kanavin <alex.kanavin@gmail.com>
  3 +Date: Fri, 17 Nov 2017 13:18:28 +0200
  4 +Subject: [PATCH] Linker rules: move {cross_args} in front of {output_args}
  5 +
  6 +The previous order was found to break linking in some cases
  7 +(e.g. when -no-pic -fno-PIC was present in {cross_args}.
  8 +
  9 +Upstream-Status: Pending
  10 +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  11 +---
  12 + mesonbuild/backend/ninjabackend.py | 2 +-
  13 + 1 file changed, 1 insertion(+), 1 deletion(-)
  14 +
  15 +diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
  16 +index bb281e1..969b70e 100644
  17 +--- a/mesonbuild/backend/ninjabackend.py
  18 ++++ b/mesonbuild/backend/ninjabackend.py
  19 +@@ -1501,7 +1501,7 @@ int dummy;
  20 + rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing
  21 + '''
  22 + else:
  23 +- command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n'
  24 ++ command_template = ' command = {executable} $ARGS {cross_args} {output_args} $in $LINK_ARGS $aliasing\n'
  25 + command = command_template.format(
  26 + executable=' '.join(compiler.get_linker_exelist()),
  27 + cross_args=' '.join(cross_args),
  28 +--
  29 +2.15.0
recipes-devtools/meson/meson/0001-Support-building-allarch-recipes-again.patch
  1 +From d80d02a3ca6e21fa3d055c88c05234c2eb4db128 Mon Sep 17 00:00:00 2001
  2 +From: Peter Kjellerstedt <pkj@axis.com>
  3 +Date: Thu, 26 Jul 2018 16:32:49 +0200
  4 +Subject: [PATCH] Support building allarch recipes again
  5 +
  6 +This registers "allarch" as a known CPU family.
  7 +
  8 +Upstream-Status: Inappropriate [OE specific]
  9 +Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
  10 +---
  11 + mesonbuild/environment.py | 1 +
  12 + 1 file changed, 1 insertion(+)
  13 +
  14 +Index: meson-0.47.2/mesonbuild/environment.py
  15 +===================================================================
  16 +--- meson-0.47.2.orig/mesonbuild/environment.py
  17 ++++ meson-0.47.2/mesonbuild/environment.py
  18 +@@ -75,6 +75,7 @@ from .compilers import (
  19 + build_filename = 'meson.build'
  20 +
  21 + known_cpu_families = (
  22 ++ 'allarch',
  23 + 'aarch64',
  24 + 'arm',
  25 + 'e2k',
recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
  1 +From 3ac4e58c5494bd7e603a325b5b5c2b8075849fee Mon Sep 17 00:00:00 2001
  2 +From: Alexander Kanavin <alex.kanavin@gmail.com>
  3 +Date: Fri, 4 Aug 2017 16:16:41 +0300
  4 +Subject: [PATCH] gtkdoc: fix issues that arise when cross-compiling
  5 +
  6 +Specifically:
  7 +1) Make it possible to specify a wrapper for executing binaries
  8 +(usually, some kind of target hardware emulator, such as qemu)
  9 +2) Explicitly provide CC and LD via command line, as otherwise gtk-doc will
  10 +try to guess them, incorrectly.
  11 +3) If things break down, print the full command with arguments,
  12 +not just the binary name.
  13 +4) Correctly determine the compiler/linker executables and cross-options when cross-compiling
  14 +
  15 +Upstream-Status: Pending
  16 +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  17 +
  18 +---
  19 + mesonbuild/modules/gnome.py | 18 +++++++++++++++---
  20 + mesonbuild/scripts/gtkdochelper.py | 9 +++++++--
  21 + 2 files changed, 22 insertions(+), 5 deletions(-)
  22 +
  23 +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
  24 +index cb69641..727eb6a 100644
  25 +--- a/mesonbuild/modules/gnome.py
  26 ++++ b/mesonbuild/modules/gnome.py
  27 +@@ -792,6 +792,10 @@ This will become a hard error in the future.''')
  28 + '--mode=' + mode]
  29 + if namespace:
  30 + args.append('--namespace=' + namespace)
  31 ++ gtkdoc_exe_wrapper = state.environment.cross_info.config["properties"].get('gtkdoc_exe_wrapper', None)
  32 ++ if gtkdoc_exe_wrapper is not None:
  33 ++ args.append('--gtkdoc-exe-wrapper=' + gtkdoc_exe_wrapper)
  34 ++
  35 + args += self._unpack_args('--htmlargs=', 'html_args', kwargs)
  36 + args += self._unpack_args('--scanargs=', 'scan_args', kwargs)
  37 + args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs)
  38 +diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
  39 +index 948dc5a..9c5bd19 100644
  40 +--- a/mesonbuild/scripts/gtkdochelper.py
  41 ++++ b/mesonbuild/scripts/gtkdochelper.py
  42 +@@ -45,6 +45,7 @@ parser.add_argument('--ignore-headers', dest='ignore_headers', default='')
  43 + parser.add_argument('--namespace', dest='namespace', default='')
  44 + parser.add_argument('--mode', dest='mode', default='')
  45 + parser.add_argument('--installdir', dest='install_dir')
  46 ++parser.add_argument('--gtkdoc-exe-wrapper', dest='gtkdoc_exe_wrapper')
  47 +
  48 + def gtkdoc_run_check(cmd, cwd, library_paths=None):
  49 + if library_paths is None:
  50 +@@ -64,7 +65,7 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None):
  51 + # This preserves the order of messages.
  52 + p, out = Popen_safe(cmd, cwd=cwd, env=env, stderr=subprocess.STDOUT)[0:2]
  53 + if p.returncode != 0:
  54 +- err_msg = ["{!r} failed with status {:d}".format(cmd[0], p.returncode)]
  55 ++ err_msg = ["{!r} failed with status {:d}".format(cmd, p.returncode)]
  56 + if out:
  57 + err_msg.append(out)
  58 + raise MesonException('\n'.join(err_msg))
  59 +@@ -74,7 +75,7 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None):
  60 + def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
  61 + main_file, module,
  62 + html_args, scan_args, fixxref_args, mkdb_args,
  63 +- gobject_typesfile, scanobjs_args, ld, cc, ldflags, cflags,
  64 ++ gobject_typesfile, scanobjs_args, gtkdoc_exe_wrapper, ld, cc, ldflags, cflags,
  65 + html_assets, content_files, ignore_headers, namespace,
  66 + expand_content_files, mode):
  67 + print("Building documentation for %s" % module)
  68 +@@ -135,6 +136,9 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
  69 + if gobject_typesfile:
  70 + scanobjs_cmd = ['gtkdoc-scangobj'] + scanobjs_args + ['--types=' + gobject_typesfile,
  71 + '--module=' + module,
  72 ++ '--run=' + gtkdoc_exe_wrapper,
  73 ++ '--cc=' + cc,
  74 ++ '--ld=' + ld,
  75 + '--cflags=' + cflags,
  76 + '--ldflags=' + ldflags,
  77 + '--cc=' + cc,
  78 +@@ -238,6 +242,7 @@ def run(args):
  79 + mkdbargs,
  80 + options.gobject_typesfile,
  81 + scanobjsargs,
  82 ++ options.gtkdoc_exe_wrapper,
  83 + options.ld,
  84 + options.cc,
  85 + options.ldflags,
recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch
  1 +From 45426f06689a520fc47f81ee29b49d509f11ba58 Mon Sep 17 00:00:00 2001
  2 +From: Alexander Kanavin <alex.kanavin@gmail.com>
  3 +Date: Mon, 19 Nov 2018 14:24:26 +0100
  4 +Subject: [PATCH] python module: do not manipulate the environment when calling
  5 + pkg-config
  6 +
  7 +Upstream-Status: Inappropriate [oe-core specific]
  8 +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  9 +---
  10 + mesonbuild/modules/python.py | 14 --------------
  11 + 1 file changed, 14 deletions(-)
  12 +
  13 +diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
  14 +index 1195d8a..df81da4 100644
  15 +--- a/mesonbuild/modules/python.py
  16 ++++ b/mesonbuild/modules/python.py
  17 +@@ -67,26 +67,12 @@ class PythonDependency(ExternalDependency):
  18 + if DependencyMethods.PKGCONFIG in self.methods and not python_holder.is_pypy:
  19 + pkg_version = self.variables.get('LDVERSION') or self.version
  20 + pkg_libdir = self.variables.get('LIBPC')
  21 +- old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR')
  22 +- old_pkg_path = os.environ.get('PKG_CONFIG_PATH')
  23 +-
  24 +- os.environ.pop('PKG_CONFIG_PATH', None)
  25 +-
  26 +- if pkg_libdir:
  27 +- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
  28 +
  29 + try:
  30 + self.pkgdep = PkgConfigDependency('python-{}'.format(pkg_version), environment, kwargs)
  31 + except Exception:
  32 + pass
  33 +
  34 +- if old_pkg_path is not None:
  35 +- os.environ['PKG_CONFIG_PATH'] = old_pkg_path
  36 +-
  37 +- if old_pkg_libdir is not None:
  38 +- os.environ['PKG_CONFIG_LIBDIR'] = old_pkg_libdir
  39 +- else:
  40 +- os.environ.pop('PKG_CONFIG_LIBDIR', None)
  41 +
  42 + if self.pkgdep and self.pkgdep.found():
  43 + self.compile_args = self.pkgdep.get_compile_args()
recipes-devtools/meson/meson/0002-Make-CPU-family-warnings-fatal.patch
  1 +From 2e8553fc01e62ebc4faa240bf20984a8a0ac7387 Mon Sep 17 00:00:00 2001
  2 +From: Ross Burton <ross.burton@intel.com>
  3 +Date: Tue, 3 Jul 2018 13:59:09 +0100
  4 +Subject: [PATCH] Make CPU family warnings fatal
  5 +
  6 +Upstream-Status: Inappropriate [OE specific]
  7 +Signed-off-by: Ross Burton <ross.burton@intel.com>
  8 +
  9 +---
  10 + mesonbuild/environment.py | 6 ++----
  11 + 1 file changed, 2 insertions(+), 4 deletions(-)
  12 +
  13 +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
  14 +index d29a77f..267acf9 100644
  15 +--- a/mesonbuild/environment.py
  16 ++++ b/mesonbuild/environment.py
  17 +@@ -239,9 +239,7 @@ def detect_cpu_family(compilers):
  18 + return 'x86_64'
  19 +
  20 + if trial not in known_cpu_families:
  21 +- mlog.warning('Unknown CPU family {!r}, please report this at '
  22 +- 'https://github.com/mesonbuild/meson/issues/new with the'
  23 +- 'output of `uname -a` and `cat /proc/cpuinfo`'.format(trial))
  24 ++ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial)
  25 +
  26 + return trial
  27 +
  28 +@@ -1014,7 +1012,7 @@ class CrossBuildInfo:
  29 + raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
  30 +
  31 + if entry == 'cpu_family' and res not in known_cpu_families:
  32 +- mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % value)
  33 ++ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % value)
  34 +
  35 + if self.ok_type(res):
  36 + self.config[s][entry] = res
recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch
  1 +From 0b860cb8a22ae876b6088939dbabca216bc29431 Mon Sep 17 00:00:00 2001
  2 +From: Alexander Kanavin <alex.kanavin@gmail.com>
  3 +Date: Fri, 4 Aug 2017 16:18:47 +0300
  4 +Subject: [PATCH] gobject-introspection: determine g-ir-scanner and
  5 + g-ir-compiler paths from pkgconfig
  6 +
  7 +Do not hardcode the name of those binaries; gobject-introspection
  8 +provides them via pkgconfig, and they can be set to something else
  9 +(for example when cross-compiling).
  10 +
  11 +Upstream-Status: Pending
  12 +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  13 +
  14 +---
  15 + mesonbuild/modules/gnome.py | 4 ++--
  16 + 1 file changed, 2 insertions(+), 2 deletions(-)
  17 +
  18 +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
  19 +index b29bab9..dc4c401 100644
  20 +--- a/mesonbuild/modules/gnome.py
  21 ++++ b/mesonbuild/modules/gnome.py
  22 +@@ -393,8 +393,6 @@ class GnomeModule(ExtensionModule):
  23 + raise MesonException('Gir takes one argument')
  24 + if kwargs.get('install_dir'):
  25 + raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"')
  26 +- giscanner = self.interpreter.find_program_impl('g-ir-scanner')
  27 +- gicompiler = self.interpreter.find_program_impl('g-ir-compiler')
  28 + girtarget = args[0]
  29 + while hasattr(girtarget, 'held_object'):
  30 + girtarget = girtarget.held_object
  31 +@@ -405,6 +403,8 @@ class GnomeModule(ExtensionModule):
  32 + self.gir_dep = PkgConfigDependency('gobject-introspection-1.0',
  33 + state.environment,
  34 + {'native': True})
  35 ++ giscanner = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {})
  36 ++ gicompiler = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {})
  37 + pkgargs = self.gir_dep.get_compile_args()
  38 + except Exception:
  39 + raise MesonException('gobject-introspection dependency was not found, gir cannot be generated.')
recipes-devtools/meson/meson/0003-native_bindir.patch
  1 +From e762d85c823adfefc27ba6128c7b997aa50166ce Mon Sep 17 00:00:00 2001
  2 +From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
  3 +Date: Wed, 15 Nov 2017 15:05:01 +0100
  4 +Subject: [PATCH] native_bindir
  5 +
  6 +Some libraries, like QT, have pre-processors that convert their input
  7 +files into something that the cross-compiler can process. We find the
  8 +path of those pre-processors via pkg-config-native instead of
  9 +pkg-config.
  10 +
  11 +This path forces the use of pkg-config-native for host_bins arguments.
  12 +
  13 +There are some discussions upstream to merge this patch, but I presonaly believe
  14 +that is is OE only. https://github.com/mesonbuild/meson/issues/1849#issuecomment-303730323
  15 +
  16 +Upstream-Status: Inappropriate [OE specific]
  17 +Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
  18 +
  19 +---
  20 + mesonbuild/dependencies/base.py | 19 +++++++++++--------
  21 + mesonbuild/dependencies/ui.py | 6 +++---
  22 + 2 files changed, 14 insertions(+), 11 deletions(-)
  23 +
  24 +diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
  25 +index 6d3678f..90fdb80 100644
  26 +--- a/mesonbuild/dependencies/base.py
  27 ++++ b/mesonbuild/dependencies/base.py
  28 +@@ -146,7 +146,7 @@ class Dependency:
  29 + def need_threads(self):
  30 + return False
  31 +
  32 +- def get_pkgconfig_variable(self, variable_name, kwargs):
  33 ++ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False):
  34 + raise DependencyException('{!r} is not a pkgconfig dependency'.format(self.name))
  35 +
  36 + def get_configtool_variable(self, variable_name):
  37 +@@ -183,7 +183,7 @@ class InternalDependency(Dependency):
  38 + self.sources = sources
  39 + self.ext_deps = ext_deps
  40 +
  41 +- def get_pkgconfig_variable(self, variable_name, kwargs):
  42 ++ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False):
  43 + raise DependencyException('Method "get_pkgconfig_variable()" is '
  44 + 'invalid for an internal dependency')
  45 +
  46 +@@ -523,15 +523,18 @@ class PkgConfigDependency(ExternalDependency):
  47 + return s.format(self.__class__.__name__, self.name, self.is_found,
  48 + self.version_reqs)
  49 +
  50 +- def _call_pkgbin_real(self, args, env):
  51 +- cmd = self.pkgbin.get_command() + args
  52 ++ def _call_pkgbin_real(self, args, env, use_native=False):
  53 ++ if use_native:
  54 ++ cmd = self.pkgbin.get_command() + "-native" + args
  55 ++ else:
  56 ++ cmd = self.pkgbin.get_command() + args
  57 + p, out = Popen_safe(cmd, env=env)[0:2]
  58 + rc, out = p.returncode, out.strip()
  59 + call = ' '.join(cmd)
  60 + mlog.debug("Called `{}` -> {}\n{}".format(call, rc, out))
  61 + return rc, out
  62 +
  63 +- def _call_pkgbin(self, args, env=None):
  64 ++ def _call_pkgbin(self, args, env=None, use_native=False):
  65 + if env is None:
  66 + fenv = env
  67 + env = os.environ
  68 +@@ -540,7 +543,7 @@ class PkgConfigDependency(ExternalDependency):
  69 + targs = tuple(args)
  70 + cache = PkgConfigDependency.pkgbin_cache
  71 + if (self.pkgbin, targs, fenv) not in cache:
  72 +- cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env)
  73 ++ cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env, use_native)
  74 + return cache[(self.pkgbin, targs, fenv)]
  75 +
  76 + def _convert_mingw_paths(self, args):
  77 +@@ -718,7 +721,7 @@ class PkgConfigDependency(ExternalDependency):
  78 + (self.name, out_raw))
  79 + self.link_args, self.raw_link_args = self._search_libs(out, out_raw)
  80 +
  81 +- def get_pkgconfig_variable(self, variable_name, kwargs):
  82 ++ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False):
  83 + options = ['--variable=' + variable_name, self.name]
  84 +
  85 + if 'define_variable' in kwargs:
  86 +@@ -731,7 +734,7 @@ class PkgConfigDependency(ExternalDependency):
  87 +
  88 + options = ['--define-variable=' + '='.join(definition)] + options
  89 +
  90 +- ret, out = self._call_pkgbin(options)
  91 ++ ret, out = self._call_pkgbin(options, use_native=use_native)
  92 + variable = ''
  93 + if ret != 0:
  94 + if self.required:
  95 +diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
  96 +index 197d22c..c683d21 100644
  97 +--- a/mesonbuild/dependencies/ui.py
  98 ++++ b/mesonbuild/dependencies/ui.py
  99 +@@ -285,7 +285,7 @@ class QtBaseDependency(ExternalDependency):
  100 + self.bindir = self.get_pkgconfig_host_bins(core)
  101 + if not self.bindir:
  102 + # If exec_prefix is not defined, the pkg-config file is broken
  103 +- prefix = core.get_pkgconfig_variable('exec_prefix', {})
  104 ++ prefix = core.get_pkgconfig_variable('exec_prefix', {}, use_native=True)
  105 + if prefix:
  106 + self.bindir = os.path.join(prefix, 'bin')
  107 +
  108 +@@ -427,7 +427,7 @@ class Qt4Dependency(QtBaseDependency):
  109 + applications = ['moc', 'uic', 'rcc', 'lupdate', 'lrelease']
  110 + for application in applications:
  111 + try:
  112 +- return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}))
  113 ++ return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}, use_native=True))
  114 + except MesonException:
  115 + pass
  116 +
  117 +@@ -437,7 +437,7 @@ class Qt5Dependency(QtBaseDependency):
  118 + QtBaseDependency.__init__(self, 'qt5', env, kwargs)
  119 +
  120 + def get_pkgconfig_host_bins(self, core):
  121 +- return core.get_pkgconfig_variable('host_bins', {})
  122 ++ return core.get_pkgconfig_variable('host_bins', {}, use_native=True)
  123 +
  124 + def get_private_includes(self, mod_inc_dir, module):
  125 + return _qt_get_private_includes(mod_inc_dir, module, self.version)
recipes-devtools/meson/meson/disable-rpath-handling.patch
  1 +We need to allow our rpaths generated through the compiler flags to make it into
  2 +our binaries. Therefore disable the meson manipulations of these unless there
  3 +is a specific directive to do something differently in the project.
  4 +
  5 +RP 2018/11/23
  6 +
  7 +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/issues/2567]
  8 +
  9 +Index: meson-0.47.2/mesonbuild/minstall.py
  10 +===================================================================
  11 +--- meson-0.47.2.orig/mesonbuild/minstall.py
  12 ++++ meson-0.47.2/mesonbuild/minstall.py
  13 +@@ -486,8 +486,11 @@ class Installer:
  14 + printed_symlink_error = True
  15 + if os.path.isfile(outname):
  16 + try:
  17 +- depfixer.fix_rpath(outname, install_rpath, final_path,
  18 +- install_name_mappings, verbose=False)
  19 ++ if install_rpath:
  20 ++ depfixer.fix_rpath(outname, install_rpath, final_path,
  21 ++ install_name_mappings, verbose=False)
  22 ++ else:
  23 ++ print("RPATH changes at install time disabled")
  24 + except SystemExit as e:
  25 + if isinstance(e.code, int) and e.code == 0:
  26 + pass
recipes-devtools/meson/meson/gi-flags.patch
  1 +Pass the correct cflags/ldflags to the gobject-introspection tools.
  2 +
  3 +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261]
  4 +Signed-off-by: Ross Burton <ross.burton@intel.com>
  5 +
  6 +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
  7 +index cb69641e..bb4449a0 100644
  8 +--- a/mesonbuild/modules/gnome.py
  9 ++++ b/mesonbuild/modules/gnome.py
  10 +@@ -579,7 +579,10 @@ class GnomeModule(ExtensionModule):
  11 + external_ldflags += list(dep_external_ldflags)
  12 + scan_command += ['--cflags-begin']
  13 + scan_command += cflags
  14 +- scan_command += state.environment.coredata.get_external_args(lang)
  15 ++ if state.environment.is_cross_build():
  16 ++ scan_command += state.environment.cross_info.config["properties"].get(lang + '_args', "")
  17 ++ else:
  18 ++ scan_command += state.environment.coredata.get_external_args(lang)
  19 + scan_command += ['--cflags-end']
  20 + # need to put our output directory first as we need to use the
  21 + # generated libraries instead of any possibly installed system/prefix
  22 +@@ -614,7 +614,12 @@ class GnomeModule(ExtensionModule):
  23 + scan_command.append('-L' + d)
  24 + scan_command += ['--library', libname]
  25 +
  26 +- for link_arg in state.environment.coredata.get_external_link_args(lang):
  27 ++ if state.environment.is_cross_build():
  28 ++ link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "")
  29 ++ else:
  30 ++ link_args = state.environment.coredata.get_external_link_args(lang)
  31 ++
  32 ++ for link_arg in link_args:
  33 + if link_arg.startswith('-L'):
  34 + scan_command.append(link_arg)
  35 + scan_command += list(external_ldflags)
recipes-devtools/meson/meson/gtkdoc-flags.patch
  1 +Ensure that in a cross compile only the target flags are passed to gtk-doc, and
  2 +not the native flags.
  3 +
  4 +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261]
  5 +Signed-off-by: Ross Burton <ross.burton@intel.com>
  6 +
  7 +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
  8 +index 4af33304..8751f53c 100644
  9 +--- a/mesonbuild/modules/gnome.py
  10 ++++ b/mesonbuild/modules/gnome.py
  11 +@@ -851,17 +851,30 @@ This will become a hard error in the future.''')
  12 + if not isinstance(incd.held_object, (str, build.IncludeDirs)):
  13 + raise MesonException(
  14 + 'Gir include dirs should be include_directories().')
  15 ++
  16 + cflags.update(get_include_args(inc_dirs))
  17 +- cflags.update(state.environment.coredata.get_external_args('c'))
  18 ++ if state.environment.is_cross_build():
  19 ++ cflags.update(state.environment.cross_info.config["properties"].get('c_args', ""))
  20 ++ else:
  21 ++ cflags.update(state.environment.coredata.get_external_args('c'))
  22 ++
  23 + ldflags = OrderedSet()
  24 + ldflags.update(internal_ldflags)
  25 +- ldflags.update(state.environment.coredata.get_external_link_args('c'))
  26 ++ if state.environment.is_cross_build():
  27 ++ ldflags.update(state.environment.cross_info.config["properties"].get('c_link_args', ""))
  28 ++ else:
  29 ++ ldflags.update(state.environment.coredata.get_external_link_args('c'))
  30 + ldflags.update(external_ldflags)
  31 ++
  32 + if cflags:
  33 + args += ['--cflags=%s' % ' '.join(cflags)]
  34 + if ldflags:
  35 + args += ['--ldflags=%s' % ' '.join(ldflags)]
  36 +- compiler = state.environment.coredata.compilers.get('c')
  37 ++
  38 ++ if state.environment.is_cross_build():
  39 ++ compiler = state.environment.coredata.cross_compilers.get('c')
  40 ++ else:
  41 ++ compiler = state.environment.coredata.compilers.get('c')
  42 + if compiler:
  43 + args += ['--cc=%s' % ' '.join(compiler.get_exelist())]
  44 + args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())]
recipes-devtools/meson/meson/meson-setup.py
  1 +#!/usr/bin/env python3
  2 +
  3 +import os
  4 +import sys
  5 +
  6 +def bail(msg):
  7 + print(msg, file=sys.stderr)
  8 + sys.exit(1)
  9 +
  10 +_MARKER = '@@'
  11 +def transform_line(line):
  12 + # Substitute any special markers of this form:
  13 + # @@ENV@@
  14 + # with the value of ENV, split into meson array syntax.
  15 + start = line.find(_MARKER)
  16 + if start == -1:
  17 + return line
  18 +
  19 + end = line.rfind(_MARKER)
  20 + if end == start:
  21 + return line
  22 +
  23 + # Lookup value of the env var.
  24 + var = line[start+len(_MARKER):end]
  25 + try:
  26 + val = os.environ[var]
  27 + except KeyError:
  28 + bail('cannot generate meson.cross; env var %s not set' % var)
  29 +
  30 + # Transform into meson array.
  31 + val = ["'%s'" % x for x in val.split()]
  32 + val = ', '.join(val)
  33 + val = '[%s]' % val
  34 +
  35 + before = line[:start]
  36 + after = line[end+len(_MARKER):]
  37 +
  38 + return '%s%s%s' % (before, val, after)
  39 +
  40 +# Make sure this is really an SDK extraction environment.
  41 +try:
  42 + sysroot = os.environ['OECORE_NATIVE_SYSROOT']
  43 +except KeyError:
  44 + bail('OECORE_NATIVE_SYSROOT env var must be set')
  45 +
  46 +cross_file = os.path.join(sysroot, 'usr/share/meson/meson.cross')
  47 +tmp_cross_file = '%s.tmp' % cross_file
  48 +
  49 +# Read through and transform the current meson.cross.
  50 +lines = []
  51 +with open(cross_file, 'r') as f:
  52 + for line in f:
  53 + lines.append(transform_line(line))
  54 +
  55 +# Write the transformed result to a tmp file and atomically rename it. In case
  56 +# we crash during the file write, we don't want an invalid meson.cross file.
  57 +with open(tmp_cross_file, 'w') as f:
  58 + for line in lines:
  59 + f.write(line)
  60 + f.flush()
  61 + os.fdatasync(f.fileno())
  62 +os.rename(tmp_cross_file, cross_file)
recipes-devtools/meson/meson/meson-wrapper
  1 +#!/bin/sh
  2 +
  3 +if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
  4 + echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2
  5 +fi
  6 +
  7 +# If these are set to a cross-compile path, meson will get confused and try to
  8 +# use them as native tools. Unset them to prevent this, as all the cross-compile
  9 +# config is already in meson.cross.
  10 +unset CC CXX CPP LD AR NM STRIP
  11 +
  12 +exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
  13 + --cross-file "$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.cross" \
  14 + "$@"
recipes-devtools/meson/meson_0.47.2.bb
  1 +include meson.inc
  2 +
  3 +BBCLASSEXTEND = "native"
recipes-devtools/meson/nativesdk-meson_0.47.2.bb
  1 +include meson.inc
  2 +
  3 +inherit nativesdk
  4 +
  5 +SRC_URI += "file://meson-setup.py \
  6 + file://meson-wrapper"
  7 +
  8 +def meson_array(var, d):
  9 + return "', '".join(d.getVar(var).split()).join(("'", "'"))
  10 +
  11 +# both are required but not used by meson
  12 +MESON_SDK_ENDIAN = "bogus-endian"
  13 +MESON_TARGET_ENDIAN = "bogus-endian"
  14 +
  15 +MESON_TOOLCHAIN_ARGS = "${BUILDSDK_CC_ARCH}${TOOLCHAIN_OPTIONS}"
  16 +MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CFLAGS}"
  17 +MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CXXFLAGS}"
  18 +MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_LDFLAGS}"
  19 +
  20 +# This logic is similar but not identical to that in meson.bbclass, since it's
  21 +# generating for an SDK rather than a cross-compile. Important differences are:
  22 +# - We can't set vars like CC, CXX, etc. yet because they will be filled in with
  23 +# real paths by meson-setup.sh when the SDK is extracted.
  24 +# - Some overrides aren't needed, since the SDK injects paths that take care of
  25 +# them.
  26 +addtask write_config before do_install
  27 +do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
  28 +do_write_config() {
  29 + # This needs to be Py to split the args into single-element lists
  30 + cat >${WORKDIR}/meson.cross <<EOF
  31 +[binaries]
  32 +c = @@CC@@
  33 +cpp = @@CXX@@
  34 +ar = @@AR@@
  35 +nm = @@NM@@
  36 +ld = @@LD@@
  37 +strip = @@STRIP@@
  38 +pkgconfig = 'pkg-config'
  39 +
  40 +[properties]
  41 +needs_exe_wrapper = true
  42 +c_args = @@CFLAGS@@
  43 +c_link_args = @@LDFLAGS@@
  44 +cpp_args = @@CPPFLAGS@@
  45 +cpp_link_args = @@LDFLAGS@@
  46 +
  47 +[host_machine]
  48 +system = '${SDK_OS}'
  49 +cpu_family = '${SDK_ARCH}'
  50 +cpu = '${SDK_ARCH}'
  51 +endian = '${MESON_SDK_ENDIAN}'
  52 +EOF
  53 +}
  54 +
  55 +do_install_append() {
  56 + install -d ${D}${datadir}/meson
  57 + install -m 0644 ${WORKDIR}/meson.cross ${D}${datadir}/meson/
  58 +
  59 + install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
  60 + install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
  61 +
  62 + # We need to wrap the real meson with a thin env setup wrapper.
  63 + mv ${D}${bindir}/meson ${D}${bindir}/meson.real
  64 + install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson
  65 +}
  66 +
  67 +RDEPENDS_${PN} += "\
  68 + nativesdk-ninja \
  69 + nativesdk-python3-core \
  70 + nativesdk-python3-misc \
  71 + nativesdk-python3-modules \
  72 + "
  73 +
  74 +FILES_${PN} += "${datadir}/meson ${SDKPATHNATIVE}"