4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Archlinux で fcitx-mozc と mozc を個別に入れる

Last updated at Posted at 2017-04-21

Archlinux の fcitx-mozc パッケージは mozc_server を含んでいて、
AUR にある mozc パッケージと衝突する。

mozcmozc で入れて、fcitx-mozc は mozc アドオンのみ入れるようにしたので、手順を残しておく。

mozc の導入

mozc から snapshot を取得して PKGBUILD を以下のように編集する。

$ cd ~/builds
$ tar xf ~/downloads/mozc.tar.gz

emacs-mozc パッケージを入れる。ibus-mozc はいらない子。

@@ -1,10 +1,10 @@
 # Maintainer: ponsfoot <cabezon dot hashimoto at gmail dot com>
 
 ## If you will be using mozc.el on Emacs, uncomment below.
-#_emacs_mozc="yes"
+_emacs_mozc="yes"
 
 ## If you will not be using ibus (only use uim), comment out below.
-_ibus_mozc="yes"
+#_ibus_mozc="yes"
 
 ## If you do not want to add Japanese zip code into dictionary,
 ## comment out below.

ibus-mozc の依存は消す。

@@ -183,4 +183,4 @@ package_emacs-mozc() {
 
 # Global pkgdesc and depends are here so that they will be picked up by AUR
 pkgdesc="A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"
-depends=('qt5-base' 'ibus>=1.4.1' 'zinnia')
+depends=('qt5-base' 'zinnia')

あとは、単純に makepkg -simozcemacs-mozc を入れる。

fcitx-mozc の導入

ABSfcitx-mozc をカスタムコンパイル。

$ sudo abs community/fcitx-mozc
$ cp -r /var/abs/community/fcitx-mozc ~/builds
$ cd ~/builds/fcitx-mozc
$ ln -s ~/builds/mozc/mozc .

mozc との衝突は削除し、依存に入れる。
上記でシンボリックリンクしたものを使うため、mozc 本体のソース取得や third_party の取得はごっそり削除。

@@ -6,10 +6,6 @@
 ## Mozc compile option
 _bldtype=Release
 
-_mozc_rev=280e38fe3d9db4df52f0713acf2ca65898cd697a
-_japanese_usage_dictionary_rev=e5b3425575734c323e1d947009dd74709437b684
-_gyp_rev=920ee58c3d3109dea3cd37d88054014891a93db7
-_protobuf_rev=a428e42072765993ff674fda72863c9f1aa2d268
 _zipcode_rel=201611
 
 _pkgbase=mozc
@@ -21,23 +17,15 @@ pkgrel=1
 arch=('i686' 'x86_64')
 url="https://github.com/google/mozc"
 license=('custom')
-depends=('qt5-base' 'fcitx' 'zinnia')
+depends=('qt5-base' 'fcitx' 'zinnia' 'mozc')
 makedepends=('pkg-config' 'python2' 'curl' 'gtk2' 'mesa' 'subversion' 'ninja' 'git' 'clang')
 replaces=('mozc-fcitx')
-conflicts=('mozc' 'mozc-server' 'mozc-utils-gui' 'mozc-fcitx')
-source=(git+https://github.com/google/mozc.git#commit=${_mozc_rev}
-        japanese_usage_dictionary::git+https://github.com/hiroyuki-komatsu/japanese-usage-dictionary.git#commit=${_japanese_usage_dictionary_rev}
-        git+https://chromium.googlesource.com/external/gyp#commit=${_gyp_rev}
-        git+https://github.com/google/protobuf.git#commit=${_protobuf_rev}
-        http://downloads.sourceforge.net/pnsft-aur/x-ken-all-${_zipcode_rel}.zip
+conflicts=('mozc-fcitx')
+source=(http://downloads.sourceforge.net/pnsft-aur/x-ken-all-${_zipcode_rel}.zip
         http://downloads.sourceforge.net/pnsft-aur/jigyosyo-${_zipcode_rel}.zip
         http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${_fcitx_patchver}.patch
         http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz)
-sha512sums=('SKIP'
-            'SKIP'
-            'SKIP'
-            'SKIP'
-            'c48a4ac3237a367672009e67ccc34416cbbd5373f8ce7e47d28e5be85dddbb216d3eb27d2439cde4fdcf826df92ad13694e113761cb927def77944f14757aab1'
+sha512sums=('c48a4ac3237a367672009e67ccc34416cbbd5373f8ce7e47d28e5be85dddbb216d3eb27d2439cde4fdcf826df92ad13694e113761cb927def77944f14757aab1'
             'a6c328ebf4805a38ed17f782d70179d37072a0d4c6dd50fef0aeefff0e073acd606a006c261c6a79d381038e3928533f76104362d5bd443d93794ecffe45d923'
             '725c464727f230707b90975705ef1565f1178f9144e66c5a688696a4ef520a6fec1d11f7aa68ee05f82aa9417060b1cccf49a155e30734871a525eaa4c76addb'
             '5507c637e5a65c44ccf6e32118b6d16647ece865171b9a77dd3c78e6790fbd97e6b219e68d2e27750e22074eb536bccf8d553c295d939066b72994b86b2f251a')
@@ -57,13 +45,6 @@ prepare() {
   msg "Generating zip code seed..."
   PYTHONPATH="$PWD:$PYTHONPATH" python2 dictionary/gen_zip_code_seed.py --zip_code="${srcdir}/x-ken-all.csv" --jigyosyo="${srcdir}/JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt
   msg "Done."
-
-  # Copy third party deps
-  cd "$srcdir"
-  for dep in gyp protobuf japanese_usage_dictionary
-  do
-    cp -a $dep mozc/src/third_party/
-  done
 }
 
 build() {

mozc_server はインストールしない。

@@ -73,7 +57,7 @@ build() {
 
   cd mozc/src
 
-  _targets="server/server.gyp:mozc_server gui/gui.gyp:mozc_tool unix/fcitx/fcitx.gyp:fcitx-mozc"
+  _targets="unix/fcitx/fcitx.gyp:fcitx-mozc"
 
   QTDIR=/usr GYP_DEFINES="document_dir=/usr/share/licenses/$pkgname use_libzinnia=1" python2 build_mozc.py gyp
   python2 build_mozc.py build -c $_bldtype $_targets
@@ -84,9 +68,6 @@ build() {
 
 package() {
   cd mozc/src
-  install -D -m 755 out_linux/${_bldtype}/mozc_server "${pkgdir}/usr/lib/mozc/mozc_server"
-  install    -m 755 out_linux/${_bldtype}/mozc_tool   "${pkgdir}/usr/lib/mozc/mozc_tool"
-
   install -d "${pkgdir}/usr/share/licenses/$pkgname/"
   install -m 644 LICENSE data/installer/*.html "${pkgdir}/usr/share/licenses/${pkgname}/"

あとは、単純に makepkg -si で OK。

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?