public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-misc/anki/files/, app-misc/anki/
@ 2017-12-18 12:05 Michael Weber
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Weber @ 2017-12-18 12:05 UTC (permalink / raw
  To: gentoo-commits

commit:     f847d777f140a6e6c66d330f1061b068b25b947f
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 18 12:05:37 2017 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 12:05:37 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f847d777

app-misc/anki: Fix dependencies.

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             | 26 ++++++++++++----------
 .../anki/files/anki-2.1.0_beta25-web-folder.patch  | 11 +++++++++
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/app-misc/anki/anki-2.1.0_beta25.ebuild b/app-misc/anki/anki-2.1.0_beta25.ebuild
index ac3413e622b..65fedfcbf81 100644
--- a/app-misc/anki/anki-2.1.0_beta25.ebuild
+++ b/app-misc/anki/anki-2.1.0_beta25.ebuild
@@ -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
index 00000000000..521a2ed3bd8
--- /dev/null
+++ 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.dirname(__file__)
+     webInSrcFolder = os.path.abspath(os.path.join(srcFolder, "web"))
+     if os.path.exists(webInSrcFolder):
+         return webInSrcFolder


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/anki/files/, app-misc/anki/
@ 2017-12-18 12:37 Michael Weber
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Weber @ 2017-12-18 12:37 UTC (permalink / raw
  To: gentoo-commits

commit:     d37027cb86c73ba98658e5e6142a1e044692cd2d
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 18 12:33:27 2017 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 12:33:27 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d37027cb

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 ++++++++++++++++------
 .../anki/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 65fedfcbf81..71268203040 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 521a2ed3bd8..19b196c4ace 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/anki/files/, app-misc/anki/
@ 2021-06-12  9:25 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2021-06-12  9:25 UTC (permalink / raw
  To: gentoo-commits

commit:     267c5a6cdfd2d0e3839118d49598e92ac074d7b0
Author:     Austin Ray <austin <AT> austinray <DOT> io>
AuthorDate: Fri Jun 11 15:10:22 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 12 09:25:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=267c5a6c

app-misc/anki: patch Python 3.9 incompatibility

This commit modifies the existing anki-2.1.15 ebuild with a patch to
replace a deprecated, undocumented method available in Python 3.8[0] but
removed in Python 3.9[1]. Without the patch, anki throws a runtime error
(see bug for more details) as anki 2.1.15 pre-dates Python 3.9.

[0] https://github.com/python/cpython/blob/4844abdd700120120fc76c29d911bcb547700baf/Lib/html/parser.py#L466
[1] https://bugs.python.org/issue37328

Closes: https://bugs.gentoo.org/795309

Signed-off-by: Austin Ray <austin <AT> austinray.io>
Closes: https://github.com/gentoo/gentoo/pull/21200
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/anki/{anki-2.1.15.ebuild => anki-2.1.15-r1.ebuild} |  1 +
 app-misc/anki/files/anki-2.1.15-unescape.patch              | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/app-misc/anki/anki-2.1.15.ebuild b/app-misc/anki/anki-2.1.15-r1.ebuild
similarity index 98%
rename from app-misc/anki/anki-2.1.15.ebuild
rename to app-misc/anki/anki-2.1.15-r1.ebuild
index a1b7dc8c2e7..f97f7bb0fbc 100644
--- a/app-misc/anki/anki-2.1.15.ebuild
+++ b/app-misc/anki/anki-2.1.15-r1.ebuild
@@ -44,6 +44,7 @@ BDEPEND="test? (
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch
 	"${FILESDIR}"/${PN}-2.1.15-mpv-args.patch
+	"${FILESDIR}"/${PN}-2.1.15-unescape.patch
 )
 
 src_prepare() {

diff --git a/app-misc/anki/files/anki-2.1.15-unescape.patch b/app-misc/anki/files/anki-2.1.15-unescape.patch
new file mode 100644
index 00000000000..7b03c8d8e1a
--- /dev/null
+++ b/app-misc/anki/files/anki-2.1.15-unescape.patch
@@ -0,0 +1,13 @@
+diff --git a/aqt/reviewer.py b/aqt/reviewer.py
+index f01fcbd9f..5aaf26669 100644
+--- a/aqt/reviewer.py
++++ b/aqt/reviewer.py
+@@ -359,7 +359,7 @@ Please run Tools>Empty Cards""")
+         cor = stripHTML(cor)
+         # ensure we don't chomp multiple whitespace
+         cor = cor.replace(" ", "&nbsp;")
+-        cor = parser.unescape(cor)
++        cor = html.unescape(cor)
+         cor = cor.replace("\xa0", " ")
+         cor = cor.strip()
+         given = self.typedAnswer


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/anki/files/, app-misc/anki/
@ 2023-06-13 21:29 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-06-13 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     5bd2f4e45cae5ffb8cdab1f2942312b49497e24a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 13 21:28:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 13 21:29:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bd2f4e4

app-misc/anki: update EAPI 7 -> 8, enable py3.11, fix prefs

Thanks to WGH for the backport of the pref fix.

Closes: https://bugs.gentoo.org/869917
Closes: https://bugs.gentoo.org/896566
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/anki/anki-2.1.15-r2.ebuild             | 95 +++++++++++++++++++++++++
 app-misc/anki/files/anki-2.1.15-fix-prefs.patch | 17 +++++
 2 files changed, 112 insertions(+)

diff --git a/app-misc/anki/anki-2.1.15-r2.ebuild b/app-misc/anki/anki-2.1.15-r2.ebuild
new file mode 100644
index 000000000000..ddd50dba0c10
--- /dev/null
+++ b/app-misc/anki/anki-2.1.15-r2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+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_USEDEP}]
+		>=dev-python/PyQtWebEngine-5.12[${PYTHON_USEDEP}]
+		>=dev-python/httplib2-0.7.4[${PYTHON_USEDEP}]
+		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
+		dev-python/decorator[${PYTHON_USEDEP}]
+		dev-python/jsonschema[${PYTHON_USEDEP}]
+		dev-python/markdown[${PYTHON_USEDEP}]
+		dev-python/requests[${PYTHON_USEDEP}]
+		dev-python/send2trash[${PYTHON_USEDEP}]
+	')
+"
+BDEPEND="test? (
+	${RDEPEND}
+	$(python_gen_cond_dep '
+		dev-python/nose[${PYTHON_USEDEP}]
+		dev-python/mock[${PYTHON_USEDEP}]
+		')
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch
+	"${FILESDIR}"/${PN}-2.1.15-mpv-args.patch
+	"${FILESDIR}"/${PN}-2.1.15-unescape.patch
+	"${FILESDIR}"/${PN}-2.1.15-fix-prefs.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} ${BROOT}/usr/bin/nosetests\":" \
+		-i tools/tests.sh || die
+	sed -e "s:nose=nosetests3$:nose=\"${EPYTHON} ${BROOT}/usr/bin/nosetests3\":" \
+		-i tools/tests.sh || die
+	sed -e "s:which nosetests3:which ${BROOT}/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.15-fix-prefs.patch b/app-misc/anki/files/anki-2.1.15-fix-prefs.patch
new file mode 100644
index 000000000000..4f0bb2457dac
--- /dev/null
+++ b/app-misc/anki/files/anki-2.1.15-fix-prefs.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/869917#c3
+https://github.com/ankitects/anki/commit/d2ae874d9e1615d09afc912275cc3b27776a1392
+
+--- a/aqt/preferences.py
++++ b/aqt/preferences.py
+@@ -77,8 +77,8 @@ class Preferences(QDialog):
+             f.hwAccel.setVisible(False)
+         else:
+             f.hwAccel.setChecked(self.mw.pm.glMode() != "software")
+-        f.lrnCutoff.setValue(qc['collapseTime']/60.0)
+-        f.timeLimit.setValue(qc['timeLim']/60.0)
++        f.lrnCutoff.setValue(int(qc['collapseTime']/60.0))
++        f.timeLimit.setValue(int(qc['timeLim']/60.0))
+         f.showEstimates.setChecked(qc['estTimes'])
+         f.showProgress.setChecked(qc['dueCounts'])
+         f.nightMode.setChecked(qc.get("nightMode", False))
+


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-13 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-12  9:25 [gentoo-commits] repo/gentoo:master commit in: app-misc/anki/files/, app-misc/anki/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-06-13 21:29 Sam James
2017-12-18 12:37 Michael Weber
2017-12-18 12:05 Michael Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox