games/anki: Update to 2.1.11, undeprecate and set to BROKEN

Undeprecate and save the port from the big Qt4 wipeout by switching from Qt4
to Qt5.

Also set games/anki temporarily as BROKEN because www/py-qt5-webengine is
still in a defunct state. This will change when www/qt5-webengine gets
updated to a more recent version soon (hopefully to the end of Q1).

At last but not least: Add options to switch between multimedia/mpv (new
default by upstream) and multimedia/mplayer (previous default) or choose both
of them.

Changelog:

Notable changes since 2.0.52:

- Anki 2.1.x uses the same scheduling, syncing and file format as Anki 2.0.x,
  so one can upgrade and downgrade at will.
- Switched from Python 2.7 to Python 3.6+ and from Qt 4 to Qt 5
- Add-ons will need to be updated to work with 2.1.
- Built in MathJax support
- A "restore backup" option in the profiles screen
- SVG rendering support for LaTeX
- Improved add-on configuration, management and updating
- Night mode for reviewing
- Improved pasting, with less unnecessary formatting included, and better
  handling of media links.

https://apps.ankiweb.net/docs/changes.html

PR:		233192
Approved by:	miwi (mentor)
Differential Revision:	https://reviews.freebsd.org/D19564
This commit is contained in:
Kai Knoblich 2019-03-13 17:08:06 +00:00
parent 74449513d8
commit 0f6797f34e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=495620
6 changed files with 724 additions and 604 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= anki
DISTVERSION= 2.0.52
PORTREVISION= 1
DISTVERSION= 2.1.11
CATEGORIES= games python
MASTER_SITES= https://apps.ankiweb.net/downloads/current/
DISTNAME= anki-${PORTVERSION}-source
@ -15,46 +14,51 @@ COMMENT= Flashcard trainer with spaced repetition
LICENSE= AGPLv3+
LICENSE_FILE= ${WRKSRC}/LICENSE
DEPRECATED= Qt4 has been EOL since december 2015
EXPIRATION_DATE= 2019-03-15
BROKEN= Depends on www/py-qt5-webengine that is still broken
RUN_DEPENDS= lame:audio/lame \
mplayer:multimedia/mplayer \
${PYTHON_PKGNAMEPREFIX}pyaudio>0:audio/py-pyaudio@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sqlalchemy10>0:databases/py-sqlalchemy10@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}beautifulsoup32>0:www/py-beautifulsoup32@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}httplib2>0:www/py-httplib2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}send2trash>0:deskutils/py-send2trash@${PY_FLAVOR}
${PYTHON_PKGNAMEPREFIX}decorator>0:devel/py-decorator@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}send2trash>0:deskutils/py-send2trash@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}markdown>0:textproc/py-markdown@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}beautifulsoup>0:www/py-beautifulsoup@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR}
USES= desktop-file-utils pyqt:5 python:3.6+ shebangfix tar:tgz
USE_PYQT= core_run gui_run printsupport_run sip_run webengine_run widgets_run
USES= desktop-file-utils pyqt:4 python:2.7 qt:4 shared-mime-info shebangfix tar:tgz
SHEBANG_FILES= tools/build_ui.sh tools/tests.sh anki/anki runanki
USE_PYQT= network_run webkit_run
USE_QT= network_run webkit_run
NO_ARCH= yes
OPTIONS_DEFINE= NLS
OPTIONS_SUB= yes
NLS_USES= gettext-runtime gettext-tools
SHEBANG_FILES= tools/runanki.system.in
WRKSRC= ${WRKDIR}/anki-${PORTVERSION}
OPTIONS_DEFINE= NLS
OPTIONS_DEFAULT= MPV
OPTIONS_GROUP= PLAYER
OPTIONS_GROUP_PLAYER= MPLAYER MPV
OPTIONS_SUB= yes
MPV_DESC= mpv media player support
MPLAYER_RUN_DEPENDS= mplayer:multimedia/mplayer
MPV_RUN_DEPENDS= mpv:multimedia/mpv
NLS_USES= gettext-runtime gettext-tools
post-patch:
@${REINPLACE_CMD} -i '' 's|/usr/share/anki|${DATADIR}|' \
${WRKSRC}/runanki
@${REINPLACE_CMD} -i '' 's|"qt_" + lang, dir|"qt_" + lang, "${DATADIR}/locale"|' \
${WRKSRC}/aqt/__init__.py
@${REINPLACE_CMD} -i '' \
's|/usr/share/anki/locale|${PREFIX}/share/locale|; \
s|/usr/local/share/anki/bin/locale|${PREFIX}/share/locale|' \
's|%%PREFIX%%|${PREFIX}|' \
${WRKSRC}/anki/lang.py
post-patch-NLS-off:
@${REINPLACE_CMD} -i '' '/mkdir -p qt-locale/,/cp -av locale/s/^/#/' \
@${REINPLACE_CMD} -i '' '/locale/s/^/#/' \
${WRKSRC}/Makefile
do-build:
@${PYTHON_CMD} -m compileall ${WRKSRC}
@${PYTHON_CMD} -O -m compileall ${WRKSRC}
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/tools/runanki.system ${STAGEDIR}${PREFIX}/bin/anki
.include <bsd.port.mk>

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1527786668
SHA256 (python/anki-2.0.52-source.tgz) = d4d8c0dd473b512faa63e167d7bb89592530699d2365f1d3a737a733efeb5e7a
SIZE (python/anki-2.0.52-source.tgz) = 3429625
TIMESTAMP = 1552315387
SHA256 (python/anki-2.1.11-source.tgz) = 787ce3d7333cc3f33f9bd18ec11d4da56b9ac060edaad21d78fe04e04e559265
SIZE (python/anki-2.1.11-source.tgz) = 4229555

