From 0942760694cf1b90a43cca3556913d7f8f7af4b1 Mon Sep 17 00:00:00 2001 From: madomado Date: Mon, 13 Nov 2023 00:04:44 +0800 Subject: [PATCH] fix: anki anki-qt5 (#775) --- anda/apps/anki-qt5/0001-Force-qt5.patch | 16 +++++++------- anda/apps/anki-qt5/0001-No-update.patch | 28 +++++++++++-------------- anda/apps/anki-qt5/anki-qt5.spec | 1 - anda/apps/anki/0001-No-update.patch | 28 +++++++++++-------------- anda/apps/anki/anki.spec | 1 - 5 files changed, 32 insertions(+), 42 deletions(-) diff --git a/anda/apps/anki-qt5/0001-Force-qt5.patch b/anda/apps/anki-qt5/0001-Force-qt5.patch index 586a70e2b4..c4e86bde2a 100644 --- a/anda/apps/anki-qt5/0001-Force-qt5.patch +++ b/anda/apps/anki-qt5/0001-Force-qt5.patch @@ -1,20 +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 @@ +--- a/qt/aqt/qt/__init__.py ++++ b/qt/aqt/qt/__init__.py +@@ -9,16 +9,7 @@ import sys 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"): +- if os.getenv("ENABLE_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 + + # fix buggy ubuntu12.04 display of language selector diff --git a/anda/apps/anki-qt5/0001-No-update.patch b/anda/apps/anki-qt5/0001-No-update.patch index 578c19f79b..7dc6228e2c 100644 --- a/anda/apps/anki-qt5/0001-No-update.patch +++ b/anda/apps/anki-qt5/0001-No-update.patch @@ -1,17 +1,13 @@ -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 @@ +diff --git a/qt/aqt/update.py b/qt/aqt/update.py +index 212ddf93d..6f716cc04 100644 +--- a/qt/aqt/update.py ++++ b/qt/aqt/update.py +@@ -11,6 +11,8 @@ from aqt.utils import openLink, show_warning, showText, tr - 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, - ) + + def check_for_update() -> None: ++ return ++ + from aqt import mw + + def do_check(_col: Collection) -> CheckForUpdateResponse: diff --git a/anda/apps/anki-qt5/anki-qt5.spec b/anda/apps/anki-qt5/anki-qt5.spec index 8c39fe7dd8..5fe763a0ca 100644 --- a/anda/apps/anki-qt5/anki-qt5.spec +++ b/anda/apps/anki-qt5/anki-qt5.spec @@ -22,7 +22,6 @@ 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-qt5 diff --git a/anda/apps/anki/0001-No-update.patch b/anda/apps/anki/0001-No-update.patch index 578c19f79b..7dc6228e2c 100644 --- a/anda/apps/anki/0001-No-update.patch +++ b/anda/apps/anki/0001-No-update.patch @@ -1,17 +1,13 @@ -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 @@ +diff --git a/qt/aqt/update.py b/qt/aqt/update.py +index 212ddf93d..6f716cc04 100644 +--- a/qt/aqt/update.py ++++ b/qt/aqt/update.py +@@ -11,6 +11,8 @@ from aqt.utils import openLink, show_warning, showText, tr - 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, - ) + + def check_for_update() -> None: ++ return ++ + from aqt import mw + + def do_check(_col: Collection) -> CheckForUpdateResponse: diff --git a/anda/apps/anki/anki.spec b/anda/apps/anki/anki.spec index c97abdb967..fef5d04096 100644 --- a/anda/apps/anki/anki.spec +++ b/anda/apps/anki/anki.spec @@ -22,7 +22,6 @@ Anki is based on a theory called spaced repetition. %prep git clone https://github.com/ankitects/anki . git checkout %{version} -%patch 0 -p1 # See https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=anki