| 35 |
35 |
https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
|
| 36 |
36 |
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
|
| 37 |
37 |
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-2.28.5029.102-patches.tar.xz
|
| 38 |
|
fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
|
|
38 |
fcitx5? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
|
| 39 |
39 |
"
|
| 40 |
40 |
fi
|
| 41 |
41 |
|
| ... | ... | |
| 45 |
45 |
# japanese-usage-dictionary: BSD-2
|
| 46 |
46 |
LICENSE="BSD BSD-2 ipadic public-domain unicode"
|
| 47 |
47 |
SLOT="0"
|
| 48 |
|
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
|
| 49 |
|
IUSE="debug emacs fcitx4 +gui ibus renderer test"
|
| 50 |
|
REQUIRED_USE="|| ( emacs fcitx4 ibus )"
|
|
48 |
KEYWORDS="amd64 arm64 ~loong x86"
|
|
49 |
IUSE="debug emacs fcitx5 +gui ibus renderer test"
|
|
50 |
REQUIRED_USE="|| ( emacs fcitx5 ibus )"
|
| 51 |
51 |
RESTRICT="!test? ( test )"
|
| 52 |
52 |
|
| 53 |
53 |
BDEPEND="
|
| ... | ... | |
| 57 |
57 |
app-alternatives/ninja
|
| 58 |
58 |
virtual/pkgconfig
|
| 59 |
59 |
emacs? ( app-editors/emacs:* )
|
| 60 |
|
fcitx4? ( sys-devel/gettext )
|
|
60 |
fcitx5? ( sys-devel/gettext )
|
| 61 |
61 |
"
|
| 62 |
62 |
DEPEND="
|
| 63 |
|
>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
|
|
63 |
>=dev-cpp/abseil-cpp-20240116.0:=
|
| 64 |
64 |
>=dev-libs/protobuf-3.0.0:=
|
| 65 |
|
fcitx4? (
|
| 66 |
|
app-i18n/fcitx:4
|
|
65 |
fcitx5? (
|
|
66 |
app-i18n/fcitx:5
|
|
67 |
app-i18n/libime
|
|
68 |
sys-devel/gettext
|
| 67 |
69 |
virtual/libintl
|
| 68 |
70 |
)
|
| 69 |
71 |
gui? (
|
| ... | ... | |
| 90 |
92 |
>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
|
| 91 |
93 |
>=dev-libs/protobuf-3.0.0:=
|
| 92 |
94 |
emacs? ( app-editors/emacs:* )
|
| 93 |
|
fcitx4? (
|
| 94 |
|
app-i18n/fcitx:4
|
|
95 |
fcitx5? (
|
|
96 |
app-i18n/fcitx:5
|
|
97 |
app-i18n/libime
|
|
98 |
sys-devel/gettext
|
| 95 |
99 |
virtual/libintl
|
| 96 |
100 |
)
|
| 97 |
101 |
gui? (
|
| ... | ... | |
| 120 |
124 |
"${WORKDIR}"/mozc-2.28.5029.102-patches
|
| 121 |
125 |
"${FILESDIR}"/mozc-2.28.5029.102-abseil.patch
|
| 122 |
126 |
"${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0.patch
|
|
127 |
"${FILESDIR}"/mozc-2.28.5029.102-abseil-20240116.patch
|
| 123 |
128 |
)
|
| 124 |
129 |
|
| 125 |
130 |
python_check_deps() {
|
| ... | ... | |
| 130 |
135 |
if [[ "${PV}" == "9999" ]]; then
|
| 131 |
136 |
git-r3_src_unpack
|
| 132 |
137 |
|
| 133 |
|
if use fcitx4; then
|
|
138 |
if use fcitx5; then
|
| 134 |
139 |
local EGIT_SUBMODULES=()
|
| 135 |
140 |
git-r3_fetch https://github.com/fcitx/mozc refs/heads/fcitx
|
| 136 |
141 |
git-r3_checkout https://github.com/fcitx/mozc "${WORKDIR}/fcitx-mozc"
|
|
142 |
cp -pr "${WORKDIR}"/fcitx{,5}-mozc || die
|
| 137 |
143 |
fi
|
| 138 |
144 |
else
|
| 139 |
145 |
unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
|
| ... | ... | |
| 144 |
150 |
unpack japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
|
| 145 |
151 |
cp -p japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}/usage_dict.txt ${P}/src/third_party/japanese_usage_dictionary || die
|
| 146 |
152 |
|
| 147 |
|
if use fcitx4; then
|
|
153 |
if use fcitx5; then
|
| 148 |
154 |
unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
|
| 149 |
|
mv mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN} || die
|
|
155 |
cp -pr mozc-${FCITX_MOZC_GIT_REVISION} fcitx5-${PN} || die
|
|
156 |
rm -r mozc-${FCITX_MOZC_GIT_REVISION} || die
|
| 150 |
157 |
fi
|
| 151 |
158 |
fi
|
| 152 |
159 |
}
|
| 153 |
160 |
|
| 154 |
161 |
src_prepare() {
|
| 155 |
|
if use fcitx4; then
|
| 156 |
|
cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
|
| 157 |
|
PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch )
|
|
162 |
if use fcitx5; then
|
|
163 |
cp -pr "${WORKDIR}/fcitx5-mozc/src/unix/fcitx5" unix || die
|
|
164 |
PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx5.patch )
|
| 158 |
165 |
fi
|
| 159 |
166 |
|
| 160 |
167 |
pushd "${WORKDIR}/${P}" > /dev/null || die
|
| ... | ... | |
| 225 |
232 |
gyp_arguments+=(-D debug_extra_cflags=)
|
| 226 |
233 |
gyp_arguments+=(-D release_extra_cflags=)
|
| 227 |
234 |
|
| 228 |
|
gyp_arguments+=(-D use_fcitx=$(usex fcitx4 YES NO))
|
|
235 |
gyp_arguments+=(-D use_fcitx5=$(usex fcitx5 YES NO))
|
| 229 |
236 |
gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
|
| 230 |
237 |
gyp_arguments+=(-D use_libprotobuf=1)
|
| 231 |
238 |
gyp_arguments+=(-D use_system_abseil_cpp=1)
|
| ... | ... | |
| 256 |
263 |
if use emacs; then
|
| 257 |
264 |
targets+=(unix/emacs/emacs.gyp:mozc_emacs_helper)
|
| 258 |
265 |
fi
|
| 259 |
|
if use fcitx4; then
|
| 260 |
|
targets+=(unix/fcitx/fcitx.gyp:fcitx-mozc)
|
|
266 |
if use fcitx5; then
|
|
267 |
targets+=(unix/fcitx5/fcitx5.gyp:fcitx5-mozc)
|
| 261 |
268 |
fi
|
| 262 |
269 |
if use gui; then
|
| 263 |
270 |
targets+=(gui/gui.gyp:mozc_tool)
|
| ... | ... | |
| 310 |
317 |
elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN}
|
| 311 |
318 |
fi
|
| 312 |
319 |
|
| 313 |
|
if use fcitx4; then
|
| 314 |
|
exeinto /usr/$(get_libdir)/fcitx
|
| 315 |
|
doexe out_linux/${BUILD_TYPE}/fcitx-mozc.so
|
| 316 |
|
|
| 317 |
|
insinto /usr/share/fcitx/addon
|
| 318 |
|
doins unix/fcitx/fcitx-mozc.conf
|
| 319 |
|
|
| 320 |
|
insinto /usr/share/fcitx/inputmethod
|
| 321 |
|
doins unix/fcitx/mozc.conf
|
| 322 |
|
|
| 323 |
|
insinto /usr/share/fcitx/mozc/icon
|
| 324 |
|
newins data/images/product_icon_32bpp-128.png mozc.png
|
| 325 |
|
local image
|
| 326 |
|
for image in ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
|
| 327 |
|
newins "${image}" "mozc-${image#../../fcitx-${PN}/src/data/images/unix/ui-}"
|
|
320 |
if use fcitx5; then
|
|
321 |
exeinto /usr/$(get_libdir)/fcitx5
|
|
322 |
doexe out_linux/${BUILD_TYPE}/fcitx5-mozc.so
|
|
323 |
|
|
324 |
insinto /usr/share/fcitx5/addon
|
|
325 |
newins unix/fcitx5/mozc-addon.conf mozc.conf
|
|
326 |
|
|
327 |
insinto /usr/share/fcitx5/inputmethod
|
|
328 |
doins unix/fcitx5/mozc.conf
|
|
329 |
|
|
330 |
local orgfcitx5="org.fcitx.Fcitx5.fcitx-mozc"
|
|
331 |
newicon -s 128 data/images/product_icon_32bpp-128.png ${orgfcitx5}.png
|
|
332 |
newicon -s 128 data/images/product_icon_32bpp-128.png fcitx-mozc.png
|
|
333 |
newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png ${orgfcitx5}.png
|
|
334 |
newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png fcitx-mozc.png
|
|
335 |
for uiimg in ../../fcitx5-mozc/scripts/icons/ui-*.png; do
|
|
336 |
dimg=${uiimg#*ui-}
|
|
337 |
newicon -s 48 ${uiimg} ${orgfcitx5}-${dimg/_/-}
|
|
338 |
newicon -s 48 ${uiimg} fcitx-mozc-${dimg/_/-}
|
| 328 |
339 |
done
|
| 329 |
340 |
|
| 330 |
341 |
local locale mo_file
|
| 331 |
|
for mo_file in out_linux/${BUILD_TYPE}/gen/unix/fcitx/po/*.mo; do
|
|
342 |
for mo_file in unix/fcitx5/po/*.po; do
|
| 332 |
343 |
locale="${mo_file##*/}"
|
| 333 |
|
locale="${locale%.mo}"
|
|
344 |
locale="${locale%.po}"
|
|
345 |
msgfmt ${mo_file} -o ${mo_file/.po/.mo} || die
|
| 334 |
346 |
insinto /usr/share/locale/${locale}/LC_MESSAGES
|
| 335 |
|
newins "${mo_file}" fcitx-mozc.mo
|
|
347 |
newins "${mo_file/.po/.mo}" fcitx5-mozc.mo
|
| 336 |
348 |
done
|
|
349 |
msgfmt --xml -d unix/fcitx5/po/ --template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in -o \
|
|
350 |
unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml || die
|
|
351 |
insinto /usr/share/metainfo
|
|
352 |
doins unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
|
| 337 |
353 |
fi
|
| 338 |
354 |
|
| 339 |
355 |
if use ibus; then
|