ibus-mozcの初期モードを「ひらがな」にする

mozcの初期入力を「ひらがな」に変更します。(ibus-mozc の初期モードを「ひらがな」入力にする の内容をDebianで実行した時のメモです。)

build環境のセットアップ

# apt-get source ibus-mozc
# apt-get install devscripts
# apt-get build-dep ibus-mozc

quiltのセットアップ

参考: 3.1. quilt のセットアップ

alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
complete -F _quilt_completion $_quilt_complete_opt dquilt

~/.quiltrc-dpkg を以下のように作る:

d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
    # if in Debian packaging tree with unset $QUILT_PATCHES
    QUILT_PATCHES="debian/patches"
    QUILT_PATCH_OPTS="--reject-format=unified"
    QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
    QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
    QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
    if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
fi
https://www.debian.org/doc/manuals/maint-guide/update.ja.html
# dquilt new kActivateOnLaunch.patch
としてパッチ名を設定します。ここではkActivateOnLaunch.patchという名前にしました。
# dquilt add src/unix/ibus/property_handler.cc
として変更されるファイルを宣言します。

ソースファイルの修正

editor src/unix/ibus/property_handler.cc

以下のように 83 行目の false を true に変更する。

// Some users expect that Mozc is turned off by default on IBus 1.5.0 and later.
// https://code.google.com/p/mozc/issues/detail?id=201
// On IBus 1.4.x, IBus expects that an IME should always be turned on and
// IME on/off keys are handled by IBus itself rather than each IME.
#if IBUS_CHECK_VERSION(1, 5, 0)
const bool kActivatedOnLaunch = true;
#else
const bool kActivatedOnLaunch = true;
#endif  // IBus>=1.5.0

# dquilt refresh

として kActivateOnLaunch.patch に記録する。

# dquilt header -e

としてその内容記述を追加する。

# dch -v 2.17.2116.102+gitfd0f5b34+dfsg-hhmod

として、versionをつける。

build

参考: 第6章 パッケージのビルド
# dpkg-buildpackage -us -uc

Adsense広告