commit:     652f1f91099896c2102d207baf234c25215ffb83
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Wed Jun  7 19:21:27 2023 +0000
Commit:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Wed Jun  7 19:22:19 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=652f1f91

app-misc/anki-bin: add optfeatures

Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>

 app-misc/anki-bin/anki-bin-2.1.65.ebuild | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/app-misc/anki-bin/anki-bin-2.1.65.ebuild 
b/app-misc/anki-bin/anki-bin-2.1.65.ebuild
index b51a7de8d..00ce197ea 100644
--- a/app-misc/anki-bin/anki-bin-2.1.65.ebuild
+++ b/app-misc/anki-bin/anki-bin-2.1.65.ebuild
@@ -9,7 +9,7 @@ EAPI=8
 # The configuration with Python 3.{10,11} was tested on a limited number of 
machines and is not guaranteed to work.
 
 PYTHON_COMPAT=( python3_{10..11} )
-inherit desktop python-single-r1 pypi xdg
+inherit desktop optfeature python-single-r1 pypi xdg
 
 MY_PN=${PN%-bin}
 DESCRIPTION="A spaced-repetition memory training program (flash cards)"
@@ -76,3 +76,18 @@ src_install() {
        newmenu "${DISTDIR}"/${P}.desktop ${MY_PN}.desktop
        newman "${DISTDIR}"/${P}.1 ${MY_PN}.1
 }
+
+pkg_postinst() {
+       xdg_pkg_postinst
+       optfeature "LaTeX in cards" "app-text/texlive[extra] app-text/dvipng"
+       optfeature "sound support" media-video/mpv media-video/mplayer
+       if use qt6; then
+               ewarn "Recording support is broken for Qt6 until 
dev-qt/multimedia"
+               ewarn "implements support for ALSA or PulseAudio."
+               ewarn "Consider running Anki with Qt5 if you need recordings."
+       else
+               optfeature "recording support" "media-sound/lame[frontend] 
dev-python/PyQt5[multimedia]"
+       fi
+       einfo "You can customize the LaTeX header for your cards to fit your 
needs:"
+       einfo "Notes > Manage Note Types > Options"
+}

Reply via email to