Diff mozc-2.26.4220_p20201212102434_p20201219202429 with a mozc-2.28.5029.102

/usr/portage/app-i18n/mozc/mozc-2.28.5029.102.ebuild 2023-10-09 14:52:28.764368332 +0300
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI="8"
5
PYTHON_COMPAT=( python3_{9..11} )
6 5

  
7
inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
6
PYTHON_COMPAT=( python3_{10..11} )
7

  
8
inherit desktop edo elisp-common multiprocessing python-any-r1 savedconfig toolchain-funcs xdg
8 9

  
9 10
if [[ "${PV}" == "9999" ]]; then
10 11
	inherit git-r3
......
12 13
	EGIT_REPO_URI="https://github.com/google/mozc"
13 14
	EGIT_SUBMODULES=(src/third_party/japanese_usage_dictionary)
14 15
else
15
	MOZC_GIT_REVISION="9ba59b64d53365c1fe93c1c245b4ec3e35bdadf0"
16
	MOZC_GIT_REVISION="305e9a7374254148474d067c46d55a4ee6081837"
16 17
	MOZC_DATE="${PV#*_p}"
17 18
	MOZC_DATE="${MOZC_DATE%%_p*}"
18 19

  
19
	FCITX_MOZC_GIT_REVISION="1ea089debc31ff216473369ad71c08318384ee06"
20
	FCITX_MOZC_GIT_REVISION="242b4f703cba27d4ff4dc123c713a478f964e001"
20 21
	FCITX_MOZC_DATE="${PV#*_p}"
21 22
	FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
22 23
	FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
......
30 31
if [[ "${PV}" == "9999" ]]; then
31 32
	SRC_URI=""
32 33
else
33
	SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
34
	SRC_URI="
35
		https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
34 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
35
		fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )"
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 )
39
	"
36 40
fi
37 41

  
38 42
# Mozc: BSD
......
41 45
# japanese-usage-dictionary: BSD-2
42 46
LICENSE="BSD BSD-2 ipadic public-domain unicode"
43 47
SLOT="0"
44
KEYWORDS="amd64 ~arm64 ~ppc64 x86"
48
KEYWORDS="amd64 ~arm64 ~ppc64 ~x86"
45 49
IUSE="debug emacs fcitx4 +gui ibus renderer test"
46 50
REQUIRED_USE="|| ( emacs fcitx4 ibus )"
47 51
RESTRICT="!test? ( test )"
48 52

  
49
BDEPEND="$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
53
BDEPEND="
54
	$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
50 55
	>=dev-libs/protobuf-3.0.0
51 56
	dev-util/gyp
52 57
	dev-util/ninja
53 58
	virtual/pkgconfig
54 59
	emacs? ( app-editors/emacs:* )
55
	fcitx4? ( sys-devel/gettext )"
56
DEPEND="=dev-cpp/abseil-cpp-20200923*[cxx17(+)]
60
	fcitx4? ( sys-devel/gettext )
61
"
62
DEPEND="
63
	>=dev-cpp/abseil-cpp-20211102.0-r2:=[cxx17(+)]
57 64
	>=dev-libs/protobuf-3.0.0:=
58 65
	fcitx4? (
59 66
		app-i18n/fcitx:4
......
79 86
		>=dev-cpp/gtest-1.8.0
80 87
		dev-libs/jsoncpp
81 88
	)"
82
RDEPEND="=dev-cpp/abseil-cpp-20200923*[cxx17(+)]
89
RDEPEND="
90
	>=dev-cpp/abseil-cpp-20211102.0-r2:=[cxx17(+)]
83 91
	>=dev-libs/protobuf-3.0.0:=
84 92
	emacs? ( app-editors/emacs:* )
85 93
	fcitx4? (
......
101 109
		x11-libs/cairo
102 110
		x11-libs/gtk+:2
103 111
		x11-libs/pango
104
	)"
112
	)
