Install emacs or emacs-plus and prerequisite software by brew
$ brew install emacs
$ brew install ninja
$ git clone https://github.com/google/mozc.git -b master --single-branch --recursive
$ cd mozc && git show HASH
f5dcadf0dee0382612398965adc2c110ef027d9c
$
$ git diff
diff --git a/src/build_mozc.py b/src/build_mozc.py
index a56aaaf..d419f49 100644
--- a/src/build_mozc.py
+++ b/src/build_mozc.py
@@ -167,6 +167,8 @@ def GetGypFileNames(options):
# Include subdirectory of win32 and breakpad for Windows
if options.target_platform == 'Windows':
gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR))
+ elif options.target_platform == 'Mac':
+ gyp_file_names.extend(glob.glob('%s/unix/emacs/*.gyp' % SRC_DIR))
elif options.target_platform == 'Linux':
gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR))
# Add ibus.gyp if ibus version is >=1.4.1.
diff --git a/src/mac/mac.gyp b/src/mac/mac.gyp
index 76b540d..2ee4006 100644
--- a/src/mac/mac.gyp
+++ b/src/mac/mac.gyp
@@ -586,7 +586,6 @@
['branding=="GoogleJapaneseInput"', {
'dependencies': [
'DevConfirmPane',
- 'codesign_client',
],
}],
],
$ cd src
$ GYP_DEFINES="mac_sdk=10.12 mac_deployment_target=10.12" python build_mozc.py gyp --noqt --branding=GoogleJapaneseInput
$ python build_mozc.py build -c Release unix/emacs/emacs.gyp:mozc_emacs_helper
$ echo -e '(0 CreateSession)\n(1 SendKey 1 hiragana)\n(2 SendKey 1 hiragana)\n(3 SendKey 1 97)' | out_mac/Release/mozc_emacs_helper
((mozc-emacs-helper . t)(version . "2.19.2643.101")(config . ((preedit-method . roman))))
((emacs-event-id . 0)(emacs-session-id . 1)(output . ()))
((emacs-event-id . 1)(emacs-session-id . 1)(output . ((id . "4087100232139049092")(mode . hiragana)(consumed . nil)(key . ((special-key . kana)))(status . ((activated . t)(mode . hiragana)(comeback-mode . hiragana))))))
((emacs-event-id . 2)(emacs-session-id . 1)(output . ((id . "4087100232139049092")(mode . hiragana)(consumed . nil)(key . ((special-key . kana)))(status . ((activated . t)(mode . hiragana)(comeback-mode . hiragana))))))
$ sudo cp out_mac/Release/mozc_emacs_helper /usr/local/bin
Copy the following emacs lisp file to your library path
$ cp mozc/src/unix/emacs/mozc.el "YOUR EMACS ELISP PATH"
Add the following code to your emacs init.el
(require 'mozc)
(setq default-input-method "japanese-mozc")
In emacs, you may change input method by C-. You can input Japanese if you success the installation.