# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI="6" PYTHON_COMPAT=(python2_7) 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="" JAPANESE_USAGE_DICTIONARY_GIT_REVISION="" JAPANESE_USAGE_DICTIONARY_DATE="" fi FCITX_PATCH_VERSION="2.18.2612.102.1" 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/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.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" fi SRC_URI+=" fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )" # 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="" IUSE="debug emacs fcitx4 +gui +handwriting-tegaki handwriting-tomoe ibus renderer test" REQUIRED_USE="|| ( emacs fcitx4 ibus ) gui? ( ^^ ( handwriting-tegaki handwriting-tomoe ) ) !gui? ( !handwriting-tegaki !handwriting-tomoe )" RDEPEND=">=dev-libs/protobuf-3.0.0:= emacs? ( virtual/emacs ) fcitx4? ( app-i18n/fcitx:4 ) gui? ( app-i18n/zinnia dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 handwriting-tegaki? ( app-i18n/tegaki-zinnia-japanese ) handwriting-tomoe? ( app-i18n/zinnia-tomoe ) ) 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 )" DEPEND="${RDEPEND} ${PYTHON_DEPS} dev-util/gyp dev-util/ninja virtual/pkgconfig test? ( >=dev-cpp/gtest-1.8.0 dev-libs/jsoncpp )" S="${WORKDIR}/${P}/src" SITEFILE="50${PN}-gentoo.el" execute() { einfo "$@" "$@" } src_unpack() { if [[ "${PV}" == "9999" ]]; then git-r3_src_unpack else unpack ${P}.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 fi } src_prepare() { eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-system_libraries.patch" eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-gcc-5.patch" eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch" eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch" if use fcitx4; then eapply -p2 "${DISTDIR}/fcitx-mozc-${FCITX_PATCH_VERSION}.patch" fi eapply_user 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 sed \ -e "s/'release_extra_cflags%': \['-O2'\]/'release_extra_cflags%': []/" \ -e "s/'debug_extra_cflags%': \['-O0', '-g'\]/'debug_extra_cflags%': []/" \ -i gyp/common.gypi || die local ar=($(tc-getAR)) local cc=($(tc-getCC)) local cxx=($(tc-getCXX)) local ld=($(tc-getLD)) local nm=($(tc-getNM)) local readelf=($(tc-getPROG READELF readelf)) # 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: