Skip to content

Commit b9e2680

Browse files
madonukoraboneko
authored andcommitted
fix: anki-bin (#1521)
* fix: anki-bin * fix(update): anki-bin (cherry picked from commit 79a67cf)
1 parent ea91ff0 commit b9e2680

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

anda/apps/anki-bin/anki-bin.spec

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
%global xurl https://files.pythonhosted.org/packages/51/5f/6f52b958fe38a36a0799c01fbd56a742ebdfcf41f89438dbee998b8ce692/anki-24.06.3-cp39-abi3-manylinux_2_28_x86_64.whl
2+
%global aurl https://files.pythonhosted.org/packages/df/bb/b0bfbc6a06a598b0b614d18dd8c4f40827828649f9742f1f44a4e44d6a2c/anki-24.06.3-cp39-abi3-manylinux_2_31_aarch64.whl
3+
%global qurl https://files.pythonhosted.org/packages/21/2a/d8e22a9521be04ef29a30d21a2c3008783ab03b6f07cc14696a040f747a4/aqt-24.06.3-py3-none-any.whl
4+
15
Name: anki-bin
26
Version: 24.06.3
37
Release: 1%?dist
48
Summary: Flashcard program for using space repetition learning (Installed with wheel)
59
License: AGPL-3.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-or-later AND MIT AND BSD-3-Clause AND CC-BY-SA-3.0 AND CC-BY-3.0 AND Apache-2.0 AND CC-BY-2.5
610
URL: https://apps.ankiweb.net/
7-
BuildRequires: python3-pip rpm_macro(fdupes)
11+
BuildRequires: python3-pip rpm_macro(fdupes) cargo
812
Requires: python3-sqlalchemy python3-simplejson python3-matplotlib python3-decorator python3-markdown python3-orjson
913
Requires: python3-requests python3-pygame python3-beautifulsoup4 python3-httplib2 python3-pyaudio python3-jsonschema
1014
Requires: python3-flask-cors python3-protobuf python3-requests python3-waitress python3-pyqt6-webengine python3-send2trash
1115
Requires: libxcrypt-compat hicolor-icon-theme sox mpv
1216
ExclusiveArch: x86_64
1317
Conflicts: anki
14-
Source0: https://files.pythonhosted.org/packages/cp39/a/anki/anki-%{version}-cp39-abi3-manylinux_2_28_%{_arch}.whl
15-
Source1: https://files.pythonhosted.org/packages/py3/a/aqt/aqt-%{version}-py3-none-any.whl
18+
%ifarch x86_64
19+
Source0: %xurl
20+
%elifarch aarch64
21+
Source0: %aurl
22+
%endif
23+
Source1: %qurl
1624
Source2: https://raw.githubusercontent.com/ankitects/anki/%{version}/qt/runanki.py
1725
Source3: https://raw.githubusercontent.com/ankitects/anki/%{version}/qt/bundle/lin/anki.desktop
1826
Source4: https://raw.githubusercontent.com/ankitects/anki/%{version}/qt/bundle/lin/anki.png

anda/apps/anki-bin/update.rhai

+15-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
rpm.version(gh("ankitects/anki"));
1+
let aarch64_regex = `<a href="https://files\.pythonhosted\.org/packages/(..)/(..)/(.{60})/anki-([\d.]+)-cp(\d+)-abi3-manylinux_.+?_aarch64.whl">`;
2+
let html = get("https://pypi.org/project/anki/");
3+
let relevant = find(aarch64_regex, html, 0);
4+
let ver = find(aarch64_regex, relevant, 4);
5+
rpm.version(ver);
6+
if rpm.changed() {
7+
rpm.release();
8+
rpm.global("aurl", find(`"(.+)"`, relevant, 1));
9+
let cp = find(aarch64_regex, relevant, 5);
10+
let x86_64_regex = `<a href="https://files\.pythonhosted\.org/packages/(..)/(..)/(.{60})/anki-${ver}-cp${cp}-abi3-manylinux_.+?_x86_64.whl">`;
11+
let relevant1 = find(x86_64_regex, html, 0);
12+
rpm.global("xurl", find(`"(.+)"`, relevant1, 1));
13+
let qhtml = get("https://pypi.org/project/aqt/");
14+
rpm.global("qurl", find(`<a href="(https://files\.pythonhosted\.org/packages/../../.{60}/aqt-${ver}-py3-none.any.whl)">`, qhtml, 1));
15+
}

0 commit comments

Comments
 (0)