blob: 6ec973ebf7212569d5e7d843707b254190bfb69d (
plain)
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
|
# Maintainer: Nocifer <apmichalopoulos at gmail dot com>
# Contributor: UTUMI Hirosi <utuhiro78 at yahoo dot co dot jp>
# Contributor: Felix Yan <felixonmars@gmail.com>
# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
#NOTE: The UT dictionary's project page: http://linuxplayers.g1.xrea.com/mozc-ut.html
ENABLED_DICTIONARIES=(
'alt-cannadic'
'edict2'
'jawiki'
'neologd'
'personal-names'
'place-names'
'skk-jisyo'
'sudachidict'
)
pkgname='fcitx5-mozc-ut'
pkgver=2.31.5712.102.20250117
pkgrel=1
pkgdesc='Fcitx5 module for Mozc (the Open Source edition of Google Japanese Input) bundled with the UT dictionary'
arch=('x86_64')
url='https://github.com/google/mozc'
license=('Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-or-later AND CC0-1.0 AND CC-BY-SA-3.0 AND CC-BY-SA-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND MIT AND NAIST-2003 AND Unicode-3.0 AND LicenseRef-Okinawa-Dictionary')
depends=('fcitx5' 'qt6-base')
makedepends=('bazel' 'git' 'python')
provides=('fcitx5-mozc=2.31.5712.102')
conflicts=('emacs-mozc' 'fcitx-mozc' 'fcitx5-mozc' 'ibus-mozc' 'mozc' 'mozc-ut')
options=(!distcc !ccache)
source=('git+https://github.com/fcitx/mozc.git#commit=9dc82478fb74ffbb5ea4ddde84350db68ee89754'
'git+https://github.com/abseil/abseil-cpp.git#commit=4447c7562e3bc702ade25105912dce503f0c4010'
'git+https://github.com/google/breakpad.git#commit=216cea7bca53fa441a3ee0d0f5fd339a3a894224'
'git+https://github.com/google/googletest.git#commit=b514bdc898e2951020cbdca1304b75f5950d1f59'
'git+https://github.com/chromium/gyp.git#commit=9ecf45e37677743503342ee4c6a76eaee80e4a7f'
'git+https://github.com/hiroyuki-komatsu/japanese-usage-dictionary.git#commit=e5b3425575734c323e1d947009dd74709437b684'
'git+https://github.com/protocolbuffers/protobuf.git#commit=7cc670c1809e704ebeba90fb430d50e009f36727'
'git+https://github.com/microsoft/wil.git#commit=fc5dbf55989fe20351c71d038a8d12de4b397a6d'
'git+https://github.com/utuhiro78/merge-ut-dictionaries.git#commit=c0a210388ce78ee7ebfa918810d8224e717a693e'
'git+https://github.com/utuhiro78/mozcdic-ut-alt-cannadic.git#commit=bf26bcbb1846f2e9cf35cbfcafcc91c015a1fb22'
'git+https://github.com/utuhiro78/mozcdic-ut-edict2.git#commit=520fbc99080bd2b3111440c23ca0e2edaa4c76c5'
'git+https://github.com/utuhiro78/mozcdic-ut-jawiki.git#commit=342b9b00c1cc58c9c124b9d7551fdac9a71ee56b'
'git+https://github.com/utuhiro78/mozcdic-ut-neologd.git#commit=e33ac4ce808fa4253c6c97bf5178e229a4bfb50f'
'git+https://github.com/utuhiro78/mozcdic-ut-personal-names.git#commit=5221f96d59b797e915845a4a51b2e8a8543b47e1'
'git+https://github.com/utuhiro78/mozcdic-ut-place-names.git#commit=9789d69e28b7ee7176c9ea0a5826317cfdac75a5'
'git+https://github.com/utuhiro78/mozcdic-ut-skk-jisyo.git#commit=c52cdb15e0a014c96050ce1bd02932f50706a3f0'
'git+https://github.com/utuhiro78/mozcdic-ut-sudachidict.git#commit=3eb0a18fe59f9d60a558585f3f9734c66665cf9b'
'https://dumps.wikimedia.org/jawiki/20250101/jawiki-20250101-pages-articles-multistream-index.txt.bz2')
sha256sums=('b98ba38c044aadfd26f43dcf9320638c936d7ee454fe1713e08b3fe1497db460'
'e131bbdd4e207d6cc2930bca9db82d6da9e347175c1125d9d1f2e09a36652278'
'5168bb8ea19e2f696eeecbdee991f28e496aea206a473fd7cb49b547f5d0c5af'
'c081295f2c22705e07fc430e152a30b36f949a179075d47d3e12ff3109d43c6a'
'8a136786407526c64686c3f9990d6416d62c7e2d474ef4a75ced337ecfc58cef'
'10a13d356071f2b0c2b6dcab1d841fae451f6a2020ee9b901533533fc7ac3008'
'578ead09a4a3fbf2f70b6af56e0b385ca136c79a4f4a62c777cb13e7a6f733f5'
'abb86ac4d546c98d7d9a10fdeb1059d6e3395e892d5397fb03179361f37c98fe'
'a386071ea217c6f808e853f90beae68e921c2401cbdd3f5bc8d4e35d8e537f43'
'81ed16f6b59f64e08482ea7ab676913584d95ecac00255e981374f02df2188e9'
'4f3c4b53da5b3fa673bd7bec916b6717a63bafb9fe80991e69a28cab2f7dcb47'
'840cf0f50ca8d1f6ce1cbaa255e3158eedeafb06e25317c2962f85d6272a0bc9'
'2bb007c54db6bb70d1771bffaeb05217c0e768cb176b9343ec0a25e9756d9f67'
'5d4a776a92adb181558bf3ec5012fb30dee00a782e74e2dd60e7c6a3eec4f7cd'
'6d79ee654bf3a22d66214495aa62f0223cb28b5bdc61bf9500ca54e279fa9bce'
'd3b1dd5a6419f6f9217d209f8aad6ce853077fbfeaaf73768503efc888f662b8'
'598c69bf9aaccf29562d7983c649aca6aef14018eb88481a33362958b692fbe4'
'3cb690b2faf073d0e5c5c158ebc4757a6d794071926b775871d9ee8eb4060bb8')
prepare() {
cd mozc/src
git submodule init
git config submodule.src/third_party/abseil-cpp.url "${srcdir}/abseil-cpp"
git config submodule.src/third_party/breakpad.url "${srcdir}/breakpad"
git config submodule.src/third_party/gtest.url "${srcdir}/googletest"
git config submodule.src/third_party/gyp.url "${srcdir}/gyp"
git config submodule.src/third_party/japanese_usage_dictionary.url "${srcdir}/japanese-usage-dictionary"
git config submodule.src/third_party/protobuf.url "${srcdir}/protobuf"
git config submodule.src/third_party/wil.url "${srcdir}/wil"
git -c protocol.file.allow=always submodule update
cd "${srcdir}"/merge-ut-dictionaries/src/merge/
# Use a dated snapshot for the jawiki dump data
sed -i -e '65,69d' merge_dictionaries.py
sed -i -e "s|jawiki-[a-z0-9]\{6,8\}|${srcdir}/jawiki-20250101|g" merge_dictionaries.py
# Use our local copy of the Mozc repo
sed -i -e "17s|'https://raw.githubusercontent.com/'.*$|'file://${srcdir}/mozc/src/data/dictionary_oss/id.def'|" merge_dictionaries.py
sed -i -e '18d' merge_dictionaries.py
# Compile the UT dictionary
printf '\nCompiling the UT dictionary...\n\n'
[[ -e mozcdic-ut.txt ]] && rm mozcdic-ut.txt
for dict in "${ENABLED_DICTIONARIES[@]}"
do
bzip2 -dfk "${srcdir}"/mozcdic-ut-${dict}/mozcdic-ut-${dict}.txt.bz2
cat "${srcdir}"/mozcdic-ut-${dict}/mozcdic-ut-${dict}.txt >> mozcdic-ut.txt
done
python merge_dictionaries.py mozcdic-ut.txt
# Append the UT dictionary
cat mozcdic-ut.txt >> "${srcdir}"/mozc/src/data/dictionary_oss/dictionary00.txt
}
build() {
cd mozc/src
unset ANDROID_NDK_HOME
unset ANDROID_HOME
export JAVA_HOME='/usr/lib/jvm/java-21-openjdk/'
bazel build server:mozc_server gui/tool:mozc_tool unix/fcitx5:fcitx5-mozc.so unix/icons --config oss_linux --compilation_mode opt
}
package() {
cd mozc/src
# 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
install -Dm755 bazel-bin/server/mozc_server "${pkgdir}"/usr/lib/mozc/mozc_server
install -Dm755 bazel-bin/gui/tool/mozc_tool "${pkgdir}"/usr/lib/mozc/mozc_tool
install -Dm755 bazel-bin/unix/fcitx5/fcitx5-mozc.so "${pkgdir}"/usr/lib/fcitx5/fcitx5-mozc.so
install -Dm644 unix/fcitx5/mozc-addon.conf "${pkgdir}"/usr/share/fcitx5/addon/mozc.conf
install -Dm644 unix/fcitx5/mozc.conf "${pkgdir}"/usr/share/fcitx5/inputmethod/mozc.conf
for pofile in unix/fcitx5/po/*.po
do
filename=`basename ${pofile}`
lang=${filename/.po/}
mofile=${pofile/.po/.mo}
msgfmt ${pofile} -o ${mofile}
install -Dm644 ${mofile} "${pkgdir}"/usr/share/locale/${lang}/LC_MESSAGES/fcitx5-mozc.mo
done
msgfmt --xml -d unix/fcitx5/po/ --template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in -o unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
install -Dm644 unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml "${pkgdir}"/usr/share/metainfo/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
cd bazel-bin/unix
unzip -o icons.zip
install -Dm644 mozc.png "${pkgdir}"/usr/share/icons/hicolor/128x128/apps/org.fcitx.Fcitx5.fcitx_mozc.png
install -Dm644 alpha_full.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_alpha_full.svg
install -Dm644 alpha_half.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_alpha_half.svg
install -Dm644 direct.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_direct.svg
install -Dm644 hiragana.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_hiragana.svg
install -Dm644 katakana_full.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_katakana_full.svg
install -Dm644 katakana_half.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_katakana_half.svg
install -Dm644 outlined/dictionary.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_dictionary.svg
install -Dm644 outlined/properties.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_properties.svg
install -Dm644 outlined/tool.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx_mozc_tool.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc.png "${pkgdir}"/usr/share/icons/hicolor/128x128/apps/fcitx_mozc.png
ln -s org.fcitx.Fcitx5.fcitx_mozc_alpha_full.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_alpha_full.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_alpha_half.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_alpha_half.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_direct.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_direct.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_hiragana.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_hiragana.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_katakana_full.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_katakana_full.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_katakana_half.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_katakana_half.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_dictionary.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_dictionary.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_properties.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_properties.svg
ln -s org.fcitx.Fcitx5.fcitx_mozc_tool.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/fcitx_mozc_tool.svg
}
|