Adding anki anki-qt5

This commit is contained in:
windowsboy111
2023-01-03 15:36:55 +08:00
parent 15bae78f67
commit 67176062ac
9 changed files with 199 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
diff -uNr anki-2.1.55.old/qt/aqt/qt/__init__.py anki-2.1.55/qt/aqt/qt/__init__.py
--- anki-2.1.55.old/qt/aqt/qt/__init__.py 2023-01-02 18:34:13.716216913 +0800
+++ anki-2.1.55/qt/aqt/qt/__init__.py 2023-01-02 18:34:00.410033708 +0800
@@ -9,16 +9,7 @@
import traceback
from typing import Callable, TypeVar, Union
-try:
- import PyQt6
-except:
- from .qt5 import * # type: ignore
-else:
- if not os.getenv("DISABLE_QT5_COMPAT"):
- print("Running with temporary Qt5 compatibility shims.")
- print("Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.")
- from . import qt5_compat # needs to be imported first
- from .qt6 import *
+from .qt5 import * # type: ignore
from anki.utils import is_mac, is_win
+17
View File
@@ -0,0 +1,17 @@
diff -uNr anki-2.1.55.old/qt/aqt/profiles.py anki-2.1.55/qt/aqt/profiles.py
--- anki-2.1.55.old/qt/aqt/profiles.py 2023-01-02 18:35:44.574467892 +0800
+++ anki-2.1.55/qt/aqt/profiles.py 2023-01-02 18:34:00.412033736 +0800
@@ -77,11 +77,11 @@
metaConf = dict(
ver=0,
- updates=True,
+ updates=False,
created=int_time(),
id=random.randrange(0, 2**63),
lastMsg=-1,
- suppressUpdate=False,
+ suppressUpdate=True,
firstRun=True,
defaultLang=None,
)
+6
View File
@@ -0,0 +1,6 @@
project "pkg" {
rpm {
spec = "anki-qt5.spec"
update = ""
}
}
+62
View File
@@ -0,0 +1,62 @@
Name: anki-qt5
Version: 2.1.55
Release: %autorelease
Summary: Flashcard program for using space repetition learning
License: AGPLv3+ and GPLv3+ and LGPLv3 and MIT and BSD and ASL 2.0 and CC-BY-SA and CC-BY
URL: https://apps.ankiweb.net/
BuildRequires: python3-devel python3-setuptools python3-beautifulsoup4 python3-waitress python3-decorator python3-markdown python3-protobuf python3-pysocks
BuildRequires: python3-distro python3-flask-cors python3-jsonschema python3-requests python3-send2trash python3-certifi python3-pyqt5-sip python3-simplejson
BuildRequires: desktop-file-utils libappstream-glib python3-installer make xdg-utils
BuildRequires: cargo git rsync ninja-build libxcrypt-compat nodejs python3.9 python-unversioned-command
Requires: hicolor-icon-theme python3-sqlalchemy python3-simplejson python3-matplotlib python3-decorator python3-markdown python3-send2trash
Requires: python3-requests python3-pygame python3-beautifulsoup4 python3-httplib2 python3-pyaudio python3-jsonschema sox libxcrypt-compat
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
Patch0: 0001-Force-qt5.patch
Patch1: 0001-No-update.patch
BuildArch: noarch
Conflicts: anki
%description
Anki is a program designed to help you remember facts (such as words
and phrases in a foreign language) as easily, quickly and efficiently
as possible. Anki is based on a theory called spaced repetition.
%prep
git clone https://github.com/ankitects/anki .
git checkout %{version}
%patch0 -p1
%patch1 -p1
# See https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=anki
%build
./tools/build
%install
for file in out/wheels/*.whl; do
python -m installer --destdir="%{buildroot}" $file
done
install -Dm644 qt/bundle/lin/anki.desktop %{buildroot}/%{_datadir}/applications/anki.desktop
install -Dm644 qt/bundle/lin/anki.png %{buildroot}/%{_datadir}/pixmaps/anki.png
sed "s*^#!/usr/bin/python\$*#!/usr/bin/python3*" %{buildroot}/%{_bindir}/anki > %{buildroot}/%{_bindir}/anki
%files
%license LICENSE*
%doc README*
%{_bindir}/anki
%{_datadir}/applications/anki.desktop
/usr/lib64/python*/site-packages/aqt/
/usr/lib64/python*/site-packages/aqt-%{version}.dist-info/
/usr/lib64/python*/site-packages/_aqt/
/usr/lib64/python*/site-packages/_aqt-%{version}.dist-info/
/usr/lib64/python*/site-packages/anki/
/usr/lib64/python*/site-packages/anki-%{version}.dist-info/
/usr/share/pixmaps/anki.png
%changelog
* Tue Jan 3 2023 windowsboy111 <windowsboy111@fyralabs.com>
- Initial package
+1
View File
@@ -0,0 +1 @@
rpm.version(gh("ankitects/anki"));
+17
View File
@@ -0,0 +1,17 @@
diff -uNr anki-2.1.55.old/qt/aqt/profiles.py anki-2.1.55/qt/aqt/profiles.py
--- anki-2.1.55.old/qt/aqt/profiles.py 2023-01-02 18:35:44.574467892 +0800
+++ anki-2.1.55/qt/aqt/profiles.py 2023-01-02 18:34:00.412033736 +0800
@@ -77,11 +77,11 @@
metaConf = dict(
ver=0,
- updates=True,
+ updates=False,
created=int_time(),
id=random.randrange(0, 2**63),
lastMsg=-1,
- suppressUpdate=False,
+ suppressUpdate=True,
firstRun=True,
defaultLang=None,
)
+6
View File
@@ -0,0 +1,6 @@
project "pkg" {
rpm {
spec = "anki.spec"
update = ""
}
}
+69
View File
@@ -0,0 +1,69 @@
Name: anki
Version: 2.1.55
Release: %autorelease
Summary: Flashcard program for using space repetition learning
License: AGPLv3+ and GPLv3+ and LGPLv3 and MIT and BSD and ASL 2.0 and CC-BY-SA and CC-BY
URL: https://apps.ankiweb.net/
BuildRequires: python3-devel python3-setuptools python3-beautifulsoup4 python3-waitress python3-decorator python3-markdown python3-protobuf python3-pysocks
BuildRequires: python3-distro python3-flask-cors python3-jsonschema python3-requests python3-send2trash python3-certifi python3-pyqt5-sip python3-simplejson
BuildRequires: desktop-file-utils libappstream-glib python3-installer make xdg-utils mold
BuildRequires: cargo git rsync ninja-build libxcrypt-compat nodejs python3.9 python-unversioned-command
Requires: hicolor-icon-theme python3-sqlalchemy python3-simplejson python3-matplotlib python3-decorator python3-markdown python3-send2trash
Requires: python3-requests python3-pygame python3-beautifulsoup4 python3-httplib2 python3-pyaudio python3-jsonschema sox libxcrypt-compat
BuildArch: noarch
ExclusiveArch: %{qt6_qtwebengine_arches} noarch
Conflicts: anki-qt5
Patch0: 0001-No-update.patch
%description
Anki is a program designed to help you remember facts (such as words
and phrases in a foreign language) as easily, quickly and efficiently
as possible. Anki is based on a theory called spaced repetition.
%prep
git clone https://github.com/ankitects/anki .
git checkout %{version}
%patch0 -p1
%patch1 -p1
cat > .cargo/config.toml << EOF
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]
EOF
# See https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=anki
%build
./tools/build
%install
for file in out/wheels/*.whl; do
python -m installer --destdir="%{buildroot}" $file
done
install -Dm644 qt/bundle/lin/anki.desktop %{buildroot}/%{_datadir}/applications/anki.desktop
install -Dm644 qt/bundle/lin/anki.png %{buildroot}/%{_datadir}/pixmaps/anki.png
sed "s*^#!/usr/bin/python\$*#!/usr/bin/python3*" %{buildroot}/%{_bindir}/anki > %{buildroot}/%{_bindir}/anki
find %{buildroot} -iname __pycache__ | xargs -r rm -rf
find %{buildroot} -iname direct_url.json | xargs -r rm -rf
%files
%license LICENSE*
%doc README*
%{_bindir}/anki
%{_datadir}/applications/anki.desktop
/usr/lib64/python*/site-packages/aqt/
/usr/lib64/python*/site-packages/aqt-%{version}.dist-info/
/usr/lib64/python*/site-packages/_aqt/
/usr/lib64/python*/site-packages/_aqt-%{version}.dist-info/
/usr/lib64/python*/site-packages/anki/
/usr/lib64/python*/site-packages/anki-%{version}.dist-info/
/usr/share/pixmaps/anki.png
%changelog
* Tue Jan 3 2023 windowsboy111 <windowsboy111@fyralabs.com>
- Initial package
+1
View File
@@ -0,0 +1 @@
rpm.version(gh("ankitects/anki"));