From 3f9a0f0c6c99364eb128ffc2db704e957f1c0bce Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Mon, 15 Apr 2019 12:54:49 +0200 Subject: meson: update to 0.50.0 Remove 0001-Linker-rules-move-cross_args-in-front-of-output_args.patch as the upstream code has been completely reworked; if the issues pops up again, we need to re-write the fix. Rebase: 0001-Make-CPU-family-warnings-fatal.patch 0001-environment.py-detect-windows-also-if-the-system-str.patch 0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch 0002-Support-building-allarch-recipes-again.patch Add 0001-mesonbuild-environment.py-check-environment-for-vari.patch as particularly we set windows resource compiler through an environment variable WINDRES. This has replaced the 0001-modules-windows-split-WINDRES-env-variable.patch as the code has been refactored. Add 0001-mesonbuild-environment.py-do-not-determine-whether-a.patch for a more robust detection of cross builds. Replace many-cross.patch with corresponding backports from upcoming 0.50.1: 0007-mesonbuild-allow-multiple-cross-file-options.patch load-configs-generalise-search-path.patch Drop cross-libdir.patch as it has been merged upstream. Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- meta/recipes-devtools/meson/meson.inc | 14 +- ...s-move-cross_args-in-front-of-output_args.patch | 30 --- .../0001-Make-CPU-family-warnings-fatal.patch | 35 ++-- ....py-detect-windows-also-if-the-system-str.patch | 25 +++ ...ix-issues-that-arise-when-cross-compiling.patch | 2 +- ...environment.py-check-environment-for-vari.patch | 28 +++ ...environment.py-do-not-determine-whether-a.patch | 30 +++ ...odules-windows-split-WINDRES-env-variable.patch | 26 --- ...02-Support-building-allarch-recipes-again.patch | 16 +- ....py-detect-windows-also-if-the-system-str.patch | 25 --- ...onbuild-allow-multiple-cross-file-options.patch | 185 ++++++++++++++++++ .../meson/meson/cross-libdir.patch | 35 ---- .../load-configs-generalise-search-path.patch | 50 +++++ meta/recipes-devtools/meson/meson/many-cross.patch | 207 --------------------- meta/recipes-devtools/meson/meson_0.49.2.bb | 4 - meta/recipes-devtools/meson/meson_0.50.0.bb | 4 + .../meson/nativesdk-meson_0.49.2.bb | 71 ------- .../meson/nativesdk-meson_0.50.0.bb | 71 +++++++ 18 files changed, 429 insertions(+), 429 deletions(-) delete mode 100644 meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch create mode 100644 meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch create mode 100644 meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch create mode 100644 meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch delete mode 100644 meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch delete mode 100644 meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch create mode 100644 meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch delete mode 100644 meta/recipes-devtools/meson/meson/cross-libdir.patch create mode 100644 meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch delete mode 100644 meta/recipes-devtools/meson/meson/many-cross.patch delete mode 100644 meta/recipes-devtools/meson/meson_0.49.2.bb create mode 100644 meta/recipes-devtools/meson/meson_0.50.0.bb delete mode 100644 meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb create mode 100644 meta/recipes-devtools/meson/nativesdk-meson_0.50.0.bb diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc index 2d18f72c0c..6d743fbe14 100644 --- a/meta/recipes-devtools/meson/meson.inc +++ b/meta/recipes-devtools/meson/meson.inc @@ -7,18 +7,18 @@ 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 \ " -SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd" -SRC_URI[md5sum] = "0267b0871266056184c484792572c682" +SRC_URI[sha256sum] = "2a1bc42dda58206fb922cda5e1ca95cc03ad126321d26acc47d3493ec4e7021f" +SRC_URI[md5sum] = "433483107fda4616eaf33de7e7083a84" SRC_URI_append_class-native = " \ file://0001-Make-CPU-family-warnings-fatal.patch \ diff --git a/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch b/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch deleted file mode 100644 index 97778c32eb..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 4676224dbdff0f7107e8cbdbe0eab19c855f1454 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -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 ---- - mesonbuild/backend/ninjabackend.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py -index bb281e1..969b70e 100644 ---- a/mesonbuild/backend/ninjabackend.py -+++ b/mesonbuild/backend/ninjabackend.py -@@ -1501,7 +1501,7 @@ int dummy; - rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing - ''' - else: -- command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n' -+ command_template = ' command = {executable} $ARGS {cross_args} {output_args} $in $LINK_ARGS $aliasing\n' - command = command_template.format( - executable=' '.join(compiler.get_linker_exelist()), - cross_args=' '.join(cross_args), --- -2.15.0 - diff --git a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch index fbc3f5ad82..2580b1e366 100644 --- a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch +++ b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch @@ -1,4 +1,4 @@ -From 2db829d865bb6464ac15dbb4a58c9a675e296866 Mon Sep 17 00:00:00 2001 +From f76d2bf09f7ffd871d068c4ac4c4be083f5fb07f Mon Sep 17 00:00:00 2001 From: Ross Burton 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 --- - 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 f2510c1..b9841fe 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 4c1c5ac..a5a7461 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/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch b/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch new file mode 100644 index 0000000000..f6043190af --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch @@ -0,0 +1,25 @@ +From 63b78b7990c5d60f7bc674a26f655caa0bec3c49 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +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 +--- + mesonbuild/envconfig.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +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? + """ +- return self.system == 'windows' ++ return self.system == 'windows' or 'mingw' in self.system + + def is_cygwin(self): + """ diff --git a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch index 11fd9ed3ac..7c3238bf91 100644 --- a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch @@ -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/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch new file mode 100644 index 0000000000..fadb2734f4 --- /dev/null +++ b/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 +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 +--- + 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/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch new file mode 100644 index 0000000000..e64e13b836 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch @@ -0,0 +1,30 @@ +From c040f0dbace3259c80f3710bc019433b9c817940 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +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 +--- + mesonbuild/environment.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py +index 4c1c5ac..6e5d689 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -478,7 +478,7 @@ class Environment: + self.first_invocation = True + + def is_cross_build(self): +- return not self.machines.matches_build_machine(MachineChoice.HOST) ++ return self.need_exe_wrapper() + + def dump_coredata(self): + return coredata.save(self.coredata, self.get_build_dir()) +-- +2.17.1 + diff --git a/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch b/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch deleted file mode 100644 index c334e6dd66..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5293d0f5067b2aeefe9ce3c175c972de367589bc Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -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 ---- - mesonbuild/modules/windows.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py -index d185d89..dbaeb9b 100644 ---- a/mesonbuild/modules/windows.py -+++ b/mesonbuild/modules/windows.py -@@ -56,7 +56,7 @@ class WindowsModule(ExtensionModule): - if 'WINDRES' in os.environ: - # Pick-up env var WINDRES if set. This is often used for - # specifying an arch-specific windres. -- rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True) -+ rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES').split(), silent=True) - - if not rescomp or not rescomp.found(): - # Take windres from the config file after the environment, which is diff --git a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch index 81548cdfb8..f0ea61bac5 100644 --- a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch +++ b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch @@ -1,4 +1,4 @@ -From f8419d5f279f1fb9b5e7eead4f1579bce7cb0e4e Mon Sep 17 00:00:00 2001 +From 755902910ad124095c671b3c7f057e6513d9c0c6 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt 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 --- - 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 b9841fe..9c0487e 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -34,6 +34,7 @@ from . import mlog + known_cpu_families = ( + 'allarch', diff --git a/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch b/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch deleted file mode 100644 index 1be5d66329..0000000000 --- a/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7bf4c2c02eb7fe1bf24b23e3ba2d7df36495e0aa Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Wed, 13 Feb 2019 17:45:09 +0100 -Subject: [PATCH] environment.py: detect windows also if the system string - contains 'mingw' - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin ---- - mesonbuild/environment.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index b4fc0dc..845077e 100644 ---- a/mesonbuild/environment.py -+++ b/mesonbuild/environment.py -@@ -1247,7 +1247,7 @@ class MachineInfo: - """ - Machine is windows? - """ -- return self.system == 'windows' -+ return self.system == 'windows' or 'mingw' in self.system - - def is_cygwin(self): - """ diff --git a/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch b/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch new file mode 100644 index 0000000000..6c2949c0e8 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch @@ -0,0 +1,185 @@ +From 07ae4f949b8402cff178dd12c210d9a726ffe2da Mon Sep 17 00:00:00 2001 +From: Ross Burton +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. + +Upstream-Status: Backport [will be in 0.50.1] +Signed-off-by: Ross Burton + +--- + .../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 4d35d22..5b270d3 100644 +--- a/mesonbuild/backend/backends.py ++++ b/mesonbuild/backend/backends.py +@@ -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(): +- deps.append(os.path.join(self.build_to_src, +- self.environment.coredata.cross_file)) ++ deps.extend(self.environment.coredata.cross_files) + deps.append('meson-private/coredata.dat') + 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 066ad30..d80e9a0 100644 +--- a/mesonbuild/coredata.py ++++ b/mesonbuild/coredata.py +@@ -265,7 +265,7 @@ class CoreData: + self.compiler_options = PerMachine({}, {}, {}) + self.base_options = {} + 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() +@@ -276,57 +276,19 @@ class CoreData: + + @staticmethod + def __load_config_files(filenames): ++ # Need to try and make the passed filenames absolute because when the ++ # files are parsed later we'll have chdir()d. + if not filenames: + return [] + filenames = [os.path.abspath(os.path.expanduser(os.path.expanduser(f))) + for f in filenames] + return filenames + +- @staticmethod +- def __load_cross_file(filename): +- """Try to load the cross file. +- +- If the filename is None return None. If the filename is an absolute +- (after resolving variables and ~), return that absolute path. Next, +- check if the file is relative to the current source dir. If the path +- still isn't resolved do the following: +- Windows: +- - Error +- *: +- - $XDG_DATA_HOME/meson/cross (or ~/.local/share/meson/cross if +- undefined) +- - $XDG_DATA_DIRS/meson/cross (or +- /usr/local/share/meson/cross:/usr/share/meson/cross if undefined) +- - Error +- +- Non-Windows follows the Linux path and will honor XDG_* if set. This +- simplifies the implementation somewhat. +- """ +- if filename is None: +- return None +- filename = os.path.expanduser(os.path.expandvars(filename)) +- if os.path.isabs(filename): +- return filename +- path_to_try = os.path.abspath(filename) +- if os.path.isfile(path_to_try): +- return path_to_try +- if sys.platform != 'win32': +- paths = [ +- 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', 'cross', filename) +- if os.path.isfile(path_to_try): +- return path_to_try +- raise MesonException('Cannot find specified cross file: ' + filename) +- +- raise MesonException('Cannot find specified cross file: ' + filename) +- + def libdir_cross_fixup(self): + # By default set libdir to "lib" when cross compiling since + # getting the "system default" is always wrong on multiarch + # platforms as it gets a value like lib/x86_64-linux-gnu. +- if self.cross_file is not None: ++ if self.cross_files: + self.builtins['libdir'].value = 'lib' + + def sanitize_prefix(self, prefix): +@@ -642,8 +604,8 @@ def read_cmd_line_file(build_dir, options): + options.cmd_line_options = d + + properties = config['properties'] +- if options.cross_file is None: +- options.cross_file = properties.get('cross_file', None) ++ if not options.cross_file: ++ options.cross_file = ast.literal_eval(properties.get('cross_file', '[]')) + 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. +@@ -654,7 +616,7 @@ def write_cmd_line_file(build_dir, options): + config = CmdLineFileParser() + + properties = {} +- if options.cross_file is not None: ++ if options.cross_file: + properties['cross_file'] = options.cross_file + if options.native_file: + properties['native_file'] = options.native_file +diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py +index c25ef33..4c1c5ac 100644 +--- a/mesonbuild/environment.py ++++ b/mesonbuild/environment.py +@@ -394,8 +394,9 @@ class Environment: + self.binaries.build = BinaryTable(config.get('binaries', {})) + self.paths.build = Directories(**config.get('paths', {})) + +- 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 023afdb..6e8ca83 100644 +--- a/mesonbuild/msetup.py ++++ b/mesonbuild/msetup.py +@@ -29,7 +29,9 @@ from .mesonlib import MesonException + + def add_arguments(parser): + coredata.register_builtin_arguments(parser) +- parser.add_argument('--cross-file', default=None, ++ parser.add_argument('--cross-file', ++ default=[], ++ action='append', + help='File describing cross compilation environment.') + parser.add_argument('--native-file', + default=[], +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/meta/recipes-devtools/meson/meson/cross-libdir.patch b/meta/recipes-devtools/meson/meson/cross-libdir.patch deleted file mode 100644 index 7395fdbdaa..0000000000 --- a/meta/recipes-devtools/meson/meson/cross-libdir.patch +++ /dev/null @@ -1,35 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Ross Burton - -From ce24f0d6a9be22ba61d80cd254e0409de2eaffd7 Mon Sep 17 00:00:00 2001 -From: Jussi Pakkanen -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/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch b/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch new file mode 100644 index 0000000000..fc02576f5b --- /dev/null +++ b/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch @@ -0,0 +1,50 @@ +From d57dd1092e84e08ee15d7063b6c56bd6d864f2e1 Mon Sep 17 00:00:00 2001 +From: Ross Burton +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. +--- + 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/meta/recipes-devtools/meson/meson/many-cross.patch b/meta/recipes-devtools/meson/meson/many-cross.patch deleted file mode 100644 index d04c28b8a3..0000000000 --- a/meta/recipes-devtools/meson/meson/many-cross.patch +++ /dev/null @@ -1,207 +0,0 @@ -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. - -Upstream-Status: Backport [will be in 0.50.1] -Signed-off-by: Ross Burton - -diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py -index 40402513..4b9bcb59 100644 ---- a/mesonbuild/backend/backends.py -+++ b/mesonbuild/backend/backends.py -@@ -726,8 +726,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(): -- deps.append(os.path.join(self.build_to_src, -- self.environment.coredata.cross_file)) -+ deps.extend(self.environment.coredata.cross_files) - deps.append('meson-private/coredata.dat') - 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 ---- 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 = {} - self.base_options = {} - self.external_preprocess_args = {} # 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: - - @staticmethod - def __load_config_files(filenames): -+ # Need to try and make the passed filenames absolute because when the -+ # files are parsed later we'll have chdir()d. - if not filenames: - return [] - filenames = [os.path.abspath(os.path.expanduser(os.path.expanduser(f))) - for f in filenames] - return filenames - -- @staticmethod -- def __load_cross_file(filename): -- """Try to load the cross file. -- -- If the filename is None return None. If the filename is an absolute -- (after resolving variables and ~), return that absolute path. Next, -- check if the file is relative to the current source dir. If the path -- still isn't resolved do the following: -- Windows: -- - Error -- *: -- - $XDG_DATA_HOME/meson/cross (or ~/.local/share/meson/cross if -- undefined) -- - $XDG_DATA_DIRS/meson/cross (or -- /usr/local/share/meson/cross:/usr/share/meson/cross if undefined) -- - Error -- -- Non-Windows follows the Linux path and will honor XDG_* if set. This -- simplifies the implementation somewhat. -- """ -- if filename is None: -- return None -- filename = os.path.expanduser(os.path.expandvars(filename)) -- if os.path.isabs(filename): -- return filename -- path_to_try = os.path.abspath(filename) -- if os.path.isfile(path_to_try): -- return path_to_try -- if sys.platform != 'win32': -- paths = [ -- 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', 'cross', filename) -- if os.path.isfile(path_to_try): -- return path_to_try -- raise MesonException('Cannot find specified cross file: ' + filename) -- -- raise MesonException('Cannot find specified cross file: ' + filename) -- - 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): - options.cmd_line_options = d - - properties = config['properties'] -- if options.cross_file is None: -- options.cross_file = properties.get('cross_file', None) -+ if not options.cross_file: -+ options.cross_file = ast.literal_eval(properties.get('cross_file', '[]')) - 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): - config = CmdLineFileParser() - - properties = {} -- if options.cross_file is not None: -+ if options.cross_file: - properties['cross_file'] = options.cross_file - if options.native_file: - properties['native_file'] = options.native_file -diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 6d86daf9..406ab8b8 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: - - 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] = {} -diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py -index 56a0e9a7..f0a1ae19 100644 ---- a/mesonbuild/msetup.py -+++ b/mesonbuild/msetup.py -@@ -27,7 +27,9 @@ from .mesonlib import MesonException - - def add_arguments(parser): - coredata.register_builtin_arguments(parser) -- parser.add_argument('--cross-file', default=None, -+ parser.add_argument('--cross-file', -+ default=[], -+ action='append', - 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/meta/recipes-devtools/meson/meson_0.49.2.bb b/meta/recipes-devtools/meson/meson_0.49.2.bb deleted file mode 100644 index de9b905c12..0000000000 --- a/meta/recipes-devtools/meson/meson_0.49.2.bb +++ /dev/null @@ -1,4 +0,0 @@ -include meson.inc - -BBCLASSEXTEND = "native" - diff --git a/meta/recipes-devtools/meson/meson_0.50.0.bb b/meta/recipes-devtools/meson/meson_0.50.0.bb new file mode 100644 index 0000000000..de9b905c12 --- /dev/null +++ b/meta/recipes-devtools/meson/meson_0.50.0.bb @@ -0,0 +1,4 @@ +include meson.inc + +BBCLASSEXTEND = "native" + diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb deleted file mode 100644 index 1549357a55..0000000000 --- a/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb +++ /dev/null @@ -1,71 +0,0 @@ -include meson.inc - -inherit nativesdk -inherit siteinfo - -SRC_URI += "file://meson-setup.py \ - file://meson-wrapper" - -def meson_endian(prefix, d): - arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS") - sitedata = siteinfo_data_for_machine(arch, os, d) - if "endian-little" in sitedata: - return "little" - elif "endian-big" in sitedata: - return "big" - else: - bb.fatal("Cannot determine endianism for %s-%s" % (arch, os)) - -MESON_TOOLCHAIN_ARGS = "${BUILDSDK_CC_ARCH}${TOOLCHAIN_OPTIONS}" -MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CFLAGS}" -MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CXXFLAGS}" -MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_LDFLAGS}" - -# The cross file logic is similar but not identical to that in meson.bbclass, -# since it's generating for an SDK rather than a cross-compile. Important -# differences are: -# - We can't set vars like CC, CXX, etc. yet because they will be filled in with -# real paths by meson-setup.sh when the SDK is extracted. -# - Some overrides aren't needed, since the SDK injects paths that take care of -# them. -do_install_append() { - install -d ${D}${datadir}/meson - cat >${D}${datadir}/meson/meson.cross.template <${D}${datadir}/meson/meson.cross.template <