diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson/0003-native_bindir.patch')
-rw-r--r-- | meta/recipes-devtools/meson/meson/0003-native_bindir.patch | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch b/meta/recipes-devtools/meson/meson/0003-native_bindir.patch deleted file mode 100644 index ed85116c4f..0000000000 --- a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | From 1546e1f95a119175b7a4e4272a26dd85505e5ede Mon Sep 17 00:00:00 2001 | ||
2 | From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | ||
3 | Date: Wed, 15 Nov 2017 15:05:01 +0100 | ||
4 | Subject: [PATCH] native_bindir | ||
5 | |||
6 | Some libraries, like QT, have pre-processors that convert their input | ||
7 | files into something that the cross-compiler can process. We find the | ||
8 | path of those pre-processors via pkg-config-native instead of | ||
9 | pkg-config. | ||
10 | |||
11 | This path forces the use of pkg-config-native for host_bins arguments. | ||
12 | |||
13 | There are some discussions upstream to merge this patch, but I presonaly believe | ||
14 | that is is OE only. https://github.com/mesonbuild/meson/issues/1849#issuecomment-303730323 | ||
15 | |||
16 | Upstream-Status: Inappropriate [OE specific] | ||
17 | Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | ||
18 | |||
19 | --- | ||
20 | mesonbuild/dependencies/base.py | 19 +++++++++++-------- | ||
21 | mesonbuild/dependencies/ui.py | 6 +++--- | ||
22 | 2 files changed, 14 insertions(+), 11 deletions(-) | ||
23 | |||
24 | diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py | ||
25 | index cd77b4b..7e3f338 100644 | ||
26 | --- a/mesonbuild/dependencies/base.py | ||
27 | +++ b/mesonbuild/dependencies/base.py | ||
28 | @@ -192,7 +192,7 @@ class Dependency: | ||
29 | def get_exe_args(self, compiler): | ||
30 | return [] | ||
31 | |||
32 | - def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str: | ||
33 | + def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str: | ||
34 | raise DependencyException('{!r} is not a pkgconfig dependency'.format(self.name)) | ||
35 | |||
36 | def get_configtool_variable(self, variable_name): | ||
37 | @@ -280,7 +280,7 @@ class InternalDependency(Dependency): | ||
38 | return True | ||
39 | return any(d.is_built() for d in self.ext_deps) | ||
40 | |||
41 | - def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str: | ||
42 | + def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str: | ||
43 | raise DependencyException('Method "get_pkgconfig_variable()" is ' | ||
44 | 'invalid for an internal dependency') | ||
45 | |||
46 | @@ -658,8 +658,11 @@ class PkgConfigDependency(ExternalDependency): | ||
47 | return s.format(self.__class__.__name__, self.name, self.is_found, | ||
48 | self.version_reqs) | ||
49 | |||
50 | - def _call_pkgbin_real(self, args, env): | ||
51 | - cmd = self.pkgbin.get_command() + args | ||
52 | + def _call_pkgbin_real(self, args, env, use_native=False): | ||
53 | + if use_native: | ||
54 | + cmd = [self.pkgbin.get_command()[0] + "-native"] + args | ||
55 | + else: | ||
56 | + cmd = self.pkgbin.get_command() + args | ||
57 | p, out, err = Popen_safe(cmd, env=env) | ||
58 | rc, out, err = p.returncode, out.strip(), err.strip() | ||
59 | call = ' '.join(cmd) | ||
60 | @@ -685,7 +688,7 @@ class PkgConfigDependency(ExternalDependency): | ||
61 | env['PKG_CONFIG_LIBDIR'] = new_pkg_config_libdir | ||
62 | mlog.debug('PKG_CONFIG_LIBDIR: ' + new_pkg_config_libdir) | ||
63 | |||
64 | - def _call_pkgbin(self, args, env=None): | ||
65 | + def _call_pkgbin(self, args, env=None, use_native=False): | ||
66 | # Always copy the environment since we're going to modify it | ||
67 | # with pkg-config variables | ||
68 | if env is None: | ||
69 | @@ -699,7 +702,7 @@ class PkgConfigDependency(ExternalDependency): | ||
70 | targs = tuple(args) | ||
71 | cache = PkgConfigDependency.pkgbin_cache | ||
72 | if (self.pkgbin, targs, fenv) not in cache: | ||
73 | - cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env) | ||
74 | + cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env, use_native) | ||
75 | return cache[(self.pkgbin, targs, fenv)] | ||
76 | |||
77 | def _convert_mingw_paths(self, args: T.List[str]) -> T.List[str]: | ||
78 | @@ -905,7 +908,7 @@ class PkgConfigDependency(ExternalDependency): | ||
79 | (self.name, out_raw)) | ||
80 | self.link_args, self.raw_link_args = self._search_libs(out, out_raw) | ||
81 | |||
82 | - def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str: | ||
83 | + def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str: | ||
84 | options = ['--variable=' + variable_name, self.name] | ||
85 | |||
86 | if 'define_variable' in kwargs: | ||
87 | @@ -918,7 +921,7 @@ class PkgConfigDependency(ExternalDependency): | ||
88 | |||
89 | options = ['--define-variable=' + '='.join(definition)] + options | ||
90 | |||
91 | - ret, out, err = self._call_pkgbin(options) | ||
92 | + ret, out, err = self._call_pkgbin(options, use_native=use_native) | ||
93 | variable = '' | ||
94 | if ret != 0: | ||
95 | if self.required: | ||
96 | diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py | ||
97 | index d897d76..a598d2e 100644 | ||
98 | --- a/mesonbuild/dependencies/ui.py | ||
99 | +++ b/mesonbuild/dependencies/ui.py | ||
100 | @@ -325,7 +325,7 @@ class QtBaseDependency(ExternalDependency): | ||
101 | self.bindir = self.get_pkgconfig_host_bins(core) | ||
102 | if not self.bindir: | ||
103 | # If exec_prefix is not defined, the pkg-config file is broken | ||
104 | - prefix = core.get_pkgconfig_variable('exec_prefix', {}) | ||
105 | + prefix = core.get_pkgconfig_variable('exec_prefix', {}, use_native=True) | ||
106 | if prefix: | ||
107 | self.bindir = os.path.join(prefix, 'bin') | ||
108 | |||
109 | @@ -528,7 +528,7 @@ class Qt4Dependency(QtBaseDependency): | ||
110 | applications = ['moc', 'uic', 'rcc', 'lupdate', 'lrelease'] | ||
111 | for application in applications: | ||
112 | try: | ||
113 | - return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {})) | ||
114 | + return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}, use_native=True)) | ||
115 | except MesonException: | ||
116 | pass | ||
117 | |||
118 | @@ -538,7 +538,7 @@ class Qt5Dependency(QtBaseDependency): | ||
119 | QtBaseDependency.__init__(self, 'qt5', env, kwargs) | ||
120 | |||
121 | def get_pkgconfig_host_bins(self, core): | ||
122 | - return core.get_pkgconfig_variable('host_bins', {}) | ||
123 | + return core.get_pkgconfig_variable('host_bins', {}, use_native=True) | ||
124 | |||
125 | def get_private_includes(self, mod_inc_dir, module): | ||
126 | return _qt_get_private_includes(mod_inc_dir, module, self.version) | ||