diff options
Diffstat (limited to 'poky/meta/recipes-devtools/meson')
15 files changed, 268 insertions, 222 deletions
diff --git a/poky/meta/recipes-devtools/meson/meson.inc b/poky/meta/recipes-devtools/meson/meson.inc index 2d18f72c0..6a723683c 100644 --- a/poky/meta/recipes-devtools/meson/meson.inc +++ b/poky/meta/recipes-devtools/meson/meson.inc @@ -7,18 +7,19 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \ file://0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch \ - file://0001-Linker-rules-move-cross_args-in-front-of-output_args.patch \ file://0003-native_bindir.patch \ file://0001-python-module-do-not-manipulate-the-environment-when.patch \ file://disable-rpath-handling.patch \ - file://0001-modules-windows-split-WINDRES-env-variable.patch \ - file://0002-environment.py-detect-windows-also-if-the-system-str.patch \ file://cross-prop-default.patch \ - file://many-cross.patch \ - file://cross-libdir.patch \ + file://load-configs-generalise-search-path.patch \ + file://0007-mesonbuild-allow-multiple-cross-file-options.patch \ + file://0001-environment.py-detect-windows-also-if-the-system-str.patch \ + file://0001-mesonbuild-environment.py-do-not-determine-whether-a.patch \ + file://0001-mesonbuild-environment.py-check-environment-for-vari.patch \ + file://0001-modules-python.py-do-not-substitute-python-s-install.patch \ " -SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd" -SRC_URI[md5sum] = "0267b0871266056184c484792572c682" +SRC_URI[sha256sum] = "f68f56d60c80a77df8fc08fa1016bc5831605d4717b622c96212573271e14ecc" +SRC_URI[md5sum] = "24a6527796115828d2ebc75880e18d62" SRC_URI_append_class-native = " \ file://0001-Make-CPU-family-warnings-fatal.patch \ diff --git a/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch b/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch deleted file mode 100644 index 97778c32e..000000000 --- a/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/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch index fbc3f5ad8..adde1e271 100644 --- a/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch +++ b/poky/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch @@ -1,4 +1,4 @@ -From 2db829d865bb6464ac15dbb4a58c9a675e296866 Mon Sep 17 00:00:00 2001 +From 4b4b3d4932d928f05dbd74d730a3c8a5ac371e1d Mon Sep 17 00:00:00 2001 From: Ross Burton <ross.burton@intel.com> Date: Tue, 3 Jul 2018 13:59:09 +0100 Subject: [PATCH] Make CPU family warnings fatal @@ -7,15 +7,29 @@ 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(-) + 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 5309ef4..3f0a399 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -178,7 +178,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 2ccd31e..5fcf9df 100644 +index 3031a82..ecd18d0 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py -@@ -265,9 +265,7 @@ def detect_cpu_family(compilers): - # below. +@@ -242,9 +242,7 @@ def detect_cpu_family(compilers): + trial = 'parisc' if trial not in known_cpu_families: - mlog.warning('Unknown CPU family {!r}, please report this at ' @@ -25,12 +39,3 @@ index 2ccd31e..5fcf9df 100644 return trial -@@ -1232,7 +1230,7 @@ class MachineInfo: - - cpu_family = literal['cpu_family'] - if cpu_family not in known_cpu_families: -- mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % cpu_family) -+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % cpu_family) - - endian = literal['endian'] - if endian not in ('little', 'big'): diff --git a/poky/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch b/poky/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch index 1be5d6632..f6043190a 100644 --- a/poky/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch +++ b/poky/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch @@ -1,20 +1,20 @@ -From 7bf4c2c02eb7fe1bf24b23e3ba2d7df36495e0aa Mon Sep 17 00:00:00 2001 +From 63b78b7990c5d60f7bc674a26f655caa0bec3c49 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Wed, 13 Feb 2019 17:45:09 +0100 +Date: Mon, 25 Mar 2019 17:17:06 +0100 Subject: [PATCH] environment.py: detect windows also if the system string contains 'mingw' Upstream-Status: Pending Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- - mesonbuild/environment.py | 2 +- + mesonbuild/envconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index b4fc0dc..845077e 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -1247,7 +1247,7 @@ class MachineInfo: +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index f2510c1..5309ef4 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -194,7 +194,7 @@ class MachineInfo: """ Machine is windows? """ diff --git a/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch index 11fd9ed3a..7c3238bf9 100644 --- a/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ b/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch @@ -27,7 +27,7 @@ index bf49770..7c5a363 100644 '--mode=' + mode] 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('--run=' + gtkdoc_exe_wrapper) + diff --git a/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch b/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch new file mode 100644 index 000000000..fadb2734f --- /dev/null +++ b/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch @@ -0,0 +1,28 @@ +From 63e79329b5dd00882f0cea56a6d907a831b94171 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Mon, 25 Mar 2019 18:52:48 +0100 +Subject: [PATCH] mesonbuild/environment.py: check environment for various + binaries + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + mesonbuild/environment.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py +index 6e5d689..bbfd87d 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -398,7 +398,7 @@ class Environment: + config = MesonConfigFile.from_config_parser( + coredata.load_configs(self.coredata.cross_files, 'cross')) + self.properties.host = Properties(config.get('properties', {}), False) +- self.binaries.host = BinaryTable(config.get('binaries', {}), False) ++ self.binaries.host = BinaryTable(config.get('binaries', {}), True) + if 'host_machine' in config: + self.machines.host = MachineInfo.from_literal(config['host_machine']) + if 'target_machine' in config: +-- +2.17.1 + diff --git a/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch b/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch new file mode 100644 index 000000000..833471454 --- /dev/null +++ b/poky/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch @@ -0,0 +1,28 @@ +From d9da5e7a16a9397e22a8900fac4b60b40d7f00de Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Mon, 25 Mar 2019 18:18:33 +0100 +Subject: [PATCH] mesonbuild/environment.py: do not determine whether a build + is cross by comparing architectures + +This can, and does, go wrong when our host architecture is same as the target one(e.g. x86_64). + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + mesonbuild/environment.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py +index d4f0630..c584fa4 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -483,7 +483,7 @@ class Environment: + self.first_invocation = True + + def is_cross_build(self): +- return self.coredata.cross_file is not None ++ return self.need_exe_wrapper() + + def dump_coredata(self): + return coredata.save(self.coredata, self.get_build_dir()) diff --git a/poky/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch b/poky/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch new file mode 100644 index 000000000..a25c39227 --- /dev/null +++ b/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/poky/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch b/poky/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch deleted file mode 100644 index c334e6dd6..000000000 --- a/poky/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5293d0f5067b2aeefe9ce3c175c972de367589bc Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Wed, 13 Feb 2019 17:43:54 +0100 -Subject: [PATCH] modules/windows: split WINDRES env variable - -As it may contain not just the binary, but also the arguments to it. - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - mesonbuild/modules/windows.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py -index d185d89..dbaeb9b 100644 ---- a/mesonbuild/modules/windows.py -+++ b/mesonbuild/modules/windows.py -@@ -56,7 +56,7 @@ class WindowsModule(ExtensionModule): - if 'WINDRES' in os.environ: - # Pick-up env var WINDRES if set. This is often used for - # specifying an arch-specific windres. -- rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True) -+ rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES').split(), silent=True) - - if not rescomp or not rescomp.found(): - # Take windres from the config file after the environment, which is diff --git a/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch index 81548cdfb..e47e55532 100644 --- a/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch +++ b/poky/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch @@ -1,4 +1,4 @@ -From f8419d5f279f1fb9b5e7eead4f1579bce7cb0e4e Mon Sep 17 00:00:00 2001 +From 2164655328ec4e47335fc9033813274365491ad8 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt <pkj@axis.com> Date: Thu, 26 Jul 2018 16:32:49 +0200 Subject: [PATCH] Support building allarch recipes again @@ -9,15 +9,15 @@ Upstream-Status: Inappropriate [OE specific] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> --- - mesonbuild/environment.py | 1 + + mesonbuild/envconfig.py | 1 + 1 file changed, 1 insertion(+) -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 5fcf9df..b4fc0dc 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -72,6 +72,7 @@ from .compilers import ( - build_filename = 'meson.build' +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index 3f0a399..4509e09 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -34,6 +34,7 @@ from . import mlog + known_cpu_families = ( + 'allarch', diff --git a/poky/meta/recipes-devtools/meson/meson/many-cross.patch b/poky/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch index d04c28b8a..6c2949c0e 100644 --- a/poky/meta/recipes-devtools/meson/meson/many-cross.patch +++ b/poky/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch @@ -1,4 +1,7 @@ -mesonbuild: allow multiple --cross-file options +From 07ae4f949b8402cff178dd12c210d9a726ffe2da Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Mon, 18 Mar 2019 17:27:57 +0000 +Subject: [PATCH] mesonbuild: allow multiple --cross-file options Just like --native-file, allow multiple --cross-file options. This is mostly unifying the logic between cross_files and config_files. @@ -6,11 +9,30 @@ unifying the logic between cross_files and config_files. Upstream-Status: Backport [will be in 0.50.1] Signed-off-by: Ross Burton <ross.burton@intel.com> +--- + .../markdown/snippets/multiple-cross-files.md | 3 ++ + mesonbuild/backend/backends.py | 3 +- + mesonbuild/coredata.py | 52 +++---------------- + mesonbuild/environment.py | 5 +- + mesonbuild/msetup.py | 4 +- + mesonbuild/munstable_coredata.py | 5 +- + 6 files changed, 20 insertions(+), 52 deletions(-) + create mode 100644 docs/markdown/snippets/multiple-cross-files.md + +diff --git a/docs/markdown/snippets/multiple-cross-files.md b/docs/markdown/snippets/multiple-cross-files.md +new file mode 100644 +index 0000000..de229be +--- /dev/null ++++ b/docs/markdown/snippets/multiple-cross-files.md +@@ -0,0 +1,3 @@ ++## Multipe cross files can be specified ++ ++`--cross-file` can be passed multiple times, with the configuration files overlaying the same way as `--native-file`. diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py -index 40402513..4b9bcb59 100644 +index 4d35d22..5b270d3 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py -@@ -726,8 +726,7 @@ class Backend: +@@ -788,8 +788,7 @@ class Backend: deps = [os.path.join(self.build_to_src, df) for df in self.interpreter.get_build_def_files()] if self.environment.is_cross_build(): @@ -21,39 +43,19 @@ index 40402513..4b9bcb59 100644 if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')): deps.append(os.path.join(self.build_to_src, 'meson_options.txt')) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py -index c3f5a745..ff810683 100644 +index 066ad30..d80e9a0 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py -@@ -201,8 +201,8 @@ class UserFeatureOption(UserComboOption): - return self.value == 'auto' - - --def load_configs(filenames): -- """Load native files.""" -+def load_configs(filenames, subdir): -+ """Load configuration files from a named subdirectory.""" - def gen(): - for f in filenames: - f = os.path.expanduser(os.path.expandvars(f)) -@@ -215,7 +215,7 @@ def load_configs(filenames): - os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')), - ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') - for path in paths: -- path_to_try = os.path.join(path, 'meson', 'native', f) -+ path_to_try = os.path.join(path, 'meson', subdir, f) - if os.path.isfile(path_to_try): - yield path_to_try - break -@@ -291,7 +291,7 @@ class CoreData: - self.compiler_options = {} +@@ -265,7 +265,7 @@ class CoreData: + self.compiler_options = PerMachine({}, {}, {}) self.base_options = {} - self.external_preprocess_args = {} # CPPFLAGS only + self.external_preprocess_args = PerMachine({}, {}, {}) # CPPFLAGS only - self.cross_file = self.__load_cross_file(options.cross_file) + self.cross_files = self.__load_config_files(options.cross_file) self.compilers = OrderedDict() self.cross_compilers = OrderedDict() self.deps = OrderedDict() -@@ -301,52 +301,14 @@ class CoreData: +@@ -276,57 +276,19 @@ class CoreData: @staticmethod def __load_config_files(filenames): @@ -105,10 +107,16 @@ index c3f5a745..ff810683 100644 - - raise MesonException('Cannot find specified cross file: ' + filename) - + def libdir_cross_fixup(self): + # By default set libdir to "lib" when cross compiling since + # getting the "system default" is always wrong on multiarch + # platforms as it gets a value like lib/x86_64-linux-gnu. +- if self.cross_file is not None: ++ if self.cross_files: + self.builtins['libdir'].value = 'lib' + def sanitize_prefix(self, prefix): - if not os.path.isabs(prefix): - raise MesonException('prefix value {!r} must be an absolute path' -@@ -558,8 +520,8 @@ def read_cmd_line_file(build_dir, options): +@@ -642,8 +604,8 @@ def read_cmd_line_file(build_dir, options): options.cmd_line_options = d properties = config['properties'] @@ -119,7 +127,7 @@ index c3f5a745..ff810683 100644 if not options.native_file: # This will be a string in the form: "['first', 'second', ...]", use # literal_eval to get it into the list of strings. -@@ -570,7 +532,7 @@ def write_cmd_line_file(build_dir, options): +@@ -654,7 +616,7 @@ def write_cmd_line_file(build_dir, options): config = CmdLineFileParser() properties = {} @@ -129,50 +137,26 @@ index c3f5a745..ff810683 100644 if options.native_file: properties['native_file'] = options.native_file diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 6d86daf9..406ab8b8 100644 +index c25ef33..4c1c5ac 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py -@@ -355,8 +355,8 @@ class Environment: - self.machines = MachineInfos() - # Will be fully initialized later using compilers later. - self.machines.detect_build() -- if self.coredata.cross_file: -- self.cross_info = CrossBuildInfo(self.coredata.cross_file) -+ if self.coredata.cross_files: -+ self.cross_info = CrossBuildInfo(self.coredata.cross_files) - if 'exe_wrapper' in self.cross_info.config['binaries']: - from .dependencies import ExternalProgram - self.exe_wrapper = ExternalProgram.from_bin_list( -@@ -373,7 +373,7 @@ class Environment: +@@ -394,8 +394,9 @@ class Environment: + self.binaries.build = BinaryTable(config.get('binaries', {})) + self.paths.build = Directories(**config.get('paths', {})) - if self.coredata.config_files: - self.config_info = coredata.ConfigData( -- coredata.load_configs(self.coredata.config_files)) -+ coredata.load_configs(self.coredata.config_files, 'native')) - else: - self.config_info = coredata.ConfigData() - -@@ -1113,13 +1113,8 @@ class CrossBuildInfo: - def ok_type(self, i): - return isinstance(i, (str, int, bool)) - -- def parse_datafile(self, filename): -- config = configparser.ConfigParser() -- try: -- with open(filename, 'r') as f: -- config.read_file(f, filename) -- except FileNotFoundError: -- raise EnvironmentException('File not found: %s.' % filename) -+ def parse_datafile(self, filenames): -+ config = coredata.load_configs(filenames, 'cross') - # This is a bit hackish at the moment. - for s in config.sections(): - self.config[s] = {} +- if self.coredata.cross_file is not None: +- config = MesonConfigFile.parse_datafile(self.coredata.cross_file) ++ if self.coredata.cross_files: ++ config = MesonConfigFile.from_config_parser( ++ coredata.load_configs(self.coredata.cross_files, 'cross')) + self.properties.host = Properties(config.get('properties', {}), False) + self.binaries.host = BinaryTable(config.get('binaries', {}), False) + if 'host_machine' in config: diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py -index 56a0e9a7..f0a1ae19 100644 +index 023afdb..6e8ca83 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py -@@ -27,7 +27,9 @@ from .mesonlib import MesonException +@@ -29,7 +29,9 @@ from .mesonlib import MesonException def add_arguments(parser): coredata.register_builtin_arguments(parser) @@ -183,25 +167,19 @@ index 56a0e9a7..f0a1ae19 100644 help='File describing cross compilation environment.') parser.add_argument('--native-file', default=[], -diff --git a/run_unittests.py b/run_unittests.py -index e6874b25..1d247291 100755 ---- a/run_unittests.py -+++ b/run_unittests.py -@@ -529,7 +529,7 @@ class InternalTests(unittest.TestCase): - config.write(configfile) - configfile.flush() - configfile.close() -- detected_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() -+ detected_value = mesonbuild.environment.CrossBuildInfo((configfile.name,)).need_exe_wrapper() - os.unlink(configfilename) - - desired_value = not detected_value -@@ -541,7 +541,7 @@ class InternalTests(unittest.TestCase): - configfilename = configfile.name - config.write(configfile) - configfile.close() -- forced_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() -+ forced_value = mesonbuild.environment.CrossBuildInfo((configfile.name,)).need_exe_wrapper() - os.unlink(configfilename) - - self.assertEqual(forced_value, desired_value) +diff --git a/mesonbuild/munstable_coredata.py b/mesonbuild/munstable_coredata.py +index 78f3f34..913f942 100644 +--- a/mesonbuild/munstable_coredata.py ++++ b/mesonbuild/munstable_coredata.py +@@ -81,8 +81,9 @@ def run(options): + print('Last seen PKGCONFIG enviroment variable value: ' + v) + elif k == 'version': + print('Meson version: ' + v) +- elif k == 'cross_file': +- print('Cross File: ' + (v or 'None')) ++ elif k == 'cross_files': ++ if v: ++ print('Cross File: ' + ' '.join(v)) + elif k == 'config_files': + if v: + print('Native File: ' + ' '.join(v)) diff --git a/poky/meta/recipes-devtools/meson/meson/cross-libdir.patch b/poky/meta/recipes-devtools/meson/meson/cross-libdir.patch deleted file mode 100644 index 7395fdbda..000000000 --- a/poky/meta/recipes-devtools/meson/meson/cross-libdir.patch +++ /dev/null @@ -1,35 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From ce24f0d6a9be22ba61d80cd254e0409de2eaffd7 Mon Sep 17 00:00:00 2001 -From: Jussi Pakkanen <jpakkane@gmail.com> -Date: Thu, 27 Dec 2018 23:43:35 +0200 -Subject: [PATCH] Default libdir is "lib" when cross compiling. Closes #2535. - ---- -diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py -index ff810683..9ee23a69 100644 ---- a/mesonbuild/coredata.py -+++ b/mesonbuild/coredata.py -@@ -298,6 +298,7 @@ class CoreData: - # Only to print a warning if it changes between Meson invocations. - self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '') - self.config_files = self.__load_config_files(options.native_file) -+ self.libdir_cross_fixup() - - @staticmethod - def __load_config_files(filenames): -@@ -309,6 +310,13 @@ class CoreData: - for f in filenames] - return filenames - -+ def libdir_cross_fixup(self): -+ # By default set libdir to "lib" when cross compiling since -+ # getting the "system default" is always wrong on multiarch -+ # platforms as it gets a value like lib/x86_64-linux-gnu. -+ if self.cross_files: -+ self.builtins['libdir'].value = 'lib' -+ - def sanitize_prefix(self, prefix): - if not os.path.isabs(prefix): - raise MesonException('prefix value {!r} must be an absolute path' diff --git a/poky/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch b/poky/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch new file mode 100644 index 000000000..2056763db --- /dev/null +++ b/poky/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch @@ -0,0 +1,53 @@ +From d57dd1092e84e08ee15d7063b6c56bd6d864f2e1 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Mon, 18 Mar 2019 16:16:56 +0000 +Subject: [PATCH] load_configs: generalise the search path + +Instead of hard-coding the fact that load_configs() searches for files under +meson/native, pass in the subdirectory allowing the cross-file code to use the +same logic. + +Upstream-Status: Backport +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + mesonbuild/coredata.py | 6 +++--- + mesonbuild/environment.py | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py +index fba90fa369..6e60917d10 100644 +--- a/mesonbuild/coredata.py ++++ b/mesonbuild/coredata.py +@@ -211,8 +211,8 @@ def is_auto(self): + return self.value == 'auto' + + +-def load_configs(filenames): +- """Load native files.""" ++def load_configs(filenames, subdir): ++ """Load configuration files from a named subdirectory.""" + def gen(): + for f in filenames: + f = os.path.expanduser(os.path.expandvars(f)) +@@ -225,7 +225,7 @@ def gen(): + os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')), + ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') + for path in paths: +- path_to_try = os.path.join(path, 'meson', 'native', f) ++ path_to_try = os.path.join(path, 'meson', subdir, f) + if os.path.isfile(path_to_try): + yield path_to_try + break +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py +index 58adb06960..92a00dd7bf 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -408,7 +408,7 @@ def __init__(self, source_dir, build_dir, options): + + if self.coredata.config_files is not None: + config = MesonConfigFile.from_config_parser( +- coredata.load_configs(self.coredata.config_files)) ++ coredata.load_configs(self.coredata.config_files, 'native')) + self.binaries.build = BinaryTable(config.get('binaries', {})) + self.paths.build = Directories(**config.get('paths', {})) + diff --git a/poky/meta/recipes-devtools/meson/meson_0.49.2.bb b/poky/meta/recipes-devtools/meson/meson_0.50.1.bb index de9b905c1..de9b905c1 100644 --- a/poky/meta/recipes-devtools/meson/meson_0.49.2.bb +++ b/poky/meta/recipes-devtools/meson/meson_0.50.1.bb diff --git a/poky/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb b/poky/meta/recipes-devtools/meson/nativesdk-meson_0.50.1.bb index 1549357a5..1549357a5 100644 --- a/poky/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb +++ b/poky/meta/recipes-devtools/meson/nativesdk-meson_0.50.1.bb |