Last active
December 17, 2015 18:39
-
-
Save naoina/5654416 to your computer and use it in GitHub Desktop.
diff of PKGBUILD of mozc-ut for fcitx-mozc support.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/PKGBUILD b/PKGBUILD | |
index fbb433e..cd05441 100755 | |
--- a/PKGBUILD | |
+++ b/PKGBUILD | |
@@ -5,9 +5,11 @@ | |
## | |
## You can choose the input method framework to use either ibus and/or uim. | |
## If you will not be using ibus, comment out below. | |
-_ibus_mozc="yes" | |
+#_ibus_mozc="yes" | |
## If you will be using uim, uncomment below. | |
#_uim_mozc="yes" | |
+## If you will be using fcitx, uncomment below. | |
+ _fcitx_mozc="yes" | |
## If applying patch for uim-mozc fails, try to uncomment below. | |
#_kill_kill_line="yes" | |
## This will disable the 'kill-line' feature of uim-mozc. | |
@@ -74,6 +76,7 @@ _mozcver=1.12.1599.102 | |
_utdicver=20131106 | |
_zipcoderel=201310 | |
_uimmozcrev=329 | |
+_fcitxmozpatchver=${_mozcver}.1 | |
_protobuf_ver=2.5.0 | |
_gyp_rev=1732 | |
@@ -119,6 +122,14 @@ if [[ "$_uim_mozc" == "yes" ]]; then | |
source+=(http://downloads.sourceforge.net/project/pnsft-aur/mozc/uim-mozc-${_uimmozcrev}.tar.xz) | |
sha1sums+=('6eda2c4ba9249b7f59853876932a1b01bff74a1c') | |
fi | |
+if [[ "$_fcitx_mozc" == "yes" ]]; then | |
+ true && pkgname+=('fcitx-mozc-ut') | |
+ makedepends+=('fcitx') | |
+ source+=(http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${_fcitxmozpatchver}.patch | |
+ http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz) | |
+ sha1sums+=('37d54efa33e89ba96c5c92307a755bfc4c667014' | |
+ '883f4fc489a9ed1c07d2d2ec37ca72509f04ea5d') | |
+fi | |
if [[ "$_emacs_mozc" == "yes" ]]; then | |
true && pkgname+=('emacs-mozc-ut') | |
@@ -172,6 +183,12 @@ build() { | |
head -n 32 unix/uim/mozc.cc > unix/uim/LICENSE | |
fi | |
+ # fcitx-mozc | |
+ if [[ "$_fcitx_mozc" == "yes" ]]; then | |
+ rm unix/fcitx -rf | |
+ patch -Np2 -i ${srcdir}/fcitx-mozc-${_fcitxmozpatchver}.patch | |
+ fi | |
+ | |
# Adjust to use python2 | |
find . -name \*.py -type f -exec sed -i -e "1s/python.*$/python2/" {} + | |
find . -regex '.*\.gypi?$' -type f -exec sed -i -e "s/'python'/'python2'/g" {} + | |
@@ -196,6 +213,7 @@ build() { | |
[[ "$_emacs_mozc" == "yes" ]] && _targets+="unix/emacs/emacs.gyp:mozc_emacs_helper " | |
[[ "$_ibus_mozc" == "yes" ]] && _targets+="unix/ibus/ibus.gyp:ibus_mozc renderer/renderer.gyp:mozc_renderer " | |
[[ "$_uim_mozc" == "yes" ]] && _targets+="unix/uim/uim.gyp:uim-mozc " | |
+ [[ "$_fcitx_mozc" == "yes" ]] && _targets+="unix/fcitx/fcitx.gyp:fcitx-mozc" | |
QTDIR=$_qt4dir GYP_DEFINES="document_dir=/usr/share/licenses/${pkgbase}" \ | |
python2 build_mozc.py gyp | |
@@ -309,6 +327,40 @@ package_uim-mozc-ut() { | |
install -D -m 644 unix/uim/LICENSE "${pkgdir}/usr/share/licenses/${pkgbase}/uim-mozc/LICENSE" | |
} | |
+package_fcitx-mozc-ut() { | |
+ pkgdesc="Fcitx module for Mozc" | |
+ arch=('i686' 'x86_64') | |
+ groups=('mozc-im') | |
+ depends=("mozc=${_mozcver}" 'fcitx') | |
+ provides=('fcitx-mozc') | |
+ conflicts=('fcitx-mozc') | |
+ | |
+ cd "${srcdir}/${pkgbase}-${pkgver}" | |
+ | |
+ for mofile in out_linux/${_bldtype}/obj/gen/unix/fcitx/po/*.mo | |
+ do | |
+ filename=`basename $mofile` | |
+ lang=${filename/.mo/} | |
+ install -D -m 644 "$mofile" "${pkgdir}/usr/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo" | |
+ done | |
+ | |
+ install -D -m 755 out_linux/${_bldtype}/fcitx-mozc.so "${pkgdir}/usr/lib/fcitx/fcitx-mozc.so" | |
+ install -D -m 644 unix/fcitx/fcitx-mozc.conf "${pkgdir}/usr/share/fcitx/addon/fcitx-mozc.conf" | |
+ install -D -m 644 unix/fcitx/mozc.conf "${pkgdir}/usr/share/fcitx/inputmethod/mozc.conf" | |
+ | |
+ install -d "${pkgdir}/usr/share/fcitx/mozc/icon" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-alpha_full.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-alpha_full.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-alpha_half.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-alpha_half.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-direct.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-direct.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-hiragana.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-hiragana.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-katakana_full.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-katakana_full.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-katakana_half.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-katakana_half.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-dictionary.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-dictionary.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-properties.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-properties.png" | |
+ install -m 644 "$srcdir/fcitx-mozc-icons/mozc-tool.png" "${pkgdir}/usr/share/fcitx/mozc/icon/mozc-tool.png" | |
+} | |
+ | |
# Global pkgdesc and depends are here so that they will be picked up by AUR | |
pkgdesc="Mozc the Japanese Input Method with Mozc UT Dictionary (additional dictionary) and uim-mozc (optional)" | |
depends=('qt4' 'zinnia') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment