1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
7 PYTHON_REQ_USE="sqlite"
9 inherit eutils python-single-r1 xdg
11 DESCRIPTION="A spaced-repetition memory training program (flash cards)"
12 HOMEPAGE="https://apps.ankiweb.net"
13 SRC_URI="https://apps.ankiweb.net/downloads/archive/${P}-source.tgz -> ${P}.tgz"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="latex +recording +sound test"
19 RESTRICT="!test? ( test )"
20 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
22 RDEPEND="${PYTHON_DEPS}
23 $(python_gen_cond_dep '
24 >=dev-python/PyQt5-5.12[gui,svg,widgets,${PYTHON_MULTI_USEDEP}]
25 dev-python/PyQtWebEngine[${PYTHON_MULTI_USEDEP}]
26 dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
27 dev-python/decorator[${PYTHON_MULTI_USEDEP}]
28 dev-python/distro[${PYTHON_MULTI_USEDEP}]
29 dev-python/jsonschema[${PYTHON_MULTI_USEDEP}]
30 dev-python/markdown[${PYTHON_MULTI_USEDEP}]
31 dev-python/requests[${PYTHON_MULTI_USEDEP}]
32 dev-python/send2trash[${PYTHON_MULTI_USEDEP}]
33 recording? ( dev-python/pyaudio[${PYTHON_MULTI_USEDEP}] )
35 recording? ( media-sound/lame )
36 sound? ( media-video/mpv )
44 $(python_gen_cond_dep '
45 dev-python/nose[${PYTHON_MULTI_USEDEP}]
46 dev-python/mock[${PYTHON_MULTI_USEDEP}]
51 PATCHES=( "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch )
54 python-single-r1_pkg_setup
59 sed -i -e "s/updates=True/updates=False/" \
60 aqt/profiles.py || die
68 sed -e "s:nose=nosetests$:nose=\"${EPYTHON} ${EROOT}usr/bin/nosetests\":" \
69 -i tools/tests.sh || die
70 sed -e "s:nose=nosetests3$:nose=\"${EPYTHON} ${EROOT}usr/bin/nosetests3\":" \
71 -i tools/tests.sh || die
72 sed -e "s:which nosetests3:which ${EROOT}usr/bin/nosetests3:" \
73 -i tools/tests.sh || die
74 ./tools/tests.sh || die
82 dodoc README.md README.development
83 python_domodule aqt anki
84 python_newscript runanki anki
86 # Localization files go into the anki directory:
87 python_moduleinto anki
88 python_domodule locale
90 # not sure if this is correct, but
91 # site-packages/aqt/mediasrv.py wants the directory
92 insinto /usr/share/anki