install and update script for mozc.
added usefull features:
- support UT Dictionary
- build mozc_emacs_helper
brew install bazel pyenv
pyenv install 3.9.x
cd ~/Documents/Sources
git clone https://github.com/google/mozc.git -b master --single-branch --recursive
git clone https://github.com/utuhiro78/merge-ut-dictionaries.git
create a homebrew script in the future.
#!/bin/bash -e
UT_DICT_DIR=~/Documents/Sources/merge-ut-dictionaries
MOZC_DIR=~/Documents/Sources/mozc
# update UT Dictionary
cd $UT_DICT_DIR
git reset --hard HEAD
git clean -dfx
git pull
cd src
# build with full options
alt_cannadic="true" \
edict="true" \
jawiki="true" \
neologd="true" \
personal_names="true" \
place_names="true" \
skk_jisyo="true" \
sudachidict="true" \
sh make.sh
# update source
cd $MOZC_DIR
git reset --hard HEAD
git clean -dfx
git pull --recurse-submodules
# python
pyenv local 3.9.18
python3 -m venv .venv
source .venv/bin/activate
pip3 install requests
cd src
# cleanup
bazel clean --expunge
rm -rf "/private/var/tmp/_bazel_$(whoami)"
# update deps
python3 build_tools/update_deps.py
# build Qt
python3 build_tools/build_qt.py --release --confirm_license
# merge UT dictonary
cat "$UT_DICT_DIR/src/mozcdic-ut.txt" >> data/dictionary_oss/dictionary00.txt
# build mozc
MOZC_QT_PATH="$(pwd)/third_party/qt" \
bazel build package //unix/emacs:mozc_emacs_helper //unix/emacs:mozc.el --config oss_macos -c opt
# install
cp -f bazel-bin/unix/emacs/mozc_emacs_helper ~/.local/bin
sudo installer -pkg bazel-bin/mac/Mozc.pkg -target /
# cleanup
bazel clean --expunge
rm -rf "/private/var/tmp/_bazel_$(whoami)"
cd $MOZC_DIR
git reset --hard HEAD
git clean -dfx