diff --git a/app-i18n/mozc/mozc-2.26.4632_p20220130192938_p20220202104242-r2.ebuild b/app-i18n/mozc/mozc-2.26.4632_p20220130192938_p20220202104242-r2.ebuild new file mode 100644 index 0000000..35d90f7 --- /dev/null +++ b/app-i18n/mozc/mozc-2.26.4632_p20220130192938_p20220202104242-r2.ebuild @@ -0,0 +1,457 @@ +# Copyright 2010-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +PYTHON_COMPAT=( python3_{9..11} ) + +inherit elisp-common multiprocessing python-any-r1 toolchain-funcs + +if [[ "${PV}" == "9999" ]]; then + inherit git-r3 + + EGIT_REPO_URI="https://github.com/google/mozc" + EGIT_SUBMODULES=(src/third_party/japanese_usage_dictionary) +else + MOZC_GIT_REVISION="7329757e1ad30e327c1ae823a8302c79482d6b9c" + MOZC_DATE="${PV#*_p}" + MOZC_DATE="${MOZC_DATE%%_p*}" + + FCITX_MOZC_GIT_REVISION="4d2e3bdc0a2e99197f03cf241924639fef1378f0" + FCITX_MOZC_DATE="${PV#*_p}" + FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}" + FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}" + + JAPANESE_USAGE_DICTIONARY_GIT_REVISION="a4a66772e33746b91e99caceecced9a28507e925" + JAPANESE_USAGE_DICTIONARY_DATE="20180701040110" + + ABSEIL_GIT_REVISION="215105818dfde3174fe799600bb0f3cae233d0bf" + + UT_DICT_VER="20220206" +fi + +DESCRIPTION="Mozc - Japanese input method editor" +HOMEPAGE="https://github.com/google/mozc" +if [[ "${PV}" == "9999" ]]; then + SRC_URI="" +else + SRC_URI="https://github.com/google/mozc/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz + https://github.com/abseil/abseil-cpp/archive/${ABSEIL_GIT_REVISION}.tar.gz -> abseil-cpp-${ABSEIL_GIT_REVISION}.tar.gz + 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 + fcitx5? ( https://github.com/fcitx/mozc/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz ) + ut? ( https://osdn.net/downloads/users/37/37667/mozcdic-ut-${UT_DICT_VER}.tar.bz2 -> mozcdic-ut-${UT_DICT_VER}.tar.bz2 )" +fi + +# Mozc: BSD +# src/data/dictionary_oss: ipadic, public-domain +# src/data/unicode: unicode +# japanese-usage-dictionary: BSD-2 +LICENSE="BSD BSD-2 ipadic public-domain unicode" +SLOT="0" +KEYWORDS="amd64 ~arm64 ~ppc64 x86" +IUSE="debug emacs fcitx4 fcitx5 ut +gui ibus renderer test" +REQUIRED_USE="|| ( emacs fcitx4 fcitx5 ibus )" +RESTRICT="!test? ( test )" + +# TODO: Proper deps for FCITX5 +BDEPEND="$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]') + >=dev-libs/protobuf-3.0.0 + dev-util/gyp + dev-util/ninja + virtual/pkgconfig + emacs? ( app-editors/emacs:* ) + fcitx4? ( sys-devel/gettext )" +DEPEND=" + >=dev-libs/protobuf-3.0.0:= + fcitx4? ( + app-i18n/fcitx:4 + virtual/libintl + ) + fcitx5? ( + app-i18n/fcitx5:5 + ) + gui? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtwidgets:5 + ) + ibus? ( + >=app-i18n/ibus-1.4.1 + dev-libs/glib:2 + x11-libs/libxcb + ) + renderer? ( + dev-libs/glib:2 + x11-libs/cairo + x11-libs/gtk+:2 + x11-libs/pango + ) + test? ( + >=dev-cpp/gtest-1.8.0 + dev-libs/jsoncpp + )" +RDEPEND=" + >=dev-libs/protobuf-3.0.0:= + emacs? ( app-editors/emacs:* ) + fcitx4? ( + app-i18n/fcitx:4 + virtual/libintl + ) + fcitx5? ( + app-i18n/fcitx5:5 + ) + gui? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtwidgets:5 + ) + ibus? ( + >=app-i18n/ibus-1.4.1 + dev-libs/glib:2 + x11-libs/libxcb + ) + renderer? ( + dev-libs/glib:2 + x11-libs/cairo + x11-libs/gtk+:2 + x11-libs/pango + )" + +S="${WORKDIR}/${P}/src" + +SITEFILE="50${PN}-gentoo.el" + +execute() { + einfo "$@" + "$@" +} + +python_check_deps() { + has_version -b "dev-python/six[${PYTHON_USEDEP}]" +} + +src_unpack() { + if [[ "${PV}" == "9999" ]]; then + git-r3_src_unpack + + if use fcitx4 || use fcitx5; then + local EGIT_SUBMODULES=() + git-r3_fetch https://github.com/fcitx/mozc refs/heads/fcitx + git-r3_checkout https://github.com/fcitx/mozc "${WORKDIR}/fcitx-mozc" + fi + else + unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz + mv mozc-${MOZC_GIT_REVISION} ${P} || die + + unpack japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz + cp -p japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}/usage_dict.txt ${P}/src/third_party/japanese_usage_dictionary || die + + unpack abseil-cpp-${ABSEIL_GIT_REVISION}.tar.gz + rmdir ${P}/src/third_party/abseil-cpp + mv abseil-cpp-${ABSEIL_GIT_REVISION} ${P}/src/third_party/abseil-cpp + + if use fcitx4 || use fcitx5; then + unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz + mv mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN} + fi + + if use ut; then + unpack mozcdic-ut-${UT_DICT_VER}.tar.bz2 + cat mozcdic-ut-${UT_DICT_VER}/mozcdic-ut-${UT_DICT_VER}.txt >> ${P}/src/data/dictionary_oss/dictionary00.txt + fi + fi +} + +src_prepare() { + if use fcitx4; then + cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die + fi + if use fcitx5; then + cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx5" unix || die + fi + + pushd "${WORKDIR}/${P}" > /dev/null || die + +# eapply "${FILESDIR}/${PN}-2.26.4220-system_abseil-cpp.patch" +# eapply "${FILESDIR}/${PN}-2.26.4220-system_gtest.patch" +# eapply "${FILESDIR}/${PN}-2.26.4220-system_jsoncpp.patch" + # eapply "${FILESDIR}/${PN}-2.26.4220-environmental_variables.patch" +# eapply "${FILESDIR}/${PN}-2.26.4220-server_path_check.patch" + + eapply_user + + popd > /dev/null || die + + sed \ + -e "s/def GypMain(options, unused_args):/def GypMain(options, gyp_args):/" \ + -e "s/RunOrDie(gyp_command + gyp_options)/RunOrDie(gyp_command + gyp_options + gyp_args)/" \ + -e "s/RunOrDie(\[ninja/&, '-j$(makeopts_jobs)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \ + -i build_mozc.py || die + + local ar=($(tc-getAR)) + local cc=($(tc-getCC)) + local cxx=($(tc-getCXX)) + local ld=($(tc-getLD)) + local nm=($(tc-getNM)) + local readelf=($(tc-getREADELF)) + + # Use absolute paths. Non-absolute paths are mishandled by GYP. + ar[0]=$(type -P ${ar[0]}) + cc[0]=$(type -P ${cc[0]}) + cxx[0]=$(type -P ${cxx[0]}) + ld[0]=$(type -P ${ld[0]}) + nm[0]=$(type -P ${nm[0]}) + readelf[0]=$(type -P ${readelf[0]}) + + sed \ + -e "s: