diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch')
-rw-r--r-- | meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch | 50 |
1 files changed, 50 insertions, 0 deletions
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 @@ | |||
1 | From d57dd1092e84e08ee15d7063b6c56bd6d864f2e1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@intel.com> | ||
3 | Date: Mon, 18 Mar 2019 16:16:56 +0000 | ||
4 | Subject: [PATCH] load_configs: generalise the search path | ||
5 | |||
6 | Instead of hard-coding the fact that load_configs() searches for files under | ||
7 | meson/native, pass in the subdirectory allowing the cross-file code to use the | ||
8 | same logic. | ||
9 | --- | ||
10 | mesonbuild/coredata.py | 6 +++--- | ||
11 | mesonbuild/environment.py | 2 +- | ||
12 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py | ||
15 | index fba90fa369..6e60917d10 100644 | ||
16 | --- a/mesonbuild/coredata.py | ||
17 | +++ b/mesonbuild/coredata.py | ||
18 | @@ -211,8 +211,8 @@ def is_auto(self): | ||
19 | return self.value == 'auto' | ||
20 | |||
21 | |||
22 | -def load_configs(filenames): | ||
23 | - """Load native files.""" | ||
24 | +def load_configs(filenames, subdir): | ||
25 | + """Load configuration files from a named subdirectory.""" | ||
26 | def gen(): | ||
27 | for f in filenames: | ||
28 | f = os.path.expanduser(os.path.expandvars(f)) | ||
29 | @@ -225,7 +225,7 @@ def gen(): | ||
30 | os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')), | ||
31 | ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') | ||
32 | for path in paths: | ||
33 | - path_to_try = os.path.join(path, 'meson', 'native', f) | ||
34 | + path_to_try = os.path.join(path, 'meson', subdir, f) | ||
35 | if os.path.isfile(path_to_try): | ||
36 | yield path_to_try | ||
37 | break | ||
38 | diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py | ||
39 | index 58adb06960..92a00dd7bf 100644 | ||
40 | --- a/mesonbuild/environment.py | ||
41 | +++ b/mesonbuild/environment.py | ||
42 | @@ -408,7 +408,7 @@ def __init__(self, source_dir, build_dir, options): | ||
43 | |||
44 | if self.coredata.config_files is not None: | ||
45 | config = MesonConfigFile.from_config_parser( | ||
46 | - coredata.load_configs(self.coredata.config_files)) | ||
47 | + coredata.load_configs(self.coredata.config_files, 'native')) | ||
48 | self.binaries.build = BinaryTable(config.get('binaries', {})) | ||
49 | self.paths.build = Directories(**config.get('paths', {})) | ||
50 | |||