1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7} )
7 PYTHON_REQ_USE="sqlite"
11 DESCRIPTION="Toolkit to convert between many translation formats"
12 HOMEPAGE="https://github.com/translate/translate"
13 SRC_URI="https://github.com/translate/translate/releases/download/${PV}/${P}.tar.gz"
17 KEYWORDS="amd64 arm64 x86 ~amd64-linux ~x86-linux"
18 IUSE="doc +html +ical +ini +subtitles +yaml"
20 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
23 dev-python/setuptools[${PYTHON_USEDEP}]
24 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
27 >=dev-python/six-1.10.0[${PYTHON_USEDEP}]
32 >=dev-python/chardet-3.0.4[${PYTHON_USEDEP}]
33 dev-python/diff-match-patch[${PYTHON_USEDEP}]
34 >=dev-python/lxml-3.5[${PYTHON_USEDEP}]
35 >=dev-python/pycountry-18.5.26[${PYTHON_USEDEP}]
36 >=dev-python/python-levenshtein-0.12.0[${PYTHON_USEDEP}]
38 html? ( dev-python/utidylib[${PYTHON_USEDEP}] )
39 ical? ( dev-python/vobject[${PYTHON_USEDEP}] )
40 ini? ( dev-python/iniparse[${PYTHON_USEDEP}] )
41 subtitles? ( media-video/gaupol[${PYTHON_USEDEP}] )
42 yaml? ( dev-python/pyyaml[${PYTHON_USEDEP}] )
45 python_prepare_all() {
46 # Prevent unwanted d'loading in doc build
47 sed -e "/^ 'sphinx.ext.intersphinx',/d" \
48 -e "/html_theme/ s/sphinx-bootstrap/classic/" \
49 -i docs/conf.py || die
51 distutils-r1_python_prepare_all
54 python_compile_all() {
57 HTML_DOCS=( "${S}"/docs/_build/html/. )
61 python_install_all() {
62 distutils-r1_python_install_all
66 rm "${ED}"/usr/bin/{html2po,po2html} || die
69 rm "${ED}"/usr/bin/{ical2po,po2ical} || die
72 rm "${ED}"/usr/bin/{ini2po,po2ini} || die
74 if ! use subtitles; then
75 rm "${ED}"/usr/bin/{sub2po,po2sub} || die