1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
# $Id$
# shellcheck disable=SC2034,SC2148,SC2154
# Maintainer: BrLi <brli at chakralinux dot org>
# Contributor: Jiachen Yang <farseerfc@archlinux.org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
# Contributor: UTUMI Hirosi <utuhiro78 at yahoo dot co dot jp>
## Mozc compile option
_bldtype='Release'
_zipcode_rel=202110
# Ut Dictionary
_utdicdate=20250110
_dict=(alt-cannadic
edict2
jawiki
neologd
personal-names
place-names
skk-jisyo
sudachidict)
pkgbase=mozc-ut-full
pkgname=("$pkgbase-common" "ibus-$pkgbase" "fcitx5-$pkgbase" "emacs-$pkgbase")
pkgver=2.31.5712.102.20250110
pkgrel=1
arch=('x86_64')
url="https://github.com/fcitx/mozc"
license=('custom')
makedepends=('bazel' 'git' 'python' 'python-six' 'pkg-config' 'curl' 'mesa' 'subversion' 'qt6-base' 'clang' 'fcitx5' 'emacs' 'ibus')
source=(git+https://github.com/fcitx/mozc.git#commit=9dc82478fb74ffbb5ea4ddde84350db68ee89754
# 2023-07-13: osdn.net is unstable due to Amazon
# "https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${_zipcode_rel}.zip"
# "https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${_zipcode_rel}.zip"
"https://gitlab.com/BrLi/brli-aur/-/raw/fcitx5-mozc-ut/x-ken-all-${_zipcode_rel}.zip"
"https://gitlab.com/BrLi/brli-aur/-/raw/fcitx5-mozc-ut/jigyosyo-${_zipcode_rel}.zip"
git+https://github.com/abseil/abseil-cpp.git
git+https://chromium.googlesource.com/breakpad/breakpad
git+https://github.com/google/googletest.git
git+https://chromium.googlesource.com/external/gyp
git+https://github.com/hiroyuki-komatsu/japanese-usage-dictionary.git
git+https://github.com/open-source-parsers/jsoncpp.git
git+https://github.com/google/protobuf.git
git+https://github.com/utuhiro78/merge-ut-dictionaries.git
jawiki-latest-pages-articles-multistream-index-${_utdicdate}.txt.bz2::https://dumps.wikimedia.org/jawiki/latest/jawiki-latest-pages-articles-multistream-index.txt.bz2
0001-remove-download.patch)
noextract=(jawiki-latest-pages-articles-multistream-index-${_utdicdate}.txt.bz2)
for dict in "${_dict[@]}"; do
source+=("mozcdic-ut-${dict}-${_utdicdate}.txt.bz2"::"https://github.com/utuhiro78/mozcdic-ut-${dict}/raw/main/mozcdic-ut-${dict}.txt.bz2")
done
sha512sums=('dad55aac4edd699b792f488de682c4ffd54b03e3f41bddbdb98b3df1f60deaa38a74300419104075974d91f0207c0f329a9bd1f755f4d133012ed72e559dc023'
'dec6479b42ddc1355cd882d17824cd874d8f103ad7767bac3f490f04551059d65b2806fa9e3f39a50ced2ecfdd37b75c9ed4536d9ad3bcef9e8c5ae1ec10e302'
'606f45d48a9dad0e80a566cab0001910de3c6b2f634ec52c6ef6f44745b55ae8e181b3e3cdf90525a08be1f180eb35900672c90c6ab4f43679a178e863378bbc'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'69f70067bd143ec795c2946956a898c900b9e9d3af5a2813712409e3352e5da93092969d7cb154deb46ae3313506c68a9896ad2eeb11d9bdaa78d88d2f9a3889'
'19ccbab5f66c1473627f12770b9afddc09d4d3f29b66e23b5d9d11d5ae2180e8b92633f5245be2e43f05fcc742df2544e63cd9fcccd61bb0df0e4495ab84beec'
'09b86b7527d45423090645a6763bb5d2d2bfe105a1db3736a2b7d48edf73dd2a6a4da4ae8ceb62bf26da210d07a6e6f7260dea7e01539e7746731d898793a07b'
'769216fec2b6a6af706e5bea1deace01b77c62e4dc6e8e5f8aa4165e1b4e7323ecaf1084dacf9302a6b5cdb1ce44720143ae7f40186519dca02846e8bd6016f2'
'a6b18c219f2a9c3eab269edabe919591bae6fce36c0cad81c85611442aa94cdef3a80489b63fa1a04a00099e34f283eab71b4e65296d5c29baf5c97f2197d39c'
'2c3317d00faa52980c0069f0655e83681606b6e259044129149bff2ba1b7f17dbfdeeaad832b6d0b2f4935c7fd40bfefec54bbfe04bf189c5868847cc63065f6'
'bd09c3c43fc44cc87a14d37e08a2f1de6a3caddebe1cb9cd31602767dbaeee5a8accb3426eea8de756d5329c683b6c473159bce7c0c3debbbd12aad3f9912a2d'
'0f49a3e332012d876a1d006de1ffabcfc3c83a930d2dfd56d26e965bacfad60d298b9e9dac4480d3819ce82478d3350b1342098d6788e8218371f1835d9758e4'
'4841eeee6c073f9d40cb0ca16798918b8a535491b166f3e024228261e7c2d597910c40f5c611205fd17e88034cedbe0298363778007a4c2c254762b40398ec3d'
'd4ce06fd1317e56b13cfbcf5ea667162ce93badea7519da1dd55ca3c8d2f892729501cd5df762eba16de83ce853b1b377dd5a8be812ea42ce3a13dfaf020575b')
pkgver() {
cd "${srcdir}/mozc" || exit
source <(grep = src/data/version/mozc_version_template.bzl | tr -d ' ')
printf "%s.%s.%s.%s.%s" "$MAJOR" "$MINOR" "$BUILD_OSS" "$((REVISION + 2))" "$_utdicdate"
}
prepare() {
cd "$srcdir/mozc" || exit
git config -f .gitmodules submodule.src/third_party/abseil-cpp.url "$srcdir/abseil-cpp"
git config -f .gitmodules submodule.src/third_party/breakpad.url "$srcdir/breakpad"
git config -f .gitmodules submodule.src/third_party/gtest.url "$srcdir/googletest"
git config -f .gitmodules submodule.src/third_party/gyp.url "$srcdir/gyp"
git config -f .gitmodules submodule.src/third_party/japanese_usage_dictionary.url "$srcdir/japanese-usage-dictionary"
git config -f .gitmodules submodule.src/third_party/jsoncpp.url "$srcdir/jsoncpp"
git config -f .gitmodules submodule.src/third_party/protobuf.url "$srcdir/protobuf"
git -c protocol.file.allow=always submodule update --init
cd src || exit
echo 'Generating zip code seed...'
PYTHONPATH="$PWD:$PYTHONPATH" python dictionary/gen_zip_code_seed.py --zip_code="${srcdir}/x-ken-all.csv" --jigyosyo="${srcdir}/JIGYOSYO.CSV" >>data/dictionary_oss/dictionary09.txt
echo 'Done.'
# disable fcitx4 target
rm unix/fcitx/fcitx.gyp
# fix mozc icon for kimpanel
sed -i 's|PREFIX|/usr|' unix/fcitx5/mozc.conf
# use libstdc++ instead of libc++
sed '/stdlib=libc++/d;/-lc++/d' -i gyp/common.gypi
# UT Dictionary steps, rewrite of `sh make.sh`
msg 'UT Dictionary steps, rewrite of `sh make.sh`'
cd "${srcdir}/merge-ut-dictionaries/src/merge" || exit
msg '1. Append dictionaries'
for dict in "${_dict[@]}"; do
cat "$srcdir/mozcdic-ut-${dict}-${_utdicdate}.txt" >>mozcdic-ut.txt
done
msg '2. Patch python scripts to avoid downloading'
patch -Np1 -i "${srcdir}/0001-remove-download.patch"
mv -v "$srcdir/jawiki-latest-pages-articles-multistream-index-${_utdicdate}.txt.bz2" jawiki-latest-pages-articles-multistream-index.txt.bz2
msg '3. Run the python scripts as in original make.sh, it may take some time...'
python merge_dictionaries.py mozcdic-ut.txt
msg '4. Finally add UT dictionary to mozc source'
cat mozcdic-ut.txt >>"$srcdir/mozc/src/data/dictionary_oss/dictionary00.txt"
}
build() {
# Fix compatibility with google-glog 0.3.3 (symbol conflict)
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
cd mozc/src || exit
_targets="unix/fcitx5:fcitx5-mozc.so server:mozc_server gui/tool:mozc_tool renderer/qt:mozc_renderer unix/ibus:ibus_mozc unix/emacs:mozc_emacs_helper"
unset ANDROID_NDK_HOME
unset ANDROID_HOME
export JAVA_HOME='/usr/lib/jvm/java-21-openjdk/'
export QT_BASE_PATH=/usr/include/qt
# Temp fix for GCC 14
sed -i -e '/Werror/d' third_party/protobuf/build_defs/cpp_opts.bzl
bazel build --copt=-fPIC --compilation_mode opt --config oss_linux $_targets --copt='-Wno-maybe-uninitialized' --host_copt='-Wno-maybe-uninitialized'
}
package_mozc-ut-full-common() {
pkgdesc="A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"
optdepends=('qt6-base: Display GUI of mozc_tool')
options=('!docs')
export PREFIX="$pkgdir/usr"
export _bldtype
cd mozc/src || exit
# BSD-3-Clause
sed -n 1,29p unix/fcitx5/fcitx_key_translator.h >Fcitx5
sed -i -e 's|^\/\/[ ]\?||g' Fcitx5
install -Dm644 Fcitx5 "${pkgdir}"/usr/share/licenses/${pkgname}/Fcitx5
# BSD-3-Clause
sed -n 67,94p data/installer/credits_en.html >Mozc
install -Dm644 Mozc "${pkgdir}"/usr/share/licenses/${pkgname}/Mozc
# BSD-3-Clause
sed -n 317,344p data/installer/credits_en.html >Breakpad
install -Dm644 Breakpad "${pkgdir}"/usr/share/licenses/${pkgname}/Breakpad
# NAIST-2003
sed -n 355,424p data/installer/credits_en.html >IPAdic
install -Dm644 IPAdic "${pkgdir}"/usr/share/licenses/${pkgname}/IPAdic
# BSD-2-Clause
sed -n 435,457p data/installer/credits_en.html >Japanese-Usage-Dictionary
install -Dm644 Japanese-Usage-Dictionary "${pkgdir}"/usr/share/licenses/${pkgname}/Japanese-Usage-Dictionary
# Public Domain Data
sed -n 468,470p data/installer/credits_en.html >Okinawa-Dictionary
install -Dm644 Okinawa-Dictionary "${pkgdir}"/usr/share/licenses/${pkgname}/Okinawa-Dictionary
# BSD-3-Clause
sed -n 481,513p data/installer/credits_en.html >Protocol-Buffers
install -Dm644 Protocol-Buffers "${pkgdir}"/usr/share/licenses/${pkgname}/Protocol-Buffers
# MIT
sed -n 698,704p data/installer/credits_en.html >Tamachi-Phonetic-Kanji-Alphabet
install -Dm644 Tamachi-Phonetic-Kanji-Alphabet "${pkgdir}"/usr/share/licenses/${pkgname}/Tamachi-Phonetic-Kanji-Alphabet
# MIT
sed -n 762,782p data/installer/credits_en.html >Windows-Implementation-Library
sed -i -e 's|^[ \t]*||g' Windows-Implementation-Library
install -Dm644 Windows-Implementation-Library "${pkgdir}"/usr/share/licenses/${pkgname}/Windows-Implementation-Library
../scripts/install_server_bazel
}
package_fcitx5-mozc-ut-full() {
pkgdesc="Fcitx5 module for Mozc with UT dictionary"
depends=('fcitx5' "$pkgbase-common")
provides=('fcitx5-mozc')
replaces=('fcitx5-mozc')
conflicts=('fcitx-mozc' 'fcitx5-mozc')
export PREFIX="$pkgdir/usr"
export _bldtype
cd mozc/src || exit
../scripts/install_fcitx5_bazel
}
package_ibus-mozc-ut-full() {
pkgdesc="IBus engine module for Mozc with UT dictionary"
depends=('ibus' "$pkgbase-common")
conflicts=('ibus-mozc')
replaces=('ibus-mozc')
export _bldtype
cd "${srcdir}/mozc/src" || exit
install -D -m 755 bazel-bin/unix/ibus/ibus_mozc "$pkgdir/usr/lib/ibus-mozc/ibus-engine-mozc"
install -D -m 644 bazel-bin/unix/ibus/mozc.xml "$pkgdir/usr/share/ibus/component/mozc.xml"
install -D -m 755 bazel-bin/renderer/qt/mozc_renderer "$pkgdir/usr/lib/mozc/mozc_renderer"
cd bazel-bin/unix || exit
unzip -o icons.zip
install -Dm644 mozc.png "${pkgdir}/usr/share/ibus-mozc/product_icon.png"
install -Dm644 alpha_full.svg "${pkgdir}/usr/share/ibus-mozc/alpha_full.svg"
install -Dm644 alpha_half.svg "${pkgdir}/usr/share/ibus-mozc/alpha_half.svg"
install -Dm644 direct.svg "${pkgdir}/usr/share/ibus-mozc/direct.svg"
install -Dm644 hiragana.svg "${pkgdir}/usr/share/ibus-mozc/hiragana.svg"
install -Dm644 katakana_full.svg "${pkgdir}/usr/share/ibus-mozc/katakana_full.svg"
install -Dm644 katakana_half.svg "${pkgdir}/usr/share/ibus-mozc/katakana_half.svg"
install -Dm644 outlined/dictionary.svg "${pkgdir}/usr/share/ibus-mozc/dictionary.svg"
install -Dm644 outlined/properties.svg "${pkgdir}/usr/share/ibus-mozc/properties.svg"
install -Dm644 outlined/tool.svg "${pkgdir}/usr/share/ibus-mozc/tool.svg"
}
package_emacs-mozc-ut-full() {
pkgdesc="Emacs engine module for Mozc with UT dictionary"
depends=('emacs' "$pkgbase-common")
replaces=('emacs-mozc')
conflicts=('emacs-mozc')
export _bldtype
cd "${srcdir}/mozc/src" || exit
install -Dm755 bazel-bin/unix/emacs/mozc_emacs_helper "$pkgdir/usr/bin/mozc_emacs_helper"
install -Dm644 unix/emacs/mozc.el "$pkgdir/usr/share/emacs/site-lisp/emacs-mozc/mozc.el"
}
|