Commit: abb30cc2e10b9520943983829bb30a1af8cd35de Parent: dac350275c4500e776d7b86585b007b5d0738279 Author: 0x766F6964 Date: Tue, 29 Dec 2020 23:46:47 -0700 add anki ebuild with fixed mpv args patch Diffstat:
A | app-misc/anki/Manifest | | | 1 | + |
A | app-misc/anki/anki-2.1.15.ebuild | | | 93 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | app-misc/anki/files/anki-2.1.0_beta25-web-folder.patch | | | 11 | +++++++++++ |
A | app-misc/anki/files/anki-2.1.15-mpv-args.patch | | | 14 | ++++++++++++++ |
A | app-misc/anki/metadata.xml | | | 21 | +++++++++++++++++++++ |
5 files changed, 140 insertions(+), 0 deletions(-)
diff --git a/app-misc/anki/Manifest b/app-misc/anki/Manifest @@ -0,0 +1 @@ +DIST anki-2.1.15.tgz 4269571 BLAKE2B 00b351f5ffacb363642e02bf806bcd7c0d9446c9815a75328e7fa37c848b271b135510de17cc012e8cc96d8a52a183a49de84b6f85f562a370255bd36c6f866e SHA512 f3acfa6ff62d43fa461efddd81a8570304ada53b97bd494fdbbe0a0439700d7a52aa62ead31cbaed731be0df96a6cc845a7cf92dcf65f3080dc63282fe5941c3 diff --git a/app-misc/anki/anki-2.1.15.ebuild b/app-misc/anki/anki-2.1.15.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8} ) +PYTHON_REQ_USE="sqlite" + +inherit desktop optfeature 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/archive/${P}-source.tgz -> ${P}.tgz" + +LICENSE="AGPL-3+ BSD MIT GPL-3+ CC-BY-SA-3.0 Apache-2.0 CC-BY-2.5" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" +RESTRICT="!test? ( test )" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS} + $(python_gen_cond_dep ' + >=dev-python/PyQt5-5.12[gui,svg,widgets,${PYTHON_MULTI_USEDEP}] + >=dev-python/PyQtWebEngine-5.12[${PYTHON_MULTI_USEDEP}] + >=dev-python/httplib2-0.7.4[${PYTHON_MULTI_USEDEP}] + dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}] + dev-python/decorator[${PYTHON_MULTI_USEDEP}] + dev-python/jsonschema[${PYTHON_MULTI_USEDEP}] + dev-python/markdown[${PYTHON_MULTI_USEDEP}] + dev-python/requests[${PYTHON_MULTI_USEDEP}] + dev-python/send2trash[${PYTHON_MULTI_USEDEP}] + ') +" +BDEPEND="test? ( + ${RDEPEND} + $(python_gen_cond_dep ' + dev-python/nose[${PYTHON_MULTI_USEDEP}] + dev-python/mock[${PYTHON_MULTI_USEDEP}] + ') + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.1.15-mpv-args.patch + "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch +) + +src_prepare() { + default + sed -i -e "s/updates=True/updates=False/" \ + aqt/profiles.py || die +} + +src_compile() { + :; +} + +src_test() { + sed -e "s:nose=nosetests$:nose=\"${EPYTHON} ${EROOT}/usr/bin/nosetests\":" \ + -i tools/tests.sh || die + sed -e "s:nose=nosetests3$:nose=\"${EPYTHON} ${EROOT}/usr/bin/nosetests3\":" \ + -i tools/tests.sh || die + sed -e "s:which nosetests3:which ${EROOT}/usr/bin/nosetests3:" \ + -i tools/tests.sh || die + ./tools/tests.sh || die +} + +src_install() { + doicon ${PN}.png + domenu ${PN}.desktop + doman ${PN}.1 + + dodoc README.md README.development + python_domodule aqt anki + python_newscript runanki anki + + # 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 + insinto /usr/share/anki + doins -r web +} + +pkg_postinst() { + xdg_pkg_postinst + optfeature "LaTeX in cards" "app-text/texlive app-text/dvipng" + optfeature "Record sound" "dev-python/pyaudio media-sound/lame" + optfeature "Playback sound" media-video/mpv media-video/mplayer +} 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/files/anki-2.1.15-mpv-args.patch b/app-misc/anki/files/anki-2.1.15-mpv-args.patch @@ -0,0 +1,14 @@ +--- a/anki/mpv.py ++++ b/anki/mpv.py +@@ -104,9 +104,9 @@ class MPVBase: + """ + self.argv = [self.executable] + self.argv += self.default_argv +- self.argv += ["--input-ipc-server", self._sock_filename] ++ self.argv += ["--input-ipc-server="+self._sock_filename] + if self.window_id is not None: +- self.argv += ["--wid", str(self.window_id)] ++ self.argv += ["--wid="+str(self.window_id)] + + def _start_process(self): + """Start the mpv process. diff --git a/app-misc/anki/metadata.xml b/app-misc/anki/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>patrick@gentoo.org</email> + <name>Patrick Lauer</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>