commit: f5244e76931f2732e6c7690877aee447104a1698
parent: 957d853e778ed81a7587d66d00acbb485fdc70cb
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 30 Jan 2019 09:41:56 +0100
app-misc/anki: New Package, based on ::gentoo
Diffstat:
4 files changed, 90 insertions(+), 0 deletions(-)
diff --git a/app-misc/anki/Manifest b/app-misc/anki/Manifest
@@ -0,0 +1 @@
+DIST anki-2.1.8-source.tgz 4212796 BLAKE2B 70290c3edb799c6619466d9e90c4f41e43f57e8bfdf117c654cf0c7b389968d3b1c581b6caa3aa3c43c0877b85901e6d0150220e8e3486055f6e4a6f882c4e4d SHA512 9eed12fe3d63dad492753f8de94e3f8b083b4c5d35601e24e5a419345fba64fa349cb2fc5e7fc7d7cd299d517fb4984eebbeaff28f6be36dfe959217c3a40d1a
diff --git a/app-misc/anki/anki-2.1.8.ebuild b/app-misc/anki/anki-2.1.8.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Copyright 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_6 )
+PYTHON_REQ_USE="sqlite"
+
+inherit eutils python-single-r1 xdg
+
+DESCRIPTION="A spaced-repetition memory training program (flash cards)"
+HOMEPAGE="https://apps.ankiweb.net"
+SRC_URI="https://apps.ankiweb.net/downloads/current/${P}-source.tgz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="latex +recording +sound test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-python/PyQt5[gui,svg,webengine,widgets,${PYTHON_USEDEP}]
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
+ dev-python/decorator[${PYTHON_USEDEP}]
+ dev-python/send2trash[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/markdown[${PYTHON_USEDEP}]
+ recording? (
+ media-sound/lame
+ >=dev-python/pyaudio-0.2.4[${PYTHON_USEDEP}]
+ )
+ sound? ( media-video/mpv )
+ latex? (
+ app-text/texlive
+ app-text/dvipng
+ )
+"
+DEPEND="${RDEPEND}
+ test? ( dev-python/nose[${PYTHON_USEDEP}] )
+"
+
+PATCHES=( "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch )
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ sed -i "s/updates=True/updates=False/" aqt/profiles.py || die
+ sed -i "s;share/doc/anki;share/doc/${P};" Makefile || die
+}
+
+src_compile() {
+ ./tools/build_ui.sh || die
+}
+
+src_test() {
+ sed "s:nosetests:${EPYTHON} ${EROOT}usr/bin/nosetests:" -i tools/tests.sh || die
+ ./tools/tests.sh || die
+}
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
@@ -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.join(os.path.dirname(__file__), "..", "..", "..", "..", "share", "anki")
+ webInSrcFolder = os.path.abspath(os.path.join(srcFolder, "web"))
+ if os.path.exists(webInSrcFolder):
+ return webInSrcFolder
diff --git a/app-misc/anki/metadata.xml b/app-misc/anki/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>contact@hacktivis.me</email>
+ <name>Haelwenn (lanodan) Monnier</name>
+ </maintainer>
+ <longdescription lang="en">
+ Anki is a program designed to help you remember facts
+ (such as words and phrases in a foreign language) as
+ quickly, easily and efficiently as possible.
+ </longdescription>
+ <use>
+ <flag name="recording">Enable support for audio recording</flag>
+ <flag name="sound">Enable support for adding sound to cards</flag>
+ </use>
+</pkgmetadata>