diff options
Diffstat (limited to 'external/poky/meta/recipes-devtools/meson/meson')
16 files changed, 256 insertions, 345 deletions
diff --git a/external/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch deleted file mode 100644 index 97778c32..00000000 --- a/external/poky/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/external/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch new file mode 100644 index 00000000..9ce31e54 --- /dev/null +++ b/external/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch @@ -0,0 +1,41 @@ +From ee638fd4a299bfc53a2238e9f71ae310c8d97460 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 3 Jul 2018 13:59:09 +0100 +Subject: [PATCH] Make CPU family warnings fatal + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Ross Burton <ross.burton@intel.com> + +--- + mesonbuild/envconfig.py | 2 +- + mesonbuild/environment.py | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index 0f277a7..24578ea 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -192,7 +192,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/mesonbuild/environment.py b/mesonbuild/environment.py +index dc8b14f..3aab71e 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -354,9 +354,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str: + trial = 'parisc' + + 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)) ++ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) + + return trial + diff --git a/external/poky/meta/recipes-devtools/meson/meson/0001-Support-building-allarch-recipes-again.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-Support-building-allarch-recipes-again.patch deleted file mode 100644 index 96be104a..00000000 --- a/external/poky/meta/recipes-devtools/meson/meson/0001-Support-building-allarch-recipes-again.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d80d02a3ca6e21fa3d055c88c05234c2eb4db128 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/environment.py | 1 + - 1 file changed, 1 insertion(+) - -Index: meson-0.47.2/mesonbuild/environment.py -=================================================================== ---- meson-0.47.2.orig/mesonbuild/environment.py -+++ meson-0.47.2/mesonbuild/environment.py -@@ -75,6 +75,7 @@ from .compilers import ( - build_filename = 'meson.build' - - known_cpu_families = ( -+ 'allarch', - 'aarch64', - 'arm', - 'e2k', diff --git a/external/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch index 7ffd6c54..471f1500 100644 --- a/external/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ b/external/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch @@ -1,4 +1,4 @@ -From 3ac4e58c5494bd7e603a325b5b5c2b8075849fee Mon Sep 17 00:00:00 2001 +From d3ef01a4208a801acad380a4aaceb6a21f8fa603 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 @@ -16,70 +16,21 @@ 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(-) + mesonbuild/modules/gnome.py | 4 ++++ + 1 file changed, 4 insertions(+) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index cb69641..727eb6a 100644 +index bcf77b9..6a4b472 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py -@@ -792,6 +792,10 @@ This will become a hard error in the future.''') - '--mode=' + mode] +@@ -974,6 +974,10 @@ This will become a hard error in the future.''') + args.append('--{}={}'.format(program_name, path)) if namespace: args.append('--namespace=' + namespace) -+ gtkdoc_exe_wrapper = state.environment.cross_info.config["properties"].get('gtkdoc_exe_wrapper', None) ++ gtkdoc_exe_wrapper = state.environment.properties.host.get('gtkdoc_exe_wrapper', None) + if gtkdoc_exe_wrapper is not None: -+ args.append('--gtkdoc-exe-wrapper=' + gtkdoc_exe_wrapper) ++ 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/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py -index 948dc5a..9c5bd19 100644 ---- a/mesonbuild/scripts/gtkdochelper.py -+++ b/mesonbuild/scripts/gtkdochelper.py -@@ -45,6 +45,7 @@ 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, library_paths=None): - if library_paths is None: -@@ -64,7 +65,7 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None): - # This preserves the order of messages. - p, out = Popen_safe(cmd, cwd=cwd, env=env, 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)) -@@ -74,7 +75,7 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None): - 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) -@@ -135,6 +136,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, - '--cc=' + cc, -@@ -238,6 +242,7 @@ def run(args): - mkdbargs, - options.gobject_typesfile, - scanobjsargs, -+ options.gtkdoc_exe_wrapper, - options.ld, - options.cc, - options.ldflags, diff --git a/external/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch new file mode 100644 index 00000000..f4456235 --- /dev/null +++ b/external/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch @@ -0,0 +1,26 @@ +From a72dc2b1cddcf180ce782860896deae0b12d5000 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Mon, 25 Mar 2019 18:52:48 +0100 +Subject: [PATCH] mesonbuild/environment.py: check environment for various + binaries + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + mesonbuild/environment.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py +index 9a029f4..0cfdf9c 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -448,7 +448,7 @@ class Environment: + config = MesonConfigFile.from_config_parser( + coredata.load_configs(self.coredata.cross_files)) + properties.host = Properties(config.get('properties', {}), False) +- binaries.host = BinaryTable(config.get('binaries', {}), False) ++ binaries.host = BinaryTable(config.get('binaries', {}), True) + if 'host_machine' in config: + machines.host = MachineInfo.from_literal(config['host_machine']) + if 'target_machine' in config: diff --git a/external/poky/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch new file mode 100644 index 00000000..a25c3922 --- /dev/null +++ b/external/poky/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch @@ -0,0 +1,44 @@ +From 1d178fb2928d325e339b15972890ceced863d3ec Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 18 Apr 2019 17:36:11 +0200 +Subject: [PATCH] modules/python.py: do not substitute python's install prefix + with meson's + +Not sure why this is being done, but it +a) relies on Python's internal variable substitution which may break in the future +b) shouldn't be necessary as Python's prefix ought to be correct in the first place + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + mesonbuild/modules/python.py | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py +index 6e2c63b..f5a37ac 100644 +--- a/mesonbuild/modules/python.py ++++ b/mesonbuild/modules/python.py +@@ -254,7 +254,7 @@ import sysconfig + import json + import sys + +-install_paths = sysconfig.get_paths(scheme='posix_prefix', vars={'base': '', 'platbase': '', 'installed_base': ''}) ++install_paths = sysconfig.get_paths(scheme='posix_prefix') + + def links_against_libpython(): + from distutils.core import Distribution, Extension +@@ -279,12 +279,11 @@ class PythonInstallation(ExternalProgramHolder): + ExternalProgramHolder.__init__(self, python) + self.interpreter = interpreter + self.subproject = self.interpreter.subproject +- prefix = self.interpreter.environment.coredata.get_builtin_option('prefix') + self.variables = info['variables'] + self.paths = info['paths'] + install_paths = info['install_paths'] +- self.platlib_install_path = os.path.join(prefix, install_paths['platlib'][1:]) +- self.purelib_install_path = os.path.join(prefix, install_paths['purelib'][1:]) ++ self.platlib_install_path = install_paths['platlib'] ++ self.purelib_install_path = install_paths['purelib'] + self.version = info['version'] + self.platform = info['platform'] + self.is_pypy = info['is_pypy'] diff --git a/external/poky/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch b/external/poky/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch index 60729854..eb0e90db 100644 --- a/external/poky/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch +++ b/external/poky/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch @@ -1,4 +1,4 @@ -From 45426f06689a520fc47f81ee29b49d509f11ba58 Mon Sep 17 00:00:00 2001 +From 689e28c49b85311f93f39df70cbee702fc44afb6 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Mon, 19 Nov 2018 14:24:26 +0100 Subject: [PATCH] python module: do not manipulate the environment when calling @@ -6,38 +6,38 @@ Subject: [PATCH] python module: do not manipulate the environment when calling Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + --- - mesonbuild/modules/python.py | 14 -------------- - 1 file changed, 14 deletions(-) + mesonbuild/modules/python.py | 12 ------------ + 1 file changed, 12 deletions(-) diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index 1195d8a..df81da4 100644 +index 07be318..b770603 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py -@@ -67,26 +67,12 @@ class PythonDependency(ExternalDependency): - if DependencyMethods.PKGCONFIG in self.methods and not python_holder.is_pypy: - pkg_version = self.variables.get('LDVERSION') or self.version - pkg_libdir = self.variables.get('LIBPC') -- old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR') -- old_pkg_path = os.environ.get('PKG_CONFIG_PATH') +@@ -71,11 +71,6 @@ class PythonDependency(ExternalDependency): + old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR') + old_pkg_path = os.environ.get('PKG_CONFIG_PATH') + +- os.environ.pop('PKG_CONFIG_PATH', None) - -- os.environ.pop('PKG_CONFIG_PATH', None) +- if pkg_libdir: +- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir - -- if pkg_libdir: -- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir - - try: - self.pkgdep = PkgConfigDependency('python-{}'.format(pkg_version), environment, kwargs) - except Exception: - pass + try: + self.pkgdep = PkgConfigDependency(pkg_name, environment, kwargs) + mlog.debug('Found "{}" via pkgconfig lookup in LIBPC ({})'.format(pkg_name, pkg_libdir)) +@@ -84,13 +79,6 @@ class PythonDependency(ExternalDependency): + mlog.debug('"{}" could not be found in LIBPC ({})'.format(pkg_name, pkg_libdir)) + mlog.debug(e) -- if old_pkg_path is not None: -- os.environ['PKG_CONFIG_PATH'] = old_pkg_path +- 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) +- 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('"{}" could not be found in LIBPC ({}), this is likely due to a relocated python installation'.format(pkg_name, pkg_libdir)) - if self.pkgdep and self.pkgdep.found(): - self.compile_args = self.pkgdep.get_compile_args() diff --git a/external/poky/meta/recipes-devtools/meson/meson/0002-Make-CPU-family-warnings-fatal.patch b/external/poky/meta/recipes-devtools/meson/meson/0002-Make-CPU-family-warnings-fatal.patch deleted file mode 100644 index ca56a6a8..00000000 --- a/external/poky/meta/recipes-devtools/meson/meson/0002-Make-CPU-family-warnings-fatal.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2e8553fc01e62ebc4faa240bf20984a8a0ac7387 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/environment.py | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index d29a77f..267acf9 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -239,9 +239,7 @@ def detect_cpu_family(compilers): - return 'x86_64' - - 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)) -+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) - - return trial - -@@ -1014,7 +1012,7 @@ class CrossBuildInfo: - raise EnvironmentException('Malformed value in cross file variable %s.' % entry) - - if entry == 'cpu_family' and res not in known_cpu_families: -- mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % value) -+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % value) - - if self.ok_type(res): - self.config[s][entry] = res diff --git a/external/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/external/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch new file mode 100644 index 00000000..ce186607 --- /dev/null +++ b/external/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch @@ -0,0 +1,26 @@ +From 9c221c74bd306dfa6fec22c8f156eb9d4e4f7fcb 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 24578ea..216e71f 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -36,6 +36,7 @@ _T = typing.TypeVar('_T') + + + known_cpu_families = ( ++ 'allarch', + 'aarch64', + 'alpha', + 'arc', diff --git a/external/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch b/external/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch index f32267d0..61b26bb8 100644 --- a/external/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch +++ b/external/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch @@ -1,4 +1,4 @@ -From 0b860cb8a22ae876b6088939dbabca216bc29431 Mon Sep 17 00:00:00 2001 +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 @@ -12,28 +12,29 @@ Upstream-Status: Pending Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- - mesonbuild/modules/gnome.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + 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 b29bab9..dc4c401 100644 +index 7c5a363..0002498 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py -@@ -393,8 +393,6 @@ class GnomeModule(ExtensionModule): - raise MesonException('Gir takes one argument') +@@ -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') - girtarget = args[0] - while hasattr(girtarget, 'held_object'): - girtarget = girtarget.held_object -@@ -405,6 +403,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.') +- + 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/external/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch b/external/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch index da477454..dc822fb1 100644 --- a/external/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch +++ b/external/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch @@ -1,4 +1,4 @@ -From e762d85c823adfefc27ba6128c7b997aa50166ce Mon Sep 17 00:00:00 2001 +From e76726321067748362b39937bd1e663a1a948ad5 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 @@ -22,19 +22,19 @@ Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py -index 6d3678f..90fdb80 100644 +index 40e304c..4b687df 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py -@@ -146,7 +146,7 @@ class Dependency: - def need_threads(self): - return False +@@ -184,7 +184,7 @@ class Dependency: + def get_exe_args(self, compiler): + return [] - 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): +@@ -247,7 +247,7 @@ class InternalDependency(Dependency): self.sources = sources self.ext_deps = ext_deps @@ -43,7 +43,7 @@ index 6d3678f..90fdb80 100644 raise DependencyException('Method "get_pkgconfig_variable()" is ' 'invalid for an internal dependency') -@@ -523,15 +523,18 @@ class PkgConfigDependency(ExternalDependency): +@@ -673,15 +673,18 @@ class PkgConfigDependency(ExternalDependency): return s.format(self.__class__.__name__, self.name, self.is_found, self.version_reqs) @@ -51,21 +51,21 @@ index 6d3678f..90fdb80 100644 - 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 ++ cmd = [self.pkgbin.get_command()[0] + "-native"] + args + else: + cmd = self.pkgbin.get_command() + args - p, out = Popen_safe(cmd, env=env)[0:2] - rc, out = p.returncode, out.strip() + p, out, err = Popen_safe(cmd, env=env) + rc, out, err = p.returncode, out.strip(), err.strip() call = ' '.join(cmd) mlog.debug("Called `{}` -> {}\n{}".format(call, rc, out)) - return rc, out + return rc, out, err - def _call_pkgbin(self, args, env=None): + def _call_pkgbin(self, args, env=None, use_native=False): + # Always copy the environment since we're going to modify it + # with pkg-config variables if env is None: - fenv = env - env = os.environ -@@ -540,7 +543,7 @@ class PkgConfigDependency(ExternalDependency): +@@ -701,7 +704,7 @@ class PkgConfigDependency(ExternalDependency): targs = tuple(args) cache = PkgConfigDependency.pkgbin_cache if (self.pkgbin, targs, fenv) not in cache: @@ -73,8 +73,8 @@ index 6d3678f..90fdb80 100644 + 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): + def _convert_mingw_paths(self, args: T.List[str]) -> T.List[str]: +@@ -907,7 +910,7 @@ class PkgConfigDependency(ExternalDependency): (self.name, out_raw)) self.link_args, self.raw_link_args = self._search_libs(out, out_raw) @@ -83,20 +83,20 @@ index 6d3678f..90fdb80 100644 options = ['--variable=' + variable_name, self.name] if 'define_variable' in kwargs: -@@ -731,7 +734,7 @@ class PkgConfigDependency(ExternalDependency): +@@ -920,7 +923,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) +- ret, out, err = self._call_pkgbin(options) ++ ret, out, err = 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 +index da411ef..856506a 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py -@@ -285,7 +285,7 @@ class QtBaseDependency(ExternalDependency): +@@ -330,7 +330,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 @@ -105,7 +105,7 @@ index 197d22c..c683d21 100644 if prefix: self.bindir = os.path.join(prefix, 'bin') -@@ -427,7 +427,7 @@ class Qt4Dependency(QtBaseDependency): +@@ -508,7 +508,7 @@ class Qt4Dependency(QtBaseDependency): applications = ['moc', 'uic', 'rcc', 'lupdate', 'lrelease'] for application in applications: try: @@ -114,7 +114,7 @@ index 197d22c..c683d21 100644 except MesonException: pass -@@ -437,7 +437,7 @@ class Qt5Dependency(QtBaseDependency): +@@ -518,7 +518,7 @@ class Qt5Dependency(QtBaseDependency): QtBaseDependency.__init__(self, 'qt5', env, kwargs) def get_pkgconfig_host_bins(self, core): diff --git a/external/poky/meta/recipes-devtools/meson/meson/cross-prop-default.patch b/external/poky/meta/recipes-devtools/meson/meson/cross-prop-default.patch new file mode 100644 index 00000000..772395e8 --- /dev/null +++ b/external/poky/meta/recipes-devtools/meson/meson/cross-prop-default.patch @@ -0,0 +1,23 @@ +meson.build files that use cc.run() in native builds can silently fallback to +meson.get_cross_property() in cross builds without an exe-wrapper, but there's +no way to know that this is happening. + +As the defaults may be pessimistic (for example, disabling the support for a +feature that should be enabled) emit a warning when the default is used, so that +the recipe can explicitly set the cross property as relevant. + +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/5071] +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py +index 3c3cfae0..10e741ae 100644 +--- a/mesonbuild/interpreter.py ++++ b/mesonbuild/interpreter.py +@@ -1890,6 +1890,7 @@ class MesonMain(InterpreterObject): + return props[propname] + except Exception: + if len(args) == 2: ++ mlog.warning('Cross property %s is using default value %s' % (propname, args[1])) + return args[1] + raise InterpreterException('Unknown cross property: %s.' % propname) + diff --git a/external/poky/meta/recipes-devtools/meson/meson/gi-flags.patch b/external/poky/meta/recipes-devtools/meson/meson/gi-flags.patch deleted file mode 100644 index 9a4c2961..00000000 --- a/external/poky/meta/recipes-devtools/meson/meson/gi-flags.patch +++ /dev/null @@ -1,35 +0,0 @@ -Pass the correct cflags/ldflags to the gobject-introspection tools. - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261] -Signed-off-by: Ross Burton <ross.burton@intel.com> - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index cb69641e..bb4449a0 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -579,7 +579,10 @@ class GnomeModule(ExtensionModule): - external_ldflags += list(dep_external_ldflags) - scan_command += ['--cflags-begin'] - scan_command += cflags -- scan_command += state.environment.coredata.get_external_args(lang) -+ if state.environment.is_cross_build(): -+ scan_command += state.environment.cross_info.config["properties"].get(lang + '_args', "") -+ else: -+ scan_command += state.environment.coredata.get_external_args(lang) - scan_command += ['--cflags-end'] - # need to put our output directory first as we need to use the - # generated libraries instead of any possibly installed system/prefix -@@ -614,7 +614,12 @@ class GnomeModule(ExtensionModule): - scan_command.append('-L' + d) - scan_command += ['--library', libname] - -- for link_arg in state.environment.coredata.get_external_link_args(lang): -+ if state.environment.is_cross_build(): -+ link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "") -+ else: -+ link_args = state.environment.coredata.get_external_link_args(lang) -+ -+ for link_arg in link_args: - if link_arg.startswith('-L'): - scan_command.append(link_arg) - scan_command += list(external_ldflags) diff --git a/external/poky/meta/recipes-devtools/meson/meson/gtkdoc-flags.patch b/external/poky/meta/recipes-devtools/meson/meson/gtkdoc-flags.patch deleted file mode 100644 index ecf3489b..00000000 --- a/external/poky/meta/recipes-devtools/meson/meson/gtkdoc-flags.patch +++ /dev/null @@ -1,44 +0,0 @@ -Ensure that in a cross compile only the target flags are passed to gtk-doc, and -not the native flags. - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261] -Signed-off-by: Ross Burton <ross.burton@intel.com> - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index 4af33304..8751f53c 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -851,17 +851,30 @@ This will become a hard error in the future.''') - if not isinstance(incd.held_object, (str, build.IncludeDirs)): - raise MesonException( - 'Gir include dirs should be include_directories().') -+ - cflags.update(get_include_args(inc_dirs)) -- cflags.update(state.environment.coredata.get_external_args('c')) -+ if state.environment.is_cross_build(): -+ cflags.update(state.environment.cross_info.config["properties"].get('c_args', "")) -+ else: -+ cflags.update(state.environment.coredata.get_external_args('c')) -+ - ldflags = OrderedSet() - ldflags.update(internal_ldflags) -- ldflags.update(state.environment.coredata.get_external_link_args('c')) -+ if state.environment.is_cross_build(): -+ ldflags.update(state.environment.cross_info.config["properties"].get('c_link_args', "")) -+ else: -+ ldflags.update(state.environment.coredata.get_external_link_args('c')) - ldflags.update(external_ldflags) -+ - if cflags: - args += ['--cflags=%s' % ' '.join(cflags)] - if ldflags: - args += ['--ldflags=%s' % ' '.join(ldflags)] -- compiler = state.environment.coredata.compilers.get('c') -+ -+ if state.environment.is_cross_build(): -+ compiler = state.environment.coredata.cross_compilers.get('c') -+ else: -+ compiler = state.environment.coredata.compilers.get('c') - if compiler: - args += ['--cc=%s' % ' '.join(compiler.get_exelist())] - args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())] diff --git a/external/poky/meta/recipes-devtools/meson/meson/meson-setup.py b/external/poky/meta/recipes-devtools/meson/meson/meson-setup.py index a9749eae..808e2a06 100755 --- a/external/poky/meta/recipes-devtools/meson/meson/meson-setup.py +++ b/external/poky/meta/recipes-devtools/meson/meson/meson-setup.py @@ -1,62 +1,31 @@ #!/usr/bin/env python3 import os +import string import sys -def bail(msg): - print(msg, file=sys.stderr) - sys.exit(1) - -_MARKER = '@@' -def transform_line(line): - # Substitute any special markers of this form: - # @@ENV@@ - # with the value of ENV, split into meson array syntax. - start = line.find(_MARKER) - if start == -1: - return line - - end = line.rfind(_MARKER) - if end == start: - return line - - # Lookup value of the env var. - var = line[start+len(_MARKER):end] - try: - val = os.environ[var] - except KeyError: - bail('cannot generate meson.cross; env var %s not set' % var) +class Template(string.Template): + delimiter = "@" - # Transform into meson array. - val = ["'%s'" % x for x in val.split()] - val = ', '.join(val) - val = '[%s]' % val +class Environ(): + def __getitem__(self, name): + val = os.environ[name] + val = ["'%s'" % x for x in val.split()] + val = ', '.join(val) + val = '[%s]' % val + return val - before = line[:start] - after = line[end+len(_MARKER):] - - return '%s%s%s' % (before, val, after) - -# Make sure this is really an SDK extraction environment. try: sysroot = os.environ['OECORE_NATIVE_SYSROOT'] except KeyError: - bail('OECORE_NATIVE_SYSROOT env var must be set') - -cross_file = os.path.join(sysroot, 'usr/share/meson/meson.cross') -tmp_cross_file = '%s.tmp' % cross_file + print("Not in environment setup, bailing") + sys.exit(1) -# Read through and transform the current meson.cross. -lines = [] -with open(cross_file, 'r') as f: - for line in f: - lines.append(transform_line(line)) +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"]) -# Write the transformed result to a tmp file and atomically rename it. In case -# we crash during the file write, we don't want an invalid meson.cross file. -with open(tmp_cross_file, 'w') as f: - for line in lines: - f.write(line) - f.flush() - os.fdatasync(f.fileno()) -os.rename(tmp_cross_file, cross_file) +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) diff --git a/external/poky/meta/recipes-devtools/meson/meson/meson-wrapper b/external/poky/meta/recipes-devtools/meson/meson/meson-wrapper index b2e00da5..d4ffe60f 100755 --- a/external/poky/meta/recipes-devtools/meson/meson/meson-wrapper +++ b/external/poky/meta/recipes-devtools/meson/meson/meson-wrapper @@ -10,5 +10,5 @@ fi unset CC CXX CPP LD AR NM STRIP exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ - --cross-file "$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.cross" \ + --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \ "$@" |