From d37027cb86c73ba98658e5e6142a1e044692cd2d Mon Sep 17 00:00:00 2001 From: Michael Weber Date: Mon, 18 Dec 2017 13:33:27 +0100 Subject: [PATCH] app-misc/anki: Enable tests. Package-Manager: Portage-2.3.19, Repoman-2.3.6 --- app-misc/anki/anki-2.1.0_beta25.ebuild | 25 ++++++++++++++----- .../files/anki-2.1.0_beta25-web-folder.patch | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app-misc/anki/anki-2.1.0_beta25.ebuild b/app-misc/anki/anki-2.1.0_beta25.ebuild index 65fedfcbf81b..71268203040c 100644 --- a/app-misc/anki/anki-2.1.0_beta25.ebuild +++ b/app-misc/anki/anki-2.1.0_beta25.ebuild @@ -18,13 +18,13 @@ S="${WORKDIR}/${MY_P}" LICENSE="GPL-3" SLOT="0" KEYWORDS="" -IUSE="latex +recording +sound" +IUSE="latex +recording +sound test" REQUIRED_USE="${PYTHON_REQUIRED_USE}" RDEPEND="${PYTHON_DEPS} dev-python/PyQt5[gui,svg,webkit,${PYTHON_USEDEP}] >=dev-python/httplib2-0.7.4[${PYTHON_USEDEP}] - dev-python/beautifulsoup[${PYTHON_USEDEP}] + dev-python/beautifulsoup:4[${PYTHON_USEDEP}] dev-python/decorator[${PYTHON_USEDEP}] dev-python/markdown[${PYTHON_USEDEP}] dev-python/requests[${PYTHON_USEDEP}] @@ -37,8 +37,11 @@ RDEPEND="${PYTHON_DEPS} latex? ( app-text/texlive app-text/dvipng - )" -DEPEND="" + ) +" +DEPEND="${RDEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] ) +" PATCHES=( "${FILESDIR}"/${P}-web-folder.patch ) @@ -52,6 +55,16 @@ src_prepare() { aqt/profiles.py || die } +src_compile() { + :; +} + +src_test() { + sed -e "s:nosetests:${EPYTHON} ${EROOT}usr/bin/nosetests:" \ + -i tools/tests.sh || die + ./tools/tests.sh || die +} + src_install() { cp tools/runanki.system tools/anki doicon ${PN}.png @@ -68,6 +81,6 @@ src_install() { # not sure if this is correct, but # site-packages/aqt/mediasrv.py wants the directory - python_moduleinto aqt - python_domodule web + insinto /usr/share/anki + doins -r web } diff --git a/app-misc/anki/files/anki-2.1.0_beta25-web-folder.patch b/app-misc/anki/files/anki-2.1.0_beta25-web-folder.patch index 521a2ed3bd8c..19b196c4ace7 100644 --- a/app-misc/anki/files/anki-2.1.0_beta25-web-folder.patch +++ b/app-misc/anki/files/anki-2.1.0_beta25-web-folder.patch @@ -5,7 +5,7 @@ def _getExportFolder(): # running from source? - srcFolder = os.path.join(os.path.dirname(__file__), "..") -+ srcFolder = os.path.dirname(__file__) ++ srcFolder = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "share", "anki") webInSrcFolder = os.path.abspath(os.path.join(srcFolder, "web")) if os.path.exists(webInSrcFolder): return webInSrcFolder -- 2.26.2