Google日本語入力Android版がオープンソースになったという事で早速ビルドしてみる。
■準備
EC2でUbuntu 12.04を使用。
sudo apt-get update sudo apt-get install g++ python subversion ibus make libibus-1.0-dev libzinnia-dev unzip ant qt4-dev-tools libqt4-core libqtgui4 git
■JDK
scp -i hogehoge.pem -r ~/Downloads/jdk-6u41-linux-x64.bin user@host:/home/user/jdk1.6.0_41 chmod 0700 jdk-6u41-linux-x64.bin ./jdk-6u41-linux-x64.bin PATH=$PATH:$HOME/jdk1.6.0_41/bin JAVA_HOME=$HOME/jdk1.6.0_41 export JAVA_HOME
■SDK
cd ~ wget http://dl.google.com/android/android-sdk_r21.1-linux.tgz tar zxvf android-sdk_r21.1-linux.tgz export PATH=/home/ubuntu/android-sdk-linux/tools:"$PATH" cd ~/android-sdk-linux/platforms/ wget http://dl.google.com/android/repository/android-17_r01.zip unzip android-17_r01.zip mv android-4.2 android-17 wget http://dl.google.com/android/repository/android-2.2_r03-linux.zip unzip android-2.2_r03-linux.zip mv android-2.2_r03-linux android-8
■NDK
cd ~ wget http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2 tar -jvxf android-ndk-r8e-linux-x86_64.tar.bz2 export PATH=/home/ubuntu/android-ndk-r8e:"$PATH"
■mozc
cd ~/ svn co http://src.chromium.org/svn/trunk/tools/depot_tools export PATH="$PATH":`pwd`/depot_tools mkdir -p ~/src/mozc cd ~/src/mozc gclient config http://mozc.googlecode.com/svn/trunk/src gclient sync
ちなみにリビジョンを指定するには以下のようにする。
gclient sync --revision r178
mac
macでgclient syncを実行すると以下のようなエラーが出て完了できない。
Server certificate verification failed: issuer is not trusted (https://zinnia.svn.sourceforge.net)
以下のコマンドで事前に取り込んでおく。
svn ls https://src.chromium.org svn ls https://zinnia.svn.sourceforge.net
cd ~/src/mozc/src ./build_mozc.py gyp --target_platform=Android --android_sdk_home=/home/ubuntu/android-sdk-linux ./build_mozc.py build_tools -c Release android update project -s -p android -t android-8 python build_mozc.py build android/android.gyp:apk -c Release_Android
x86
./build_mozc.py gyp --target_platform=Android --android_sdk_home=/home/ubuntu/android-sdk-linux --android_arch_abi=x86
ちなみにcleanは以下のコマンドで行う。
./build_mozc.py clean
リリースビルドしようとするとPlatform toolsが無いと言われて怒られる。
BUILD FAILED /home/ubuntu/src/mozc/src/android/build.xml:86: The following error occurred while executing this line: /home/ubuntu/android-sdk-linux/tools/ant/build.xml:401: SDK Platform Tools component is missing. Please install it with the SDK Manager (tools/android)
Ubuntuマシンがローカルに欲しくなる。この状態で既に共有ライブラリなどは生成されているのでローカルにダウンロードしeclipseでビルドできる。