app-editors/mg: ppc stable wrt bug #715294
[gentoo.git] / app-editors / retext / retext-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 # no pypy{,3} support as PyQt5 does not support it at 2019-05-15
7 # https://bitbucket.org/pypy/compatibility/wiki/Home#!gui-library-bindings
8 PYTHON_COMPAT=( python3_{6,7} )
9
10 inherit distutils-r1 virtualx xdg-utils
11
12 MY_PN="ReText"
13 MY_P="${MY_PN}-${PV/_/~}"
14
15 DESCRIPTION="Simple editor for Markdown and reStructuredText"
16 HOMEPAGE="https://github.com/retext-project/retext https://github.com/retext-project/retext/wiki"
17
18 if [[ ${PV} == *9999 ]]
19         then
20                 inherit git-r3
21                 EGIT_REPO_URI="https://github.com/retext-project/retext.git"
22         else
23                 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
24                 KEYWORDS="~amd64 ~x86"
25                 S="${WORKDIR}"/${MY_P}
26 fi
27
28 LICENSE="GPL-2+"
29 SLOT="0"
30 IUSE="+spell"
31
32 RDEPEND="
33         dev-python/chardet[${PYTHON_USEDEP}]
34         dev-python/docutils[${PYTHON_USEDEP}]
35         dev-python/markdown[${PYTHON_USEDEP}]
36         dev-python/markups[${PYTHON_USEDEP}]
37         dev-python/pygments[${PYTHON_USEDEP}]
38         dev-python/python-markdown-math[${PYTHON_USEDEP}]
39         dev-python/PyQt5[gui,network,printsupport,widgets,${PYTHON_USEDEP}]
40         || (
41                 dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
42                 <dev-python/PyQt5-5.12[webengine]
43                 )
44         spell? ( dev-python/pyenchant[${PYTHON_USEDEP}] )
45 "
46 DEPEND="
47         ${RDEPEND}
48 "
49 BDEPEND="
50         dev-python/setuptools[${PYTHON_USEDEP}]
51 "
52
53 src_test() {
54         virtx distutils-r1_src_test
55 }
56
57 python_test() {
58         esetup.py test
59 }
60
61 pkg_postinst() {
62         xdg_desktop_database_update
63         xdg_icon_cache_update
64
65         einfo "Starting with retext-7.0.4 the markdown-math plugin is installed."
66         einfo "Note that you can use different math delimiters, e.g. \(...\) for inline math."
67         einfo "For more details take a look at:"
68         einfo "https://github.com/mitya57/python-markdown-math#math-delimiters"
69 }
70
71 pkg_postrm() {
72         xdg_desktop_database_update
73         xdg_icon_cache_update
74 }