1 # Maintainer: ponsfoot <cabezon dot hashimoto at gmail dot com>
6 ## You can choose the input method framework to use either ibus, scim or both.
7 ## If you will not be using ibus, comment out below.
9 ## If you will be using scim, uncomment below.
11 ## If you will be using uim, uncomment below.
14 ## If you will be using mozc.el on Emacs, uncomment below.
17 ## $QTDIR is changed temporarily and forcibly by default for Qt3 users.
18 ## If you install Qt4 on your custom and set $QTDIR for Qt4, uncomment below.
21 ## Mozc compile option
25 #*************************************************************
29 # http://code.google.com/p/mozc/
31 # Japanese zip code data by Japan Post
32 # http://www.post.japanpost.jp/zipcode/download.html
35 # http://code.google.com/p/macuim/
37 #*************************************************************
38 # Changes to original mozc:
40 # 1. Add uim-mozc (optional)
41 # 2. Link protobuf statically when uim-mozc is enabled
43 #*************************************************************
47 true && pkgname=('mozc-svn')
52 arch=('i686' 'x86_64')
53 url="http://code.google.com/p/mozc/"
54 license=('BSD' 'custom')
55 makedepends=('pkg-config' 'python2' 'gtest' 'zinnia' 'subversion')
57 source=(http://downloads.sourceforge.net/pnsft-aur/ken_all-${_zipcoderel}.zip
58 http://downloads.sourceforge.net/pnsft-aur/jigyosyo-${_zipcoderel}.zip
60 sha1sums=('099fd4323f0dbd345431a003e718bd978b1f2679'
61 '003d424b788a6d6b1b9f86c30733c5b3083c1a6d'
64 if [[ "$_ibus_mozc" = "yes" ]]; then
65 true && pkgname+=('ibus-mozc-svn')
68 if [[ "$_scim_mozc" = "yes" ]]; then
69 true && pkgname+=('scim-mozc-svn')
72 if [[ "$_emacs_mozc" = "yes" ]]; then
73 true && pkgname+=('emacs-mozc-svn')
74 makedepends+=('emacs')
76 if [[ "$_uim_mozc" = "yes" ]]; then
77 true && pkgname+=('uim-mozc-svn')
79 source+=(http://protobuf.googlecode.com/files/protobuf-${_protobuf_ver}.tar.bz2)
80 sha1sums+=('df5867e37a4b51fb69f53a8baf5b994938691d6d')
85 _svntrunk="http://mozc.googlecode.com/svn/trunk/src"
89 if [[ "$_ibus_mozc" != "yes" && "$_scim_mozc" != "yes" && "$_uim_mozc" != "yes" ]]; then
90 msg "*****************************************************"
91 msg " Please choose either one of ibus, scim or uim"
92 msg " at least. See PKGBUILD."
93 msg "*****************************************************"
97 if [[ "$QTDIR" && -z "$_qtdir" ]]; then
98 msg '====================================================='
99 msg ' *** CAUTION ***'
100 msg ' $QTDIR will be replaced temporarily and forcibly'
101 msg ' for Qt3 users.'
102 msg ' If it is inconvenient for you, please edit'
103 msg ' PKGBUILD. (Please see it for datail)'
104 msg '====================================================='
107 msg '====================================================='
108 msg ' *** Build Info ***'
109 msg ' The following package files will be generated:'
110 for _p in ${pkgname[@]}
112 msg " * ${_p}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
114 msg '====================================================='
118 ln -sf /usr/bin/python2 ./python
119 PATH="${srcdir}:${PATH}"
121 # Checkout depot_tools
122 msg "Connecting to depot_tools SVN server..."
123 if [[ -d depot_tools/.svn ]]; then
124 (cd depot_tools ; svn update)
126 svn co http://src.chromium.org/svn/trunk/tools/depot_tools --config-dir ./
128 msg "SVN checkout done or server timeout"
129 PATH="${srcdir}/depot_tools:${PATH}"
132 msg "Connecting to mozc SVN server..."
133 if [[ ! -f .gclient ]]; then
134 [[ -d $_svnmod ]] && rm -rf $_svnmod
135 gclient config $_svntrunk
138 msg "SVN checkout done or server timeout"
140 # Checkout macuim-mozc (for uim-mozc)
141 if [[ "$_uim_mozc" = "yes" ]]; then
142 msg "Connecting to macuim SVN server..."
143 if [[ -d uim-mozc/.svn ]]; then
144 (cd uim-mozc ; svn update)
146 svn co http://macuim.googlecode.com/svn/trunk/Mozc uim-mozc
148 msg "SVN checkout done or server timeout"
151 msg "Copying source to src-build..."
152 rm -rf "${_svnmod}-build"
153 cp -r $_svnmod "${_svnmod}-build"
154 cd "${_svnmod}-build"
156 if [[ "$_uim_mozc" = "yes" ]]; then
157 # patch to link protobuf statically
158 cp -rf "${srcdir}/protobuf-${_protobuf_ver}" protobuf/files
159 patch -p0 -i "${srcdir}/uim-mozc/mozc-linux-protobuf.diff"
161 cp -rf "${srcdir}/uim-mozc/uim" unix/
163 patch -p0 -i "${srcdir}/uim-mozc/mozc-kill-line.diff"
164 # global_language_spec patch
165 patch -p0 -i "${srcdir}/uim-mozc/mozc-global_language_spec.diff"
167 # Extract license part of uim-mozc
168 head -n 32 unix/uim/mozc.cc > unix/uim/LICENSE
172 msg "Generating zip code seed..."
173 python2 dictionary/gen_zip_code_seed.py --zip_code="${srcdir}/KEN_ALL.CSV" --jigyosyo="${srcdir}/JIGYOSYO.CSV" >> data/dictionary/dictionary09.txt
175 msg "Starting make..."
177 # Get make -j option from $MAKEFLAGS
178 _jobs=`sed -n -e "s/.*--jobs=\([0-9]\+\).*/\1/p" -e "s/.*-j *\([0-9]\+\).*/\1/p" <<< "$MAKEFLAGS"`
181 _targets="server/server.gyp:mozc_server gui/gui.gyp:mozc_tool "
182 [[ "$_emacs_mozc" = "yes" ]] && _targets+="unix/emacs/emacs.gyp:mozc_emacs_helper "
183 [[ "$_ibus_mozc" = "yes" ]] && _targets+="unix/ibus/ibus.gyp:ibus_mozc "
184 [[ "$_scim_mozc" = "yes" ]] && _targets+="unix/scim/scim.gyp:scim_mozc unix/scim/scim.gyp:scim_mozc_setup "
185 [[ "$_uim_mozc" = "yes" ]] && _targets+="unix/uim/uim.gyp:uim-mozc "
187 QTDIR="$_qtdir" python2 build_mozc.py gyp --channel_dev=0
188 python2 build_mozc.py build_tools -c $_bldtype -j $_jobs
189 python2 build_mozc.py build -c $_bldtype -j $_jobs $_targets
191 [[ "$_ibus_mozc" = "yes" ]] && sed -i 's|/usr/libexec/|/usr/lib/ibus-mozc/|g' out_linux/${_bldtype}/obj/gen/unix/ibus/mozc.xml
193 if [[ "$_emacs_mozc" = "yes" ]]; then
195 emacs -batch -f batch-byte-compile mozc.el
201 pkgdesc="A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"
202 arch=('i686' 'x86_64')
204 depends=('curl' 'qt')
205 [[ "$_uim_mozc" != "yes" ]] && depends+=('protobuf')
207 replaces=('mozc-server-svn' 'mozc-utils-gui-svn')
208 conflicts=('mozc' 'mozc-server' 'mozc-utils-gui')
209 optdepends=('zinnia: hand-writing recognition support'
210 'tegaki-models-zinnia-japanese: hand-writing recognition support')
212 cd "${srcdir}/${_svnmod}-build"
213 install -D -m 755 out_linux/${_bldtype}/mozc_server "${pkgdir}/usr/lib/mozc/mozc_server"
214 install -m 755 out_linux/${_bldtype}/mozc_tool "${pkgdir}/usr/lib/mozc/mozc_tool"
215 install -d "${pkgdir}/usr/lib/mozc/documents/"
216 install -m 644 data/installer/*.html "${pkgdir}/usr/lib/mozc/documents/"
218 install -D -m 644 debian/copyright "${pkgdir}/usr/share/licenses/${pkgbase}/copyright"
221 package_emacs-mozc-svn() {
222 pkgdesc="Mozc for Emacs"
223 arch=('i686' 'x86_64')
225 depends=("mozc-svn=${pkgver}" 'emacs')
226 install=emacs-mozc.install
227 replaces=('emacs-mozc-bin')
228 provides=('emacs-mozc')
229 conflicts=('emacs-mozc' 'emacs-mozc-bin')
231 cd "${srcdir}/${_svnmod}-build"
232 install -D -m 755 out_linux/${_bldtype}/mozc_emacs_helper "${pkgdir}/usr/bin/mozc_emacs_helper"
233 install -d "${pkgdir}/usr/share/emacs/site-lisp/emacs-mozc/"
234 install -m 644 unix/emacs/mozc.el{,c} "${pkgdir}/usr/share/emacs/site-lisp/emacs-mozc"
237 package_ibus-mozc-svn() {
238 pkgdesc="IBus engine module for Mozc"
239 arch=('i686' 'x86_64')
241 depends=("mozc-svn=${pkgver}" 'ibus')
242 provides=('ibus-mozc')
243 conflicts=('ibus-mozc')
245 cd "${srcdir}/${_svnmod}-build"
246 install -D -m 755 out_linux/${_bldtype}/ibus_mozc "${pkgdir}/usr/lib/ibus-mozc/ibus-engine-mozc"
247 install -D -m 644 out_linux/${_bldtype}/obj/gen/unix/ibus/mozc.xml "${pkgdir}/usr/share/ibus/component/mozc.xml"
248 install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${pkgdir}/usr/share/ibus-mozc/product_icon.png"
249 install -m 644 data/images/unix/ui-tool.png "${pkgdir}/usr/share/ibus-mozc/tool.png"
250 install -m 644 data/images/unix/ui-properties.png "${pkgdir}/usr/share/ibus-mozc/properties.png"
251 install -m 644 data/images/unix/ui-dictionary.png "${pkgdir}/usr/share/ibus-mozc/dictionary.png"
252 install -m 644 data/images/unix/ui-direct.png "${pkgdir}/usr/share/ibus-mozc/direct.png"
253 install -m 644 data/images/unix/ui-hiragana.png "${pkgdir}/usr/share/ibus-mozc/hiragana.png"
254 install -m 644 data/images/unix/ui-katakana_half.png "${pkgdir}/usr/share/ibus-mozc/katakana_half.png"
255 install -m 644 data/images/unix/ui-katakana_full.png "${pkgdir}/usr/share/ibus-mozc/katakana_full.png"
256 install -m 644 data/images/unix/ui-alpha_half.png "${pkgdir}/usr/share/ibus-mozc/alpha_half.png"
257 install -m 644 data/images/unix/ui-alpha_full.png "${pkgdir}/usr/share/ibus-mozc/alpha_full.png"
260 package_scim-mozc-svn() {
261 pkgdesc="SCIM IMEngine module for Mozc"
262 arch=('i686' 'x86_64')
264 depends=("mozc-svn=${pkgver}" 'scim')
265 provides=('scim-mozc')
266 conflicts=('scim-mozc')
268 cd "${srcdir}/${_svnmod}-build"
269 _moduledir=`pkg-config scim --variable=moduledir`
270 install -D -m 755 out_linux/${_bldtype}/lib.target/libscim_mozc.so "${pkgdir}${_moduledir}/IMEngine/mozc.so"
271 install -D -m 755 out_linux/${_bldtype}/lib.target/libscim_mozc_setup.so "${pkgdir}${_moduledir}/SetupUI/mozc-setup.so"
272 _icondir=`pkg-config scim --variable=icondir`
273 install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${pkgdir}${_icondir}/scim-mozc.png"
274 install -m 644 data/images/unix/ui-tool.png "${pkgdir}${_icondir}/scim-mozc-tool.png"
275 install -m 644 data/images/unix/ui-properties.png "${pkgdir}${_icondir}/scim-mozc-properties.png"
276 install -m 644 data/images/unix/ui-dictionary.png "${pkgdir}${_icondir}/scim-mozc-dictionary.png"
277 install -m 644 data/images/unix/ui-direct.png "${pkgdir}${_icondir}/scim-mozc-direct.png"
278 install -m 644 data/images/unix/ui-hiragana.png "${pkgdir}${_icondir}/scim-mozc-hiragana.png"
279 install -m 644 data/images/unix/ui-katakana_half.png "${pkgdir}${_icondir}/scim-mozc-katakana_half.png"
280 install -m 644 data/images/unix/ui-katakana_full.png "${pkgdir}${_icondir}/scim-mozc-katakana_full.png"
281 install -m 644 data/images/unix/ui-alpha_half.png "${pkgdir}${_icondir}/scim-mozc-alpha_half.png"
282 install -m 644 data/images/unix/ui-alpha_full.png "${pkgdir}${_icondir}/scim-mozc-alpha_full.png"
285 package_uim-mozc-svn() {
286 pkgdesc="uim IMEngine module for Mozc"
287 arch=('i686' 'x86_64')
289 depends=("mozc-svn=${pkgver}" 'uim')
290 install=uim-mozc.install
291 provides=('uim-mozc')
292 conflicts=('uim-mozc')
294 cd "${srcdir}/${_svnmod}-build"
295 install -D -m 755 out_linux/${_bldtype}/libuim-mozc.so "${pkgdir}/usr/lib/uim/plugin/libuim-mozc.so"
296 install -d "${pkgdir}/usr/share/uim"
297 install -m 644 ${srcdir}/uim-mozc/scm/*.scm "${pkgdir}/usr/share/uim/"
298 install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${pkgdir}/usr/share/uim/pixmaps/mozc.png"
299 install -m 644 data/images/unix/ui-tool.png "${pkgdir}/usr/share/uim/pixmaps/mozc_tool_selector.png"
300 install -m 644 data/images/unix/ui-properties.png "${pkgdir}/usr/share/uim/pixmaps/mozc_tool_config_dialog.png"
301 install -m 644 data/images/unix/ui-dictionary.png "${pkgdir}/usr/share/uim/pixmaps/mozc_tool_dictionary_tool.png"
303 install -D -m 644 unix/uim/LICENSE "${pkgdir}/usr/share/licenses/${pkgbase}/uim-mozc/LICENSE"
306 # Global pkgdesc and depends are here so that they will be picked up by AUR
307 pkgdesc="A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input), with uim-mozc (optional)"
308 depends=('curl' 'qt')