Update patches/support-kfreebsd.patch
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Nobuhiro Iwamatsu
12 years ago
0 | Description: Support kfreebsd | |
1 | Forwarded: none | |
2 | Author: Nobuhiro iwamatsu <iwamatsut@debian.org> | |
3 | Last-Update: 2011-10-04 | |
4 | ||
5 | diff --git a/base/const.h b/base/const.h | |
6 | index 8e986f9..0a5b5b2 100755 | |
7 | --- a/base/const.h | |
8 | +++ b/base/const.h | |
9 | @@ -125,7 +125,7 @@ const char kEventPathPrefix[] = "GoogleJapaneseInput.event."; | |
10 | #else | |
11 | const char kEventPathPrefix[] = "Mozc.event."; | |
12 | #endif // GOOGLE_JAPANESE_INPUT_BUILD | |
13 | -#else // OS_LINUX | |
14 | +#else // OS_LINUX || OS_GNU_KFREEBSD || OS_FREEBSD | |
15 | const char kMozcServerName[] = "mozc_server"; | |
16 | const char kEventPathPrefix[] = "mozc.event."; | |
17 | const char kMozcTool[] = "mozc_tool"; | |
18 | 0 | diff --git a/base/cpu_stats.cc b/base/cpu_stats.cc |
19 | 1 | index ef7ee3d..59094d9 100755 |
20 | 2 | --- a/base/cpu_stats.cc |
176 | 158 | const string arg = "--mode=error_message_dialog --error_type=" + error_type; |
177 | 159 | size_t pid = 0; |
178 | 160 | diff --git a/base/run_level.cc b/base/run_level.cc |
179 | index a7a085b..4900924 100755 | |
161 | index cd7a42b..b82354b 100755 | |
180 | 162 | --- a/base/run_level.cc |
181 | 163 | +++ b/base/run_level.cc |
182 | 164 | @@ -38,7 +38,7 @@ |
237 | 219 | |
238 | 220 | // OSX doesn't support Thread Local Storage. |
239 | 221 | diff --git a/base/util.cc b/base/util.cc |
240 | index 5a8fd7e..7386131 100755 | |
222 | index 484cd63..d44e002 100755 | |
241 | 223 | --- a/base/util.cc |
242 | 224 | +++ b/base/util.cc |
243 | @@ -2540,7 +2540,7 @@ string Util::GetServerDirectory() { | |
225 | @@ -2592,7 +2592,7 @@ string Util::GetServerDirectory() { | |
244 | 226 | return MacUtil::GetServerDirectory(); |
245 | 227 | #endif // OS_MACOSX |
246 | 228 | |
249 | 231 | return "/usr/lib/mozc"; |
250 | 232 | #endif // OS_LINUX |
251 | 233 | } |
252 | @@ -2628,7 +2628,7 @@ string GetObjectNameAsString(HANDLE handle) { | |
234 | @@ -2671,7 +2671,7 @@ string GetObjectNameAsString(HANDLE handle) { | |
253 | 235 | #endif |
254 | 236 | |
255 | 237 | string Util::GetDesktopNameAsString() { |
258 | 240 | const char *display = getenv("DISPLAY"); |
259 | 241 | if (display == NULL) { |
260 | 242 | return ""; |
261 | @@ -3105,7 +3105,7 @@ bool Util::IsPlatformSupported() { | |
243 | @@ -3167,7 +3167,7 @@ bool Util::IsPlatformSupported() { | |
262 | 244 | #if defined(OS_MACOSX) |
263 | 245 | // TODO(yukawa): support Mac. |
264 | 246 | return true; |
267 | 249 | // TODO(yukawa): support Linux. |
268 | 250 | return true; |
269 | 251 | #elif defined(OS_WINDOWS) |
270 | @@ -3525,18 +3525,19 @@ string Util::GetOSVersionString() { | |
252 | @@ -3587,18 +3587,19 @@ string Util::GetOSVersionString() { | |
271 | 253 | } else { |
272 | 254 | LOG(WARNING) << "GetVersionEx failed"; |
273 | 255 | } |
291 | 273 | } |
292 | 274 | |
293 | 275 | void Util::DisableIME() { |
294 | @@ -3570,7 +3571,7 @@ uint64 Util::GetTotalPhysicalMemory() { | |
276 | @@ -3632,7 +3633,7 @@ uint64 Util::GetTotalPhysicalMemory() { | |
295 | 277 | return 0; |
296 | 278 | } |
297 | 279 | return total_memory; |
300 | 282 | #if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) |
301 | 283 | const long page_size = sysconf(_SC_PAGESIZE); |
302 | 284 | const long number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES); |
303 | @@ -3596,7 +3597,7 @@ void Util::PreloadMappedRegion(const void *begin, | |
285 | @@ -3658,7 +3659,7 @@ void Util::PreloadMappedRegion(const void *begin, | |
304 | 286 | ::ZeroMemory(&system_info, sizeof(system_info)); |
305 | 287 | ::GetSystemInfo(&system_info); |
306 | 288 | const size_t page_size = system_info.dwPageSize; |
310 | 292 | const size_t page_size = sysconf(_SC_PAGESIZE); |
311 | 293 | #else |
312 | 294 | diff --git a/build_mozc.py b/build_mozc.py |
313 | index 6981e6a..ea56ff0 100755 | |
295 | index a08f8c5..5adcbfa 100755 | |
314 | 296 | --- a/build_mozc.py |
315 | 297 | +++ b/build_mozc.py |
316 | 298 | @@ -72,6 +72,14 @@ def IsLinux(): |
346 | 328 | else: |
347 | 329 | logging.error('Unsupported platform: %s', os.name) |
348 | 330 | |
349 | @@ -198,7 +208,7 @@ def GetGypFileNames(options): | |
331 | @@ -205,7 +215,7 @@ def GetGypFileNames(options): | |
350 | 332 | if IsWindows(): |
351 | 333 | gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR)) |
352 | 334 | gyp_file_names.extend(glob.glob('third_party/breakpad/*.gyp')) |
355 | 337 | gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR)) |
356 | 338 | # Add ibus.gyp if ibus is installed. |
357 | 339 | # Ubuntu 8.04 (Hardy) does not contain ibus package. |
358 | @@ -349,6 +359,7 @@ def AddCommonOptions(parser): | |
359 | # should be done. If you want ChromeOS build, specify "ChromeOS". | |
360 | parser.add_option('--target_platform', dest='target_platform', default='', | |
340 | @@ -362,6 +372,7 @@ def AddCommonOptions(parser): | |
361 | 341 | help='If you want ChromeOS build, specify "ChromeOS"') |
342 | parser.add_option('--language', dest='language', default='japanese', | |
343 | help='Specify the target language to build.') | |
362 | 344 | + parser.add_option('--os', dest='os', default='linux') |
363 | 345 | return parser |
364 | 346 | |
365 | 347 | |
366 | @@ -429,7 +440,7 @@ def ExpandMetaTarget(meta_target_name, target_platform): | |
348 | @@ -459,7 +470,7 @@ def ExpandMetaTarget(meta_target_name, target_platform): | |
367 | 349 | targets = ['%s/unix/ibus/ibus.gyp:ibus_mozc', |
368 | 350 | '%s/server/server.gyp:mozc_server', |
369 | 351 | '%s/gui/gui.gyp:mozc_tool'] |
372 | 354 | targets = ['%s/unix/ibus/ibus.gyp:ibus_mozc', |
373 | 355 | '%s/server/server.gyp:mozc_server', |
374 | 356 | '%s/gui/gui.gyp:mozc_tool'] |
375 | @@ -547,6 +558,9 @@ def GypMain(options, unused_args): | |
376 | if options.coverage: | |
377 | command_line.extend(['-D', 'coverage=1']) | |
357 | @@ -579,6 +590,9 @@ def GypMain(options, unused_args): | |
358 | else: | |
359 | command_line.extend(['-D', 'use_wix=NO']) | |
378 | 360 | |
379 | 361 | + if options.os: |
380 | 362 | + command_line.extend(['-D', 'OS=%s' % options.os]) |
381 | 363 | + |
382 | 364 | command_line.extend(['-D', 'build_base=%s' % GetBuildBaseName(options)]) |
383 | 365 | |
384 | # Check the version and determine if the building version is dev-channel or | |
385 | @@ -577,7 +591,7 @@ def GypMain(options, unused_args): | |
366 | ||
367 | @@ -616,7 +630,7 @@ def GypMain(options, unused_args): | |
386 | 368 | # command for pkg-config. Here we catch the environment variable |
387 | 369 | # and use the specified command instead of actual pkg-config |
388 | 370 | # command. |
391 | 373 | command_line.extend(['-D', 'pkg_config_command=%s' % GetPkgConfigCommand()]) |
392 | 374 | else: |
393 | 375 | command_line.extend(['-D', 'pkg_config_command=']) |
394 | @@ -662,6 +676,42 @@ def BuildOnLinux(options, targets, unused_original_directory_name): | |
376 | @@ -714,6 +728,42 @@ def BuildOnLinux(options, targets, unused_original_directory_name): | |
395 | 377 | |
396 | 378 | RunOrDie([make_command] + build_args + target_names) |
397 | 379 | |
434 | 416 | |
435 | 417 | def CheckFileOrDie(file_name): |
436 | 418 | """Check the file exists or dies if not.""" |
437 | @@ -777,6 +827,8 @@ def BuildMain(options, targets, original_directory_name): | |
419 | @@ -877,6 +927,8 @@ def BuildMain(options, targets, original_directory_name): | |
438 | 420 | BuildOnMac(options, targets, original_directory_name) |
439 | 421 | elif IsLinux(): |
440 | 422 | BuildOnLinux(options, targets, original_directory_name) |
443 | 425 | elif IsWindows(): |
444 | 426 | BuildOnWindows(options, targets, original_directory_name) |
445 | 427 | else: |
446 | @@ -900,7 +952,7 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
428 | @@ -1000,7 +1052,7 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
447 | 429 | elif IsMac(): |
448 | 430 | directory_names.extend(glob.glob(os.path.join(gyp_directory_name, |
449 | 431 | '*.xcodeproj'))) |
452 | 434 | file_names.extend(glob.glob(os.path.join(gyp_directory_name, |
453 | 435 | '*.target.mk'))) |
454 | 436 | file_names.extend(glob.glob(os.path.join(gyp_directory_name, |
455 | @@ -919,6 +971,10 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
437 | @@ -1019,6 +1071,10 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
456 | 438 | file_names.append('Makefile') |
457 | 439 | elif IsWindows(): |
458 | 440 | file_names.append('third_party/breakpad/breakpad.gyp') |
463 | 445 | # Remove files. |
464 | 446 | for file_name in file_names: |
465 | 447 | RemoveFile(file_name) |
466 | @@ -945,7 +1001,6 @@ def ShowHelpAndExit(): | |
448 | @@ -1045,7 +1101,6 @@ def ShowHelpAndExit(): | |
467 | 449 | print 'See also the comment in the script for typical usage.' |
468 | 450 | sys.exit(1) |
469 | 451 | |
527 | 509 | // Even if the locale is not English nor Japanese, load translation |
528 | 510 | // file to translate common messages like "OK" and "Cancel". |
529 | 511 | diff --git a/gui/config_dialog/config_dialog.cc b/gui/config_dialog/config_dialog.cc |
530 | index f358636..7005dae 100755 | |
512 | index 5aee977..4df1942 100755 | |
531 | 513 | --- a/gui/config_dialog/config_dialog.cc |
532 | 514 | +++ b/gui/config_dialog/config_dialog.cc |
533 | @@ -74,11 +74,11 @@ ConfigDialog::ConfigDialog() | |
515 | @@ -73,11 +73,11 @@ ConfigDialog::ConfigDialog() | |
534 | 516 | verboseLevelLabel->setVisible(false); |
535 | 517 | verboseLevelComboBox->setVisible(false); |
536 | 518 | |
537 | 519 | -#if defined(OS_MACOSX) || defined(OS_LINUX) |
538 | 520 | +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) |
539 | 521 | // The last "misc" tab has no valid configs on Mac and Linux |
540 | const int kMiscTabIndex = 5; | |
522 | const int kMiscTabIndex = 6; | |
541 | 523 | configDialogTabWidget->removeTab(kMiscTabIndex); |
542 | 524 | -#endif // OS_MACOSX || OS_LINUX |
543 | +#endif // OS_MACOSX || OS_LINUX || OS_GNU_KFREEBSD || OS_FREEBSD) | |
525 | +#endif // OS_MACOSX || OS_LINUX || OS_GNU_KFREEBSD || OS_FREEBSD | |
544 | 526 | #endif // NO_LOGGING |
545 | 527 | |
546 | client_->set_restricted(true); // start with restricted mode | |
547 | @@ -261,7 +261,7 @@ ConfigDialog::ConfigDialog() | |
528 | #if !defined(GOOGLE_JAPANESE_INPUT_BUILD) | |
529 | @@ -277,7 +277,7 @@ ConfigDialog::ConfigDialog() | |
548 | 530 | dictionaryPreloadingAndUACLabel->setVisible(false); |
549 | 531 | #endif // OS_WINDOWS |
550 | 532 | |
553 | 535 | // On Linux, disable all fields for UsageStats |
554 | 536 | usageStatsLabel->setEnabled(false); |
555 | 537 | usageStatsLabel->setVisible(false); |
556 | @@ -346,7 +346,7 @@ bool ConfigDialog::Update() { | |
538 | @@ -364,7 +364,7 @@ bool ConfigDialog::Update() { | |
557 | 539 | } |
558 | 540 | |
559 | 541 | |
598 | 580 | this, |
599 | 581 | tr("Mozc settings"), |
600 | 582 | diff --git a/gui/dictionary_tool/dictionary_tool.cc b/gui/dictionary_tool/dictionary_tool.cc |
601 | index 0fd9a4f..77c5cf8 100755 | |
583 | index b66f13e..20c3461 100755 | |
602 | 584 | --- a/gui/dictionary_tool/dictionary_tool.cc |
603 | 585 | +++ b/gui/dictionary_tool/dictionary_tool.cc |
604 | @@ -316,7 +316,7 @@ DictionaryTool::DictionaryTool(QWidget *parent) | |
586 | @@ -317,7 +317,7 @@ DictionaryTool::DictionaryTool(QWidget *parent) | |
605 | 587 | } |
606 | 588 | |
607 | 589 | // main window |
611 | 593 | // TODO(taku): investigate the cause of the crashes |
612 | 594 | setCentralWidget(splitter_); |
613 | 595 | diff --git a/gui/gui.gyp b/gui/gui.gyp |
614 | index 96f8b33..7034d0b 100755 | |
596 | index 37e4e44..bef1334 100755 | |
615 | 597 | --- a/gui/gui.gyp |
616 | 598 | +++ b/gui/gui.gyp |
617 | @@ -372,7 +372,7 @@ | |
599 | @@ -378,7 +378,7 @@ | |
618 | 600 | 'includes': [ |
619 | 601 | 'qt_libraries.gypi', |
620 | 602 | ], |
650 | 632 | ['use_libzinnia==1', { |
651 | 633 | 'link_settings': { |
652 | 634 | diff --git a/gyp/common.gypi b/gyp/common.gypi |
653 | index e9bc954..58f0f1d 100755 | |
635 | index 551f8bd..c0e0a5f 100755 | |
654 | 636 | --- a/gyp/common.gypi |
655 | 637 | +++ b/gyp/common.gypi |
656 | @@ -233,7 +233,7 @@ | |
638 | @@ -238,7 +238,7 @@ | |
657 | 639 | }, |
658 | 640 | }, |
659 | 641 | 'conditions': [ |
662 | 644 | 'cflags': [ |
663 | 645 | '<@(debug_extra_cflags)', |
664 | 646 | ], |
665 | @@ -272,7 +272,7 @@ | |
647 | @@ -277,7 +277,7 @@ | |
666 | 648 | }, |
667 | 649 | }, |
668 | 650 | 'conditions': [ |
671 | 653 | 'cflags': [ |
672 | 654 | '<@(release_extra_cflags)', |
673 | 655 | ], |
674 | @@ -523,6 +523,51 @@ | |
656 | @@ -532,6 +532,51 @@ | |
675 | 657 | }], |
676 | 658 | ], |
677 | 659 | }], |
723 | 705 | ['OS=="mac"', { |
724 | 706 | 'defines': [ |
725 | 707 | 'OS_MACOSX', |
726 | @@ -577,7 +622,7 @@ | |
708 | @@ -586,7 +631,7 @@ | |
727 | 709 | # Linux gyp (into scons) doesn't like target_conditions? |
728 | 710 | # TODO(team): track down why 'target_conditions' doesn't work |
729 | 711 | # on Linux gyp into scons like it does on Mac gyp into xcodeproj. |
733 | 715 | '-fprofile-arcs' ], |
734 | 716 | 'link_settings': { 'libraries': [ '-lgcov' ] }, |
735 | 717 | diff --git a/ipc/ipc_path_manager.cc b/ipc/ipc_path_manager.cc |
736 | index da0fa0c..2c9590c 100755 | |
718 | index db5b5d7..ab4091b 100755 | |
737 | 719 | --- a/ipc/ipc_path_manager.cc |
738 | 720 | +++ b/ipc/ipc_path_manager.cc |
739 | @@ -265,7 +265,7 @@ bool IPCPathManager::GetPathName(string *ipc_name) { | |
721 | @@ -274,7 +274,7 @@ bool IPCPathManager::GetPathName(string *ipc_name) { | |
740 | 722 | *ipc_name = kIPCPrefix; |
741 | 723 | #endif // OS_WINDOWS |
742 | 724 | |
745 | 727 | // On Linux, use abstract namespace which is independent of the file system. |
746 | 728 | (*ipc_name)[0] = '\0'; |
747 | 729 | #endif |
748 | @@ -358,7 +358,7 @@ bool IPCPathManager::IsValidServer(uint32 pid, | |
730 | @@ -367,7 +367,7 @@ bool IPCPathManager::IsValidServer(uint32 pid, | |
749 | 731 | } |
750 | 732 | #endif |
751 | 733 | |
754 | 736 | // load from /proc/<pid>/exe |
755 | 737 | char proc[128]; |
756 | 738 | char filename[512]; |
757 | @@ -378,7 +378,7 @@ bool IPCPathManager::IsValidServer(uint32 pid, | |
739 | @@ -387,7 +387,7 @@ bool IPCPathManager::IsValidServer(uint32 pid, | |
758 | 740 | return true; |
759 | 741 | } |
760 | 742 | |
764 | 746 | LOG(WARNING) << server_path << " on disk is modified"; |
765 | 747 | // If a user updates the server binary on disk during the server is running, |
766 | 748 | diff --git a/ipc/ipc_path_manager_test.cc b/ipc/ipc_path_manager_test.cc |
767 | index a645563..0f79c70 100755 | |
749 | index 82cea4a..4b24fb8 100755 | |
768 | 750 | --- a/ipc/ipc_path_manager_test.cc |
769 | 751 | +++ b/ipc/ipc_path_manager_test.cc |
770 | @@ -92,7 +92,7 @@ TEST(IPCPathManagerTest, IPCPathManagerTest) { | |
752 | @@ -108,7 +108,7 @@ TEST_F(IPCPathManagerTest, IPCPathManagerTest) { | |
771 | 753 | EXPECT_FALSE(manager->GetServerProductVersion().empty()); |
772 | 754 | EXPECT_GT(manager->GetServerProcessId(), 0); |
773 | 755 | EXPECT_EQ(t.path(), path); |
869 | 851 | '../gyp/install_build_tool.gypi', |
870 | 852 | ], |
871 | 853 | diff --git a/session/session_converter_interface.h b/session/session_converter_interface.h |
872 | index 7f27398..da6c9cf 100755 | |
854 | index be5bf45..c6cc2d0 100755 | |
873 | 855 | --- a/session/session_converter_interface.h |
874 | 856 | +++ b/session/session_converter_interface.h |
875 | 857 | @@ -56,7 +56,7 @@ struct OperationPreferences { |
882 | 864 | use_cascading_window = false; |
883 | 865 | #else |
884 | 866 | diff --git a/session/session_test.cc b/session/session_test.cc |
885 | index 4433081..4cdf7e9 100755 | |
867 | index ff8fece..1153dff 100755 | |
886 | 868 | --- a/session/session_test.cc |
887 | 869 | +++ b/session/session_test.cc |
888 | @@ -2081,7 +2081,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
870 | @@ -2089,7 +2089,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
889 | 871 | |
890 | 872 | EXPECT_EQ(0, output.all_candidate_words().focused_index()); |
891 | 873 | EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category()); |
894 | 876 | // Cascading window is not supported on Linux, so the size of |
895 | 877 | // candidate words is different from other platform. |
896 | 878 | // TODO(komatsu): Modify the client for Linux to explicitly change |
897 | @@ -2109,7 +2109,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
879 | @@ -2117,7 +2117,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
898 | 880 | |
899 | 881 | EXPECT_EQ(1, output.all_candidate_words().focused_index()); |
900 | 882 | EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category()); |