113
"
105 114

  
106 115
S="${WORKDIR}/${P}/src"
107 116

  
108 117
SITEFILE="50${PN}-gentoo.el"
109 118

  
110
execute() {
111
	einfo "$@"
112
	"$@"
113
}
119
PATCHES=(
120
	"${WORKDIR}"/mozc-2.28.5029.102-patches
121
	"${FILESDIR}"/mozc-2.28.5029.102-abseil.patch
122
)
114 123

  
115 124
python_check_deps() {
116
	has_version -b "dev-python/six[${PYTHON_USEDEP}]"
125
	python_has_version "dev-python/six[${PYTHON_USEDEP}]"
117 126
}
118 127

  
119 128
src_unpack() {
......
129 138
		unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
130 139
		mv mozc-${MOZC_GIT_REVISION} ${P} || die
131 140

  
141
		unpack ${PN}-2.28.5029.102-patches.tar.xz
142

  
132 143
		unpack japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
133 144
		cp -p japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}/usage_dict.txt ${P}/src/third_party/japanese_usage_dictionary || die
134 145

  
......
145 156
	fi
146 157

  
147 158
	pushd "${WORKDIR}/${P}" > /dev/null || die
148

  
149
	eapply "${FILESDIR}/${PN}-2.26.4220-system_abseil-cpp.patch"
150
	eapply "${FILESDIR}/${PN}-2.26.4220-system_gtest.patch"
151
	eapply "${FILESDIR}/${PN}-2.26.4220-system_jsoncpp.patch"
152
	eapply "${FILESDIR}/${PN}-2.26.4220-environmental_variables.patch"
153
	eapply "${FILESDIR}/${PN}-2.26.4220-server_path_check.patch"
154

  
155
	eapply_user
156

  
159
	default
157 160
	popd > /dev/null || die
158 161

  
159 162
	sed \
......
191 194
		-e "/'-lc++'/d" \
192 195
		-e "/'-stdlib=libc++'/d" \
193 196
		-i gyp/common.gypi || die
197

  
198
	# bug #877765
199
	restore_config mozcdic-ut.txt
200
	if [[ -f /mozcdic-ut.txt && -s mozcdic-ut.txt ]]; then
201
		einfo "mozcdic-ut.txt found. Adding to mozc dictionary..."
202
		cat mozcdic-ut.txt >> "${WORKDIR}/${P}/src/data/dictionary_oss/dictionary00.txt" || die
203
	fi
194 204
}
195 205

  
196 206
src_configure() {
......
231 241

  
232 242
	unset AR CC CXX LD NM READELF
233 243

  
234
	execute "${PYTHON}" build_mozc.py gyp \
244
	edo "${PYTHON}" build_mozc.py gyp \
235 245
		--gypdir="${EPREFIX}/usr/bin" \
236 246
		--server_dir="${EPREFIX}/usr/libexec/mozc" \
237 247
		--verbose \
238 248
		$(usex gui "" --noqt) \
239
		-- "${gyp_arguments[@]}" || die "Configuration failed"
249
		-- "${gyp_arguments[@]}"
240 250
}
241 251

  
242 252
src_compile() {
......
260 270
		targets+=(gyp/tests.gyp:unittests)
261 271
	fi
262 272

  
263
	execute "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} -v "${targets[@]}" || die "Building failed"
273
	if use ibus; then
274
		GYP_IBUS_FLAG="--use_gyp_for_ibus_build"
275
	fi
276

  
277
	edo "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} ${GYP_IBUS_FLAG} -v "${targets[@]}"
264 278

  
265 279
	if use emacs; then
266 280
		elisp-compile unix/emacs/*.el
......
268 282
}
269 283

  
270 284
src_test() {
271
	execute "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1 || die "Testing failed"
285
	edo "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1
272 286
}
273 287

  
274 288
src_install() {
275 289
	exeinto /usr/libexec/mozc
276 290
	doexe out_linux/${BUILD_TYPE}/mozc_server
277 291

  
292
	[[ -s mozcdic-ut.txt ]] && save_config mozcdic-ut.txt
293

  
278 294
	if use gui; then
279 295
		doexe out_linux/${BUILD_TYPE}/mozc_tool
280 296
	fi
......
371 387

  
372 388
		elisp-site-regen
373 389
	fi
390
	xdg_pkg_postinst
374 391
}
375 392

  
376 393
pkg_postrm() {
377 394
	if use emacs; then
378 395
		elisp-site-regen
379 396
	fi
397
	xdg_pkg_postrm
380 398
}
Thank you!