app-misc/anki: Fix dependencies.
authorMichael Weber <xmw@gentoo.org>
Mon, 18 Dec 2017 12:05:37 +0000 (13:05 +0100)
committerMichael Weber <xmw@gentoo.org>
Mon, 18 Dec 2017 12:05:37 +0000 (13:05 +0100)
Thanks thanks Michael Mounteney and Dennis New.
EAPI=6,
remove unneeded overrides of src_configure and src_compile.

Closes: https://bugs.gentoo.org/639354
Package-Manager: Portage-2.3.19, Repoman-2.3.6

app-misc/anki/anki-2.1.0_beta25.ebuild
app-misc/anki/files/anki-2.1.0_beta25-web-folder.patch [new file with mode: 0644]

index ac3413e622b67172d2b3c4f3281dc11f1f778727..65fedfcbf81ba0260f003f2f1d293337a626fd10 100644 (file)
@@ -1,12 +1,12 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="5"
+EAPI=6
 
-PYTHON_COMPAT=( python3_4 python3_5 python3_6 )
+PYTHON_COMPAT=( python3_6 )
 PYTHON_REQ_USE="sqlite"
 
-inherit eutils python-single-r1
+inherit eutils python-single-r1 xdg
 
 DESCRIPTION="A spaced-repetition memory training program (flash cards)"
 HOMEPAGE="https://apps.ankiweb.net"
@@ -25,6 +25,9 @@ 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/decorator[${PYTHON_USEDEP}]
+       dev-python/markdown[${PYTHON_USEDEP}]
+       dev-python/requests[${PYTHON_USEDEP}]
        dev-python/send2trash[${PYTHON_USEDEP}]
        recording? (
                media-sound/lame
@@ -37,24 +40,18 @@ RDEPEND="${PYTHON_DEPS}
        )"
 DEPEND=""
 
+PATCHES=( "${FILESDIR}"/${P}-web-folder.patch )
+
 pkg_setup() {
        python-single-r1_pkg_setup
 }
 
 src_prepare() {
+       default
        sed -i -e "s/updates=True/updates=False/" \
                aqt/profiles.py || die
 }
 
-# Nothing to configure or compile
-src_configure() {
-       :;
-}
-
-src_compile() {
-       :;
-}
-
 src_install() {
        cp tools/runanki.system tools/anki
        doicon ${PN}.png
@@ -68,4 +65,9 @@ src_install() {
        # Localization files go into the anki directory:
        python_moduleinto anki
        python_domodule locale
+
+       # not sure if this is correct, but
+       # site-packages/aqt/mediasrv.py wants the directory
+       python_moduleinto aqt
+       python_domodule 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
new file mode 100644 (file)
index 0000000..521a2ed
--- /dev/null
@@ -0,0 +1,11 @@
+--- anki-2.1.0beta25/aqt/mediasrv.py
++++ anki-2.1.0beta25/aqt/mediasrv.py
+@@ -13,7 +13,7 @@
+ # locate web folder in source/binary distribution
+ def _getExportFolder():
+     # running from source?
+-    srcFolder = os.path.join(os.path.dirname(__file__), "..")
++    srcFolder = os.path.dirname(__file__)
+     webInSrcFolder = os.path.abspath(os.path.join(srcFolder, "web"))
+     if os.path.exists(webInSrcFolder):
+         return webInSrcFolder