My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
LinuxBuildInstructions  
How to build Mozc on Linux
Updated Dec 20, 2011 by yusukes@chromium.org

System Requirements

Currently, we only support Ubuntu 9.10 and 10.04 for building Mozc. We plan to add support for other platforms.

Software Requirements

Building on Linux requires the following software.

  • gcc/g++
  • Python
  • IBus (-libus)
  • SCIM (-lscim-1.0)
  • cURL (-lcurl)
  • OpenSSL (-lssl)
  • Zlib (-lz)
  • GLib (-glib-2.0, -lgobject-2.0)
  • Protocol Buffers (-lprotobuf)
  • Google C++ Testing Framework (-lgtest)
  • zinnia
  • Subversion
  • Qt4
  • emacs
  • gyp (optional)

On Ubuntu, you can install the dependencies by:

% sudo apt-get install g++ python libibus-1.0-dev libcurl4-openssl-dev libssl-dev zlib1g-dev libdbus-1-dev libglib2.0-dev libprotobuf-dev protobuf-compiler libgtest-dev subversion devscripts debhelper libqt4-dev scim libscim-dev libzinnia-dev tegaki-zinnia-japanese

Get the Code

First, you'll need to download the depot_tools, add depot_tools to your PATH:

% cd ~/
% svn co http://src.chromium.org/svn/trunk/tools/depot_tools
% export PATH=`pwd`/depot_tools:"$PATH"

Then, download the Mozc code from its SVN repository with the gclient command:

% mkdir -p ~/src/mozc
% cd ~/src/mozc
% gclient config http://mozc.googlecode.com/svn/trunk/src
% gclient sync

This will also download source code of other programs such as googletest and Protocol Buffers.

Update to the latest revision

Execute the following command to update to the latest revision.

% gclient sync

Updating the tree sometimes causes a mysterious build error. Try "build_mozc.py clean" if it occurs.

Compilation

First, you'll need to generate Makefiles using a tool called GYP, which is automatically downloaded by "gclient sync":

% cd ~/src/mozc/src
% python build_mozc.py gyp

Alternatively, if you don't want to show the current version number (e.g., "Build XYZ") on the candidate window for IBus, you could specify --channel_dev=0 as follows:

% cd ~/src/mozc/src
% python build_mozc.py gyp --channel_dev=0

Then, build the code generation tools:

% python build_mozc.py build_tools -c Release

Finally, build ibus-mozc, scim-mozc, mozc_server and mozc_tool executables.

% python build_mozc.py build -c Release unix/ibus/ibus.gyp:ibus_mozc unix/scim/scim.gyp:scim_mozc unix/scim/scim.gyp:scim_mozc_setup unix/emacs/emacs.gyp:mozc_emacs_helper server/server.gyp:mozc_server gui/gui.gyp:mozc_tool

Compilation Options

To do a parallel build, add -jX where X is the number of jobs run at once. To do a debug build, replace Release with Debug. This produces binaries with debug information included.

Build Mozc with /usr/bin/gyp

If your system already has /usr/bin/gyp, you don't have to check out depot_tools nor run gclient.

% mkdir -p ~/src/mozc		
% cd ~/src/mozc		
% svn co http://mozc.googlecode.com/svn/trunk/src		
% cd src		
% python build_mozc.py gyp --gypdir=/usr/bin		
% python build_mozc.py build_tools -c Release		
% python build_mozc.py build -c Release unix/ibus/ibus.gyp:ibus_mozc unix/scim/scim.gyp:scim_mozc unix/scim/scim.gyp:scim_mozc_setup server/server.gyp:mozc_server gui/gui.gyp:mozc_tool

This way would be useful when you build a Mozc package for your favorite Linux distribution.

Executables

Executables are written in ~/src/mozc/src/out_linux/Release for Release builds, and ~/src/mozc/src/out_linux/Debug for Debug builds. For instance, you'll have ~/src/mozc/src/out_linux/Release/ibus_mozc once the ibus-mozc is built successfully in the Release mode.

Clean up the Tree

To clean up the tree, execute the following. This will remove executables and intermediate files like object files, generated source files, Makefiles, etc.

% python build_mozc.py clean

Build and install debian package

To build and install debian packages, execute the following. You can safely skip the Get the Code and Compilation sections above. Currently, Ubuntu 10.04 is required to build the packages.

% sudo apt-get install gyp
% mkdir -p ~/src/mozc           
% cd ~/src/mozc         
% svn co http://mozc.googlecode.com/svn/trunk/src               
% cd src
% debuild -b -uc -us
This package has a Debian revision number but there does not seem to be
an appropriate original tar file or .orig directory in the parent directory;
(expected one of mozc_x.x.x.x.orig.tar.gz, mozc_x.x.x.x.orig.tar.bz2,
mozc_x.x.x.x.orig.tar.lzma or src.orig)
continue anyway? (y/n)   y
...
Finished running lintian.

% sudo dpkg -i ../ibus-mozc_x.x.x.x_*.deb ../scim-mozc_x.x.x.x_*.deb ../mozc-server_x.x.x.x_*.deb ../mozc-utils-gui_x.x.x.x_*.deb

To enable Mozc, you have to open the IBus or SCIM configuration and add "Japanese - Mozc" input method.

Powered by Google Project Hosting