Welcome to FutureAppLaboratory

v=(*^ワ^*)=v

Mozc for iOS

| Comments

はじめに

iOS 8ではサードパーティIMEが開発できるようになったので、mozcのiOS版を作ってみたい。
まだ初期段階ですが、JUST KEEP BUILDING!

環境について

今回は、android版を参考し、mozcのコア機能が含まれるライブラリを作りたいですね。
使うmozcソースのリビジョンは

18:06 zhenghongwang@viennakanon:projects/mozc/src (svn)[src:266]$ svn log -r COMMITTED
------------------------------------------------------------------------
r266 | yukawa@google.com | 2014-07-06 16:49:48 +0900 (日, 06  7 2014) | 11 lines

Use Ninja to build Android, NaCl, and Linux Desktop binaries

With this CL, Mozc starts using Ninja instead of Make to build Android, NaCl, and Linux Desktop binaries.  Note that Windows binaries have already been built with Ninja for one and a half years.

This CL is supposed not to change any user-visible behavior.

Closes Issue 222.

BUG=Issue mozc:222
TEST=unittest

ninjaを使い始めたみたいです。まあ、iOSやMACならxcodeでビルドするからあんまり関係ないよね。

ビルドマシンはMBP, OSX 10.9, xcode 5。

他の注意点

  • 変換のコアライブラリだけをビルドする。androidのnative側と同じです。
  • gypは事前にインストールした。
  • protobufをiOS向けにビルドすると、target specifies product type 'com.apple.product-type.tool', but there's no such product type for the 'iphoneos' platformが出てしまうので、protobufも事前にインストール。
  • ソースの中のprotobufをarm64にビルドするために、patchが必要みたい。まだ未解決なので、今回はarmv7とarmv7sにビルドする。

ソースの変更点

  1. src/iosのフォルダを新規。中はgypの設定、ビルドのターゲットなどが書かれている。
  2. src/build_ios.pyを新規。ビルドのスクリプトです。
  3. 一部のソールを変更した。srcの中で、svn diffを見ればわかる。

ビルド

srcの中でpython build_ios.pyを叩くだけ。
ビルドしたファイルはout_iosに入っている。

結果はこちらです。

11:37 zhenghongwang@viennakanon:projects/mozc_ios/src (git)[master|✚ 9]$ lipo -info out_ios/Default-iphoneos/libiMozc.a
Architectures in the fat file: out_ios/Default-iphoneos/libiMozc.a are: armv7 armv7s

Comments