View file

@ -1,4 +1,4 @@
--- Makefile.orig 2013-12-09 02:51:52 UTC
--- Makefile.orig 2018-07-27 02:18:05 UTC
+++ Makefile
@@ -1,4 +1,4 @@
-PREFIX=/usr
@ -6,43 +6,39 @@
all:
@echo "You can run Anki with ./runanki"
@@ -6,24 +6,28 @@ all:
@@ -6,19 +6,18 @@ all:
@echo "Uninstall with 'sudo make uninstall'"
install:
- rm -rf ${DESTDIR}${PREFIX}/share/anki
mkdir -p ${DESTDIR}${PREFIX}/share/anki
- cp -av * ${DESTDIR}${PREFIX}/share/anki/
- cd ${DESTDIR}${PREFIX}/share/anki && (\
- mv runanki ${DESTDIR}${PREFIX}/local/bin/anki;\
+ cp -av anki aqt designer oldanki tests tools\
+ ${DESTDIR}${PREFIX}/share/anki/
+ cp -av runanki ${DESTDIR}${PREFIX}/bin/anki
+ mkdir -p ${DESTDIR}${PREFIX}/share/anki/locale/
+ mkdir -p qt-locale/ && mv locale/qt* ./qt-locale/
cp -av anki aqt web ${DESTDIR}${PREFIX}/share/anki/
- -cp -av locale ${DESTDIR}${PREFIX}/share/anki/
+ mkdir -p ${DESTDIR}${PREFIX}/share/anki/locale
+ mkdir -p qt-locale && mv locale/qt* ./qt-locale/
+ cp -av qt-locale/* ${DESTDIR}${PREFIX}/share/anki/locale/
+ mkdir -p ${DESTDIR}${PREFIX}/share/locale/
+ mkdir -p ${DESTDIR}${PREFIX}/share/locale
+ cp -av locale/* ${DESTDIR}${PREFIX}/share/locale/
test -d ${DESTDIR}${PREFIX}/share/pixmaps &&\
- mv anki.xpm anki.png ${DESTDIR}${PREFIX}/share/pixmaps/;\
- mv anki.desktop ${DESTDIR}${PREFIX}/share/applications;\
- mv anki.1 ${DESTDIR}${PREFIX}/share/man/man1/)
- xdg-mime install anki.xml --novendor
- xdg-mime default anki.desktop application/x-anki
- xdg-mime default anki.desktop application/x-apkg
+ cp -av anki.xpm anki.png ${DESTDIR}${PREFIX}/share/pixmaps/
sed -e 's:@PREFIX@:${PREFIX}:' tools/runanki.system.in > tools/runanki.system
- install -m 0755 -D tools/runanki.system ${DESTDIR}${PREFIX}/bin/anki
- install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/pixmaps anki.xpm anki.png
- install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/applications anki.desktop
- install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/man/man1 anki.1
- install -m 0644 -D -t ${DESTDIR}${PREFIX}/share/doc/anki README.contributing README.development README.md LICENSE LICENSE.logo
- -xdg-mime install anki.xml --novendor
- -xdg-mime default anki.desktop application/x-anki
- -xdg-mime default anki.desktop application/x-apkg
+ cp -av anki.xpm anki.png ${DESTDIR}${PREFIX}/share/pixmaps
+ cp -av anki.desktop ${DESTDIR}${PREFIX}/share/applications
+ mkdir -p ${DESTDIR}${PREFIX}/man/man1/
+ mkdir -p ${DESTDIR}${PREFIX}/man/man1
+ cp -av anki.1 ${DESTDIR}${PREFIX}/man/man1/
+ mkdir -p ${DESTDIR}${PREFIX}/share/mime/packages/
+ cp -av anki.xml ${DESTDIR}${PREFIX}/share/mime/packages/
@echo
@echo "Install complete."
uninstall:
rm -rf ${DESTDIR}${PREFIX}/share/anki
- rm -rf ${DESTDIR}${PREFIX}/local/bin/anki
+ rm -rf ${DESTDIR}${PREFIX}/bin/anki
rm -rf ${DESTDIR}${PREFIX}/share/pixmaps/anki.xpm
@@ -29,6 +28,5 @@ uninstall:
rm -rf ${DESTDIR}${PREFIX}/share/pixmaps/anki.png
rm -rf ${DESTDIR}${PREFIX}/share/applications/anki.desktop
rm -rf ${DESTDIR}${PREFIX}/share/man/man1/anki.1
- -xdg-mime uninstall ${DESTDIR}${PREFIX}/share/mime/packages/anki.xml
@echo
@echo "Uninstall complete."

View file

@ -0,0 +1,11 @@
--- anki/lang.py.orig 2018-09-27 01:52:01 UTC
+++ anki/lang.py
@@ -84,7 +84,7 @@ def langDir():
if isMac:
dir = os.path.abspath(filedir + "/../../Resources/locale")
else:
- dir = os.path.join(filedir, "locale")
+ dir = os.path.join(filedir, "%%PREFIX%%/share/locale")
if not os.path.isdir(dir):
dir = os.path.join(os.path.dirname(sys.argv[0]), "locale")
if not os.path.isdir(dir):

View file

@ -0,0 +1,11 @@
--- aqt/qt.py.orig 2019-03-09 22:22:42 UTC
+++ aqt/qt.py
@@ -42,7 +42,7 @@ qtmajor = (QT_VERSION & 0xff0000) >> 16
qtminor = (QT_VERSION & 0x00ff00) >> 8
qtpoint = QT_VERSION & 0xff
-if qtmajor != 5 or qtminor < 9 or qtminor == 10:
+if qtmajor != 5 or qtminor < 9 or qtminor <= 10:
raise Exception("Anki does not support your Qt version.")
# GUI code assumes python 3.6+

File diff suppressed because it is too large Load diff