]> git.bzium.org/ - embe/overlay.git/blob - app-misc/anki/anki-2.1.13-r1.ebuild
71952f64a616476d8ac77ac54259ae8cbba66034
[embe/overlay.git] / app-misc / anki / anki-2.1.13-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{6,7,8} )
7 PYTHON_REQ_USE="sqlite"
8
9 inherit eutils python-single-r1 xdg
10
11 DESCRIPTION="A spaced-repetition memory training program (flash cards)"
12 HOMEPAGE="https://apps.ankiweb.net"
13 SRC_URI="https://apps.ankiweb.net/downloads/current/${P}-source.tgz -> ${P}.tgz"
14
15 S="${WORKDIR}/${P}"
16
17 LICENSE="AGPL-3"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="latex +recording +sound test"
21 RESTRICT="!test? ( test )"
22 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
23
24 RDEPEND="${PYTHON_DEPS}
25         $(python_gen_cond_dep '
26                 || (
27                         (
28                                 >=dev-python/PyQt5-5.12[gui,svg,widgets,${PYTHON_MULTI_USEDEP}]
29                                 dev-python/PyQtWebEngine[${PYTHON_MULTI_USEDEP}]
30                         )
31                         <dev-python/PyQt5-5.12[gui,svg,webengine,widgets,${PYTHON_MULTI_USEDEP}]
32                 )
33                 >=dev-python/httplib2-0.7.4[${PYTHON_MULTI_USEDEP}]
34                 dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
35                 dev-python/decorator[${PYTHON_MULTI_USEDEP}]
36                 dev-python/jsonschema[${PYTHON_MULTI_USEDEP}]
37                 dev-python/markdown[${PYTHON_MULTI_USEDEP}]
38                 dev-python/requests[${PYTHON_MULTI_USEDEP}]
39                 dev-python/send2trash[${PYTHON_MULTI_USEDEP}]
40         ')
41         recording? ( media-sound/lame )
42         sound? ( media-video/mpv )
43         latex? (
44                 app-text/texlive
45                 app-text/dvipng
46         )
47 "
48 DEPEND="${RDEPEND}
49         test? (
50                 $(python_gen_cond_dep '
51                         dev-python/nose[${PYTHON_MULTI_USEDEP}]
52                         dev-python/mock[${PYTHON_MULTI_USEDEP}]
53                 ')
54         )
55 "
56
57 PATCHES=( "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch )
58
59 pkg_setup() {
60         python-single-r1_pkg_setup
61 }
62
63 src_prepare() {
64         default
65         sed -i -e "s/updates=True/updates=False/" \
66                 aqt/profiles.py || die
67 }
68
69 src_compile() {
70         :;
71 }
72
73 src_test() {
74         sed -e "s:nose=nosetests$:nose=\"${EPYTHON} ${EROOT}usr/bin/nosetests\":" \
75                 -i tools/tests.sh || die
76         sed -e "s:nose=nosetests3$:nose=\"${EPYTHON} ${EROOT}usr/bin/nosetests3\":" \
77                 -i tools/tests.sh || die
78         sed -e "s:which nosetests3:which ${EROOT}usr/bin/nosetests3:" \
79                 -i tools/tests.sh || die
80         ./tools/tests.sh || die
81 }
82
83 src_install() {
84         doicon ${PN}.png
85         domenu ${PN}.desktop
86         doman ${PN}.1
87
88         dodoc README.md README.development
89         python_domodule aqt anki
90         python_newscript runanki anki
91
92         # Localization files go into the anki directory:
93         python_moduleinto anki
94         python_domodule locale
95
96         # not sure if this is correct, but
97         # site-packages/aqt/mediasrv.py wants the directory
98         insinto /usr/share/anki
99         doins -r web
100 }