net-misc/rustdesk: update deps
[gentoo-zh.git] / app-i18n / mozc / files / mozc-2.26.4220-system_abseil-cpp.patch
blobda6b40265804fe6bc74d309e07f7b61e3c4663bd
1 https://github.com/google/mozc/issues/490
3 --- a/src/base/absl.gyp
4 +++ b/src/base/absl.gyp
5 @@ -28,119 +28,209 @@
6 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 - 'variables': {
10 - 'absl_srcdir': '<(DEPTH)/third_party/abseil-cpp/absl',
11 - 'gen_absl_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/abseil-cpp/absl',
12 - },
13 + 'conditions': [
14 + ['use_system_abseil_cpp==0', {
15 + 'variables': {
16 + 'absl_srcdir': '<(DEPTH)/third_party/abseil-cpp/absl',
17 + 'gen_absl_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/abseil-cpp/absl',
18 + },
19 + }],
20 + ],
21 'targets': [
23 'target_name': 'absl_base',
24 - 'type': 'static_library',
25 'toolsets': ['host', 'target'],
26 - 'sources': [
27 - '<(absl_srcdir)/base/internal/cycleclock.cc',
28 - '<(absl_srcdir)/base/internal/low_level_alloc.cc',
29 - '<(absl_srcdir)/base/internal/raw_logging.cc',
30 - '<(absl_srcdir)/base/internal/spinlock.cc',
31 - '<(absl_srcdir)/base/internal/spinlock_wait.cc',
32 - '<(absl_srcdir)/base/internal/sysinfo.cc',
33 - '<(absl_srcdir)/base/internal/thread_identity.cc',
34 - '<(absl_srcdir)/base/internal/throw_delegate.cc',
35 - '<(absl_srcdir)/base/internal/unscaledcycleclock.cc',
36 - '<(absl_srcdir)/container/internal/raw_hash_set.cc',
37 - '<(absl_srcdir)/hash/internal/city.cc',
38 - '<(absl_srcdir)/hash/internal/hash.cc',
39 - ],
40 - 'msvs_disabled_warnings': [
41 - # 'type' : forcing value to bool 'true' or 'false'
42 - # (performance warning)
43 - # http://msdn.microsoft.com/en-us/library/b6801kcy.aspx
44 - '4800',
45 + 'conditions': [
46 + ['use_system_abseil_cpp==1', {
47 + 'type': 'none',
48 + 'all_dependent_settings': {
49 + 'link_settings': {
50 + 'libraries': [
51 + '-labsl_base -labsl_city -labsl_hash -labsl_malloc_internal -labsl_raw_hash_set -labsl_raw_logging_internal -labsl_spinlock_wait -labsl_throw_delegate',
52 + ],
53 + },
54 + },
55 + }, {
56 + 'type': 'static_library',
57 + 'sources': [
58 + # libabsl_base
59 + '<(absl_srcdir)/base/internal/cycleclock.cc',
60 + # libabsl_malloc_internal
61 + '<(absl_srcdir)/base/internal/low_level_alloc.cc',
62 + # libabsl_raw_logging_internal
63 + '<(absl_srcdir)/base/internal/raw_logging.cc',
64 + # libabsl_base
65 + '<(absl_srcdir)/base/internal/spinlock.cc',
66 + # libabsl_spinlock_wait
67 + '<(absl_srcdir)/base/internal/spinlock_wait.cc',
68 + # libabsl_base
69 + '<(absl_srcdir)/base/internal/sysinfo.cc',
70 + '<(absl_srcdir)/base/internal/thread_identity.cc',
71 + # libabsl_throw_delegate
72 + '<(absl_srcdir)/base/internal/throw_delegate.cc',
73 + # libabsl_base
74 + '<(absl_srcdir)/base/internal/unscaledcycleclock.cc',
75 + # libabsl_raw_hash_set
76 + '<(absl_srcdir)/container/internal/raw_hash_set.cc',
77 + # libabsl_city
78 + '<(absl_srcdir)/hash/internal/city.cc',
79 + # libabsl_hash
80 + '<(absl_srcdir)/hash/internal/hash.cc',
81 + ],
82 + 'msvs_disabled_warnings': [
83 + # 'type' : forcing value to bool 'true' or 'false'
84 + # (performance warning)
85 + # http://msdn.microsoft.com/en-us/library/b6801kcy.aspx
86 + '4800',
87 + ],
88 + }],
92 'target_name': 'absl_numeric',
93 - 'type': 'static_library',
94 'toolsets': ['host', 'target'],
95 - 'sources': [
96 - '<(absl_srcdir)/numeric/int128.cc',
97 - ],
98 - 'dependencies': [
99 - 'absl_base',
100 + 'conditions': [
101 + ['use_system_abseil_cpp==1', {
102 + 'type': 'none',
103 + 'all_dependent_settings': {
104 + 'link_settings': {
105 + 'libraries': [
106 + '-labsl_int128',
107 + ],
108 + },
109 + },
110 + }, {
111 + 'type': 'static_library',
112 + 'sources': [
113 + # libabsl_int128
114 + '<(absl_srcdir)/numeric/int128.cc',
115 + ],
116 + 'dependencies': [
117 + 'absl_base',
118 + ],
119 + }],
123 'target_name': 'absl_strings_internal',
124 - 'type': 'static_library',
125 'toolsets': ['host', 'target'],
126 - 'sources': [
127 - '<(absl_srcdir)/strings/internal/charconv_bigint.cc',
128 - '<(absl_srcdir)/strings/internal/charconv_parse.cc',
129 - '<(absl_srcdir)/strings/internal/escaping.cc',
130 - '<(absl_srcdir)/strings/internal/memutil.cc',
131 - '<(absl_srcdir)/strings/internal/str_format/arg.cc',
132 - '<(absl_srcdir)/strings/internal/str_format/bind.cc',
133 - '<(absl_srcdir)/strings/internal/str_format/extension.cc',
134 - '<(absl_srcdir)/strings/internal/str_format/float_conversion.cc',
135 - '<(absl_srcdir)/strings/internal/str_format/output.cc',
136 - '<(absl_srcdir)/strings/internal/str_format/parser.cc',
137 - '<(absl_srcdir)/strings/internal/utf8.cc',
138 - ],
139 - 'dependencies': [
140 - 'absl_base',
141 - 'absl_numeric',
142 + 'conditions': [
143 + ['use_system_abseil_cpp==1', {
144 + 'type': 'none',
145 + 'all_dependent_settings': {
146 + 'link_settings': {
147 + 'libraries': [
148 + '-labsl_strings_internal',
149 + ],
150 + },
151 + },
152 + }, {
153 + 'type': 'static_library',
154 + 'sources': [
155 + # libabsl_strings
156 + '<(absl_srcdir)/strings/internal/charconv_bigint.cc',
157 + '<(absl_srcdir)/strings/internal/charconv_parse.cc',
158 + # libabsl_strings_internal
159 + '<(absl_srcdir)/strings/internal/escaping.cc',
160 + # libabsl_strings
161 + '<(absl_srcdir)/strings/internal/memutil.cc',
162 + # libabsl_str_format_internal
163 + '<(absl_srcdir)/strings/internal/str_format/arg.cc',
164 + '<(absl_srcdir)/strings/internal/str_format/bind.cc',
165 + '<(absl_srcdir)/strings/internal/str_format/extension.cc',
166 + '<(absl_srcdir)/strings/internal/str_format/float_conversion.cc',
167 + '<(absl_srcdir)/strings/internal/str_format/output.cc',
168 + '<(absl_srcdir)/strings/internal/str_format/parser.cc',
169 + # libabsl_strings_internal
170 + '<(absl_srcdir)/strings/internal/utf8.cc',
171 + ],
172 + 'dependencies': [
173 + 'absl_base',
174 + 'absl_numeric',
175 + ],
176 + }],
180 'target_name': 'absl_strings',
181 - 'type': 'static_library',
182 'toolsets': ['host', 'target'],
183 - 'sources': [
184 - '<(absl_srcdir)/strings/ascii.cc',
185 - '<(absl_srcdir)/strings/charconv.cc',
186 - '<(absl_srcdir)/strings/escaping.cc',
187 - '<(absl_srcdir)/strings/match.cc',
188 - '<(absl_srcdir)/strings/numbers.cc',
189 - '<(absl_srcdir)/strings/str_cat.cc',
190 - '<(absl_srcdir)/strings/str_replace.cc',
191 - '<(absl_srcdir)/strings/str_split.cc',
192 - '<(absl_srcdir)/strings/string_view.cc',
193 - '<(absl_srcdir)/strings/substitute.cc',
194 - ],
195 - 'dependencies': [
196 - 'absl_base',
197 - 'absl_numeric',
198 - 'absl_strings_internal',
199 + 'conditions': [
200 + ['use_system_abseil_cpp==1', {
201 + 'type': 'none',
202 + 'all_dependent_settings': {
203 + 'link_settings': {
204 + 'libraries': [
205 + '-labsl_str_format_internal -labsl_strings -labsl_strings_internal',
206 + ],
207 + },
208 + },
209 + }, {
210 + 'type': 'static_library',
211 + 'sources': [
212 + # libabsl_strings
213 + '<(absl_srcdir)/strings/ascii.cc',
214 + '<(absl_srcdir)/strings/charconv.cc',
215 + '<(absl_srcdir)/strings/escaping.cc',
216 + '<(absl_srcdir)/strings/match.cc',
217 + '<(absl_srcdir)/strings/numbers.cc',
218 + '<(absl_srcdir)/strings/str_cat.cc',
219 + '<(absl_srcdir)/strings/str_replace.cc',
220 + '<(absl_srcdir)/strings/str_split.cc',
221 + '<(absl_srcdir)/strings/string_view.cc',
222 + '<(absl_srcdir)/strings/substitute.cc',
223 + ],
224 + 'dependencies': [
225 + 'absl_base',
226 + 'absl_numeric',
227 + 'absl_strings_internal',
228 + ],
229 + }],
233 'target_name': 'absl_time',
234 - 'type': 'static_library',
235 'toolsets': ['host', 'target'],
236 - 'sources': [
237 - '<(absl_srcdir)/time/civil_time.cc',
238 - '<(absl_srcdir)/time/clock.cc',
239 - '<(absl_srcdir)/time/duration.cc',
240 - '<(absl_srcdir)/time/format.cc',
241 - '<(absl_srcdir)/time/time.cc',
242 - '<(absl_srcdir)/time/internal/cctz/src/civil_time_detail.cc',
243 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_fixed.cc',
244 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_format.cc',
245 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_if.cc',
246 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_impl.cc',
247 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_info.cc',
248 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_libc.cc',
249 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_lookup.cc',
250 - '<(absl_srcdir)/time/internal/cctz/src/time_zone_posix.cc',
251 - '<(absl_srcdir)/time/internal/cctz/src/zone_info_source.cc',
252 - ],
253 - 'cflags': [
254 - '-Wno-error',
255 - ],
256 - 'dependencies': [
257 - 'absl_base',
258 - 'absl_numeric',
259 - 'absl_strings_internal',
260 + 'conditions': [
261 + ['use_system_abseil_cpp==1', {
262 + 'type': 'none',
263 + 'all_dependent_settings': {
264 + 'link_settings': {
265 + 'libraries': [
266 + '-labsl_civil_time -labsl_time -labsl_time_zone',
267 + ],
268 + },
269 + },
270 + }, {
271 + 'type': 'static_library',
272 + 'sources': [
273 + # libabsl_time
274 + '<(absl_srcdir)/time/civil_time.cc',
275 + '<(absl_srcdir)/time/clock.cc',
276 + '<(absl_srcdir)/time/duration.cc',
277 + '<(absl_srcdir)/time/format.cc',
278 + '<(absl_srcdir)/time/time.cc',
279 + # libabsl_civil_time
280 + '<(absl_srcdir)/time/internal/cctz/src/civil_time_detail.cc',
281 + # libabsl_time_zone
282 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_fixed.cc',
283 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_format.cc',
284 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_if.cc',
285 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_impl.cc',
286 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_info.cc',
287 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_libc.cc',
288 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_lookup.cc',
289 + '<(absl_srcdir)/time/internal/cctz/src/time_zone_posix.cc',
290 + '<(absl_srcdir)/time/internal/cctz/src/zone_info_source.cc',
291 + ],
292 + 'cflags': [
293 + '-Wno-error',
294 + ],
295 + 'dependencies': [
296 + 'absl_base',
297 + 'absl_numeric',
298 + 'absl_strings_internal',
299 + ],
300 + }],
304 --- a/src/config/config_test.gyp
305 +++ b/src/config/config_test.gyp
306 @@ -36,6 +36,7 @@
307 'config_handler_test.cc',
309 'dependencies': [
310 + '../base/absl.gyp:absl_base',
311 '../testing/testing.gyp:gtest_main',
312 '../testing/testing.gyp:mozctest',
313 'config.gyp:config_handler',
314 @@ -80,6 +81,7 @@
315 'character_form_manager_test.cc',
317 'dependencies': [
318 + '../base/absl.gyp:absl_base',
319 '../testing/testing.gyp:gtest_main',
320 'config.gyp:character_form_manager',
322 --- a/src/gyp/common.gypi
323 +++ b/src/gyp/common.gypi
324 @@ -194,7 +194,13 @@
325 'include_dirs': [
326 '<(abs_depth)',
327 '<(SHARED_INTERMEDIATE_DIR)',
328 - '<(absl_dir)',
329 + ],
330 + 'conditions': [
331 + ['use_system_abseil_cpp==0', {
332 + 'include_dirs': [
333 + '<(absl_dir)',
334 + ],
335 + }],
337 'mac_framework_headers': [],
338 'target_conditions': [
339 --- a/src/gyp/common_win.gypi
340 +++ b/src/gyp/common_win.gypi
341 @@ -307,10 +307,16 @@
342 'include_dirs': [
343 '<(abs_depth)',
344 '<(SHARED_INTERMEDIATE_DIR)',
345 - '<(absl_dir)',
346 '<@(msvs_includes)',
347 '<(wtl_dir)/include',
349 + 'conditions': [
350 + ['use_system_abseil_cpp==0', {
351 + 'include_dirs': [
352 + '<(absl_dir)',
353 + ],
354 + }],
355 + ],
356 'msvs_configuration_attributes': {
357 'CharacterSet': '<(win_char_set_unicode)',
359 --- a/src/gyp/defines.gypi
360 +++ b/src/gyp/defines.gypi
361 @@ -63,6 +63,10 @@
362 # use_libibus represents if ibus library is used or not.
363 # This option is only for Linux.
364 'use_libibus%': '0',
366 + # use_system_abseil_cpp represents if system version or bundled version
367 + # of abseil-cpp library is used.
368 + 'use_system_abseil_cpp%': '0',
370 'target_defaults': {
371 'defines': [
372 --- a/src/gyp/directories.gypi
373 +++ b/src/gyp/directories.gypi
374 @@ -31,7 +31,12 @@
375 'variables': {
376 # Top directory of third party libraries.
377 'third_party_dir': '<(DEPTH)/third_party',
378 - 'absl_dir': '<(DEPTH)/third_party/abseil-cpp',
380 + 'conditions': [
381 + ['use_system_abseil_cpp==0', {
382 + 'absl_dir': '<(DEPTH)/third_party/abseil-cpp',
383 + }],
384 + ],
386 # Top directory of additional third party libraries.
387 'ext_third_party_dir%': '<(abs_depth)/third_party',
388 --- a/src/session/session_test.gyp
389 +++ b/src/session/session_test.gyp
390 @@ -221,6 +221,7 @@
391 'internal/key_event_transformer_test.cc',
393 'dependencies': [
394 + '../base/absl.gyp:absl_base',
395 '../base/base.gyp:base',
396 '../converter/converter_base.gyp:converter_mock',
397 '../engine/engine.gyp:mock_converter_engine',
398 --- a/src/storage/storage_test.gyp
399 +++ b/src/storage/storage_test.gyp
400 @@ -41,6 +41,7 @@
401 'tiny_storage_test.cc',
403 'dependencies': [
404 + '../base/absl.gyp:absl_base',
405 '../testing/testing.gyp:gtest_main',
406 'storage.gyp:storage',