summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexBocken2023-05-24 12:51:20 +0200
committerAlexBocken2023-05-24 12:51:20 +0200
commita194ee177a6c3659511ed0171eaebf4c3f87c274 (patch)
tree9e167e23a8dbab6084e8d726554fdcd50bce9c22
parent5897cce2eeffeb99c7c217958d5f5edfbaf07cde (diff)
downloadaur-a194ee177a6c3659511ed0171eaebf4c3f87c274.tar.gz
bump to 2.1.64, major PKGBUILD overhaul
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD110
-rw-r--r--anki-qt5.changelog34
-rw-r--r--disable-git-checks.patch29
-rw-r--r--optimize_more.patch11
-rw-r--r--strip-formatter-deps.patch9
-rw-r--r--strip-type-checking-deps.patch23
7 files changed, 185 insertions, 54 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 04d059ea1c1f..8097b235170a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = anki-qt5
pkgdesc = Helps you remember facts (like words/phrases in a foreign language) - Qt5 Build
- pkgver = 2.1.63
- pkgrel = 2
+ pkgver = 2.1.64
+ pkgrel = 1
url = https://apps.ankiweb.net/
+ changelog = anki-qt5.changelog
arch = x86_64
license = AGPL3
makedepends = rsync
@@ -10,6 +11,7 @@ pkgbase = anki-qt5
makedepends = ninja
makedepends = cargo
makedepends = python-installer
+ makedepends = python-wheel
makedepends = libxcrypt-compat
makedepends = nodejs
makedepends = yarn
@@ -39,14 +41,21 @@ pkgbase = anki-qt5
conflicts = anki-bin
conflicts = anki-git
conflicts = anki-official-binary-bundle
- source = anki-qt5::git+https://github.com/ankitects/anki#tag=064ea0ee08715edae868b84e48b29bd7e15d7b49?signed
+ source = anki-qt5-2.1.64.tar.gz::https://github.com/ankitects/anki/archive/refs/tags/2.1.64.tar.gz
+ source = anki-core-i18n-150aac792e07cfeeea50202b50c226c0fa4b32e2.tar.gz::https://github.com/ankitects/anki-core-i18n/archive/150aac792e07cfeeea50202b50c226c0fa4b32e2.tar.gz
+ source = anki-desktop-ftl-e2d2a9ebfaa83ff648063bd95140546179e7471b.tar.gz::https://github.com/ankitects/anki-desktop-ftl/archive/e2d2a9ebfaa83ff648063bd95140546179e7471b.tar.gz
+ source = disable-git-checks.patch
source = no-update.patch
- source = optimize_more.patch
+ source = strip-formatter-deps.patch
+ source = strip-type-checking-deps.patch
source = force_qt5.patch
- validpgpkeys = 814EA4E90C34AF39A712DE703F5566A2D16899FB
- sha256sums = SKIP
+ sha256sums = 5ff8c17e599b593af38beed35e18a8ac68da0c012d79e11a0b3105151c3ea21a
+ sha256sums = 8f1b83b7097fc7e28227da1758b5fabddc6c2d9ce6b53e24a16499f9c51aafb1
+ sha256sums = fc87b61397ad4c5e2bf155d9f2c5bc8d122f68996f4872d0f0cff803f84d9586
+ sha256sums = 89f1d00764e0f151600f6a21d7ced4289b3ce3f900ded40fe5da95e658fc9db4
sha256sums = f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807
- sha256sums = 213a7c6ab75dc332e79f089364f10bc7fe0c0bb6860a549a42b7e3d75970bc7d
+ sha256sums = 9858fefa254812980d252b29fc6f32bd19bb83ee7e5a96d72c707626ed5193a7
+ sha256sums = 0df3992e007564433c1f4995959d0023b8ed238a36d4dc345d7626cca1c515e1
sha256sums = c5e6e1b2ed7999e9ef7f855aed4c97c4ace846237421507f408a64a8258a09fd
pkgname = anki-qt5
diff --git a/PKGBUILD b/PKGBUILD
index 259f22692460..3fa5eba5dd0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,9 +7,8 @@
# Contributor: Dave Pretty <david dot pretty at gmail dot com>
pkgname=anki-qt5
-pkgver=2.1.63
-_tag=064ea0ee08715edae868b84e48b29bd7e15d7b49 #git rev-parse $pkgver
-pkgrel=2
+pkgver=2.1.64
+pkgrel=1
pkgdesc="Helps you remember facts (like words/phrases in a foreign language) - Qt5 Build"
url="https://apps.ankiweb.net/"
license=('AGPL3')
@@ -45,7 +44,8 @@ makedepends=(
'git'
'ninja'
'cargo'
- 'python-installer'
+ 'python-installer' # TODO: could use either wheel or installer, both are not needed afaik
+ 'python-wheel'
'libxcrypt-compat'
'nodejs'
'yarn'
@@ -57,60 +57,98 @@ optdepends=(
'mplayer: play sound'
'texlive-most: render LaTex in cards'
)
-
-# using the tag tarballs does not work with the new (>= 2.1.55) build process.
-# the '.git' folder is not included in those but is required for a sucessful build
-source=("$pkgname::git+https://github.com/ankitects/anki#tag=${_tag}?signed"
-"no-update.patch"
-"optimize_more.patch"
-"force_qt5.patch"
+changelog="$pkgname.changelog"
+# (adjust in respective functions as well)
+# anki -> git rev-parse $pkgver --short=8
+# ftl -> git submodule
+_tag_ftl_core="150aac792e07cfeeea50202b50c226c0fa4b32e2"
+_tag_ftl_desktop="e2d2a9ebfaa83ff648063bd95140546179e7471b"
+source=("$pkgname-$pkgver.tar.gz::https://github.com/ankitects/anki/archive/refs/tags/${pkgver}.tar.gz"
+ "anki-core-i18n-${_tag_ftl_core}.tar.gz::https://github.com/ankitects/anki-core-i18n/archive/${_tag_ftl_core}.tar.gz"
+ "anki-desktop-ftl-${_tag_ftl_desktop}.tar.gz::https://github.com/ankitects/anki-desktop-ftl/archive/${_tag_ftl_desktop}.tar.gz"
+ "disable-git-checks.patch"
+ "no-update.patch"
+ "strip-formatter-deps.patch"
+ "strip-type-checking-deps.patch"
+ "force_qt5.patch"
)
-sha256sums=('SKIP'
-'f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807'
-'213a7c6ab75dc332e79f089364f10bc7fe0c0bb6860a549a42b7e3d75970bc7d'
-'c5e6e1b2ed7999e9ef7f855aed4c97c4ace846237421507f408a64a8258a09fd'
+sha256sums=('5ff8c17e599b593af38beed35e18a8ac68da0c012d79e11a0b3105151c3ea21a'
+ '8f1b83b7097fc7e28227da1758b5fabddc6c2d9ce6b53e24a16499f9c51aafb1'
+ 'fc87b61397ad4c5e2bf155d9f2c5bc8d122f68996f4872d0f0cff803f84d9586'
+ '89f1d00764e0f151600f6a21d7ced4289b3ce3f900ded40fe5da95e658fc9db4'
+ 'f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807'
+ '9858fefa254812980d252b29fc6f32bd19bb83ee7e5a96d72c707626ed5193a7'
+ '0df3992e007564433c1f4995959d0023b8ed238a36d4dc345d7626cca1c515e1'
+ 'c5e6e1b2ed7999e9ef7f855aed4c97c4ace846237421507f408a64a8258a09fd'
)
-validpgpkeys=(
- 814EA4E90C34AF39A712DE703F5566A2D16899FB # Anki Signatures <gpg@ankiweb.net>
-)
+prepare() {
+ _yc="$srcdir/yarn-cache"
+ _ch="$srcdir/cargo-cache"
+ _tag_anki="041e098c"
+ _tag_ftl_core="150aac792e07cfeeea50202b50c226c0fa4b32e2"
+ _tag_ftl_desktop="e2d2a9ebfaa83ff648063bd95140546179e7471b"
+ cd "anki-$pkgver"
-prepare(){
- cd "$pkgname"
- # pro-actively prevent "module not found" error
- [ -d ts/node_modules ] && rm -r ts/node_modules
patch -p1 < "$srcdir/force_qt5.patch"
patch -p1 < "$srcdir/no-update.patch"
- patch -p1 < "$srcdir/optimize_more.patch"
+ patch -p1 < "$srcdir/strip-formatter-deps.patch"
+ patch -p1 < "$srcdir/strip-type-checking-deps.patch"
+ patch -p1 < "$srcdir/disable-git-checks.patch"
+ sed -i 's/opt-level = 1$/opt-level= 3/' Cargo.toml # optimize more
+ sed -i 's/channel = [0-9\.]*$/channel = "stable"/' rust-toolchain.toml # use most recent stable rust toolchain
+ # Build process wants .git/HEAD to be present. Workaround to be able to use tarballs
+ # (together with disable-git-checks.patch)
+ mkdir -p .git
+ touch .git/HEAD
+ sed "s/MY_REV/${_tag_anki}/" -i build/runner/src/build.rs
+
+ # place translations in build dir
+ rm -r "$srcdir/anki-$pkgver/ftl/core-repo" "$srcdir/anki-$pkgver/ftl/qt-repo"
+ ln -sT "${srcdir}"/anki-core-i18n-${_tag_ftl_core} "$srcdir/anki-$pkgver/ftl/core-repo"
+ ln -sT "${srcdir}"/anki-desktop-ftl-${_tag_ftl_desktop} "$srcdir/anki-$pkgver/ftl/qt-repo"
+
+ # fetch rust packages
+ export CARGO_HOME="$_ch" # do not litter in ~
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
-}
+ # fetch node packages already in prepare()
+ export YARN_CACHE_FOLDER="$_yc" # do not litter in ~
+ yarn install --immutable --modules-folder out/node_modules --ignore-scripts
+ ln -sf out/node_modules ./
+
+}
build() {
- cd "$pkgname"
+ _yc="$srcdir/yarn-cache"
+ _ch="$srcdir/cargo-cache"
+ cd "anki-$pkgver"
+
+ export YARN_CACHE_FOLDER="$_yc" # do not litter in ~
+ yarn run --offline postinstall
+
+ # mask pip-sync as we provide dependencies ourselves
+ local venv="$srcdir/$pkgname-$pkgver/out/pyenv"
+ python -m venv --system-site-packages --without-pip "$venv"
+ printf '#!/bin/bash\nexit 0' > "$venv/bin/pip-sync"
+ chmod +x "$venv/bin/pip-sync"
+
#use local binaries instead of downloading them
export PYTHON_BINARY=$(which python)
export PROTOC_BINARY=$(which protoc)
export NODE_BINARY=$(which node)
export YARN_BINARY=$(which yarn)
- export RELEASE=1
- mold -run ./ninja wheels # use mold as linker to allow for LTO
-}
-
-pkgver(){
- cd "$pkgname"
- git describe
+ export CARGO_HOME="$_ch" # do not litter in ~
+ export RELEASE=1 # anki-internal variable for optimization
+ mold -run ./ninja wheels -v # use mold as linker to allow for LTO
}
package() {
- cd "$pkgname"
+ cd "anki-$pkgver"
for file in out/wheels/*.whl; do
python -m installer --destdir="$pkgdir" $file
done
install -Dm644 qt/bundle/lin/anki.desktop "$pkgdir"/usr/share/applications/anki.desktop
install -Dm644 qt/bundle/lin/anki.png "$pkgdir"/usr/share/pixmaps/anki.png
- # TODO: verify whether still required
- find $pkgdir -iname __pycache__ | xargs -r rm -rf
- find $pkgdir -iname direct_url.json | xargs -r rm -rf
}
diff --git a/anki-qt5.changelog b/anki-qt5.changelog
new file mode 100644
index 000000000000..6e45370911d3
--- /dev/null
+++ b/anki-qt5.changelog
@@ -0,0 +1,34 @@
+# 2.1.64-1
+Functional changes:
+
+ * The Windows installer no longer requires admin access (thanks to Martin). The first time you update, you'll need to run the installer again after uninstall completes.
+ * Allow the user to configure answer keys in the preferences, fixing conflicts (thanks to Ren).
+ * Preload embedded fonts to prevent flicker, and tweak wait time for image preloading (thanks to Hikaru).
+ * Add the ability to search for FSRS scheduling properties, eg. prop:cdn:d>0.5 to search for the difficulty > 0.5.
+ * Window positions, state and browser headers are now reset each time the Qt version changes, which should fix a number of crashes that users were reporting.
+ * Add-on shortcuts will now override Anki defaults (thanks to Ren).
+
+Fixes:
+
+ * Fix media files being imported incorrectly when importing an .apkg file exported without support for older Anki versions.
+ * Increase the number of supported fields in the editor (thanks to Hikaru).
+ * Attempt to work around intermittent color setting failures in Qt6.5 on macOS.
+ * Fix ugly text rendering on Wayland when using fractional scaling.
+ * Fix inability to import csv when path contains single quote.
+ * Show an error pop-up when csv import screen fails to load.
+ * Don't disable animations on card templates when reduce motion is on.
+ * Fix an error in the console when resizing windows (thanks to Austin)
+ * Fix a panic when user sets a huge learning step.
+ * Fix page scrolling when input box loses focus (thanks to Hikaru).
+ * Fix failure to start on Windows when path contains non-Latin text.
+ * Fix due/ivl prop queries not working in filtered decks.
+ * Make some collection methods public in the Rust API (thanks to Joel).
+
+PKGBUILD changes:
+ * major overhaul. All fetching is now done in prepare() the latest. build() can be run offline
+ * moved back to tarballs, patching .git folder manually
+ * all typecheck/formatting dependencies are stripped out as this is only required for development
+ * pip-sync is masked during build as we provide dependencies ourselves
+ * we use the most recent stable rust toolchain in the build
+ * yarn and cargo store their cache in $srcdir, a `yay/paru -Sc` will now more reliably reset the build environment
+ * added this changelog
diff --git a/disable-git-checks.patch b/disable-git-checks.patch
new file mode 100644
index 000000000000..9c8f719e8a01
--- /dev/null
+++ b/disable-git-checks.patch
@@ -0,0 +1,29 @@
+We provide source tarballs without git functionality.
+'MY_REV' gets replaced with the corresponding revision in src_prepare.
+--- a/build/ninja_gen/src/git.rs
++++ b/build/ninja_gen/src/git.rs
+@@ -13,7 +13,7 @@ pub struct SyncSubmodule {
+
+ impl BuildAction for SyncSubmodule {
+ fn command(&self) -> &str {
+- "git -c protocol.file.allow=always submodule update --init $path"
++ "true"
+ }
+
+ fn files(&mut self, build: &mut impl build::FilesHandle) {
+--- a/build/runner/src/build.rs
++++ b/build/runner/src/build.rs
+@@ -161,12 +161,7 @@ fn maybe_update_buildhash(build_root: &Utf8Path) {
+ }
+
+ fn get_buildhash() -> String {
+- let output = Command::new("git")
+- .args(["rev-parse", "--short=8", "HEAD"])
+- .output()
+- .expect("git");
+- assert!(output.status.success(), "git failed");
+- String::from_utf8(output.stdout).unwrap().trim().into()
++ String::from("MY_REV").trim().into()
+ }
+
+ fn write_if_changed(path: &Utf8Path, contents: &str) {
diff --git a/optimize_more.patch b/optimize_more.patch
deleted file mode 100644
index bf5cd0105e8e..000000000000
--- a/optimize_more.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -37,7 +37,7 @@
- debug = 0
-
- [profile.dev.package.runner]
--opt-level = 1
-+opt-level = 3
-
- # Debug info off by default, which speeds up incremental builds and produces a considerably
- # smaller library.
diff --git a/strip-formatter-deps.patch b/strip-formatter-deps.patch
new file mode 100644
index 000000000000..1f65cb251264
--- /dev/null
+++ b/strip-formatter-deps.patch
@@ -0,0 +1,9 @@
+ Remove dependency on dev-python/black used to format the generated hooks.py
+ file as it's not relevant in a packaging use case.
+--- a/pylib/tools/hookslib.py
++++ b/pylib/tools/hookslib.py
+@@ -208,4 +208,3 @@ def write_file(path: str, hooks: list[Hook], prefix: str, suffix: str):
+ os.environ["USERPROFILE"] = os.environ["HOME"]
+ with open(path, "wb") as file:
+ file.write(code.encode("utf8"))
+- subprocess.run([sys.executable, "-m", "black", "-q", path], check=True)
diff --git a/strip-type-checking-deps.patch b/strip-type-checking-deps.patch
new file mode 100644
index 000000000000..36b08b2931d6
--- /dev/null
+++ b/strip-type-checking-deps.patch
@@ -0,0 +1,23 @@
+We don't do type checking (via mypy and related) downstream.
+Mypy-protobuf generates mypy stub files from protobuf specs and should
+therefore be stripped.
+--- a/build/configure/src/python.rs
++++ b/build/configure/src/python.rs
+@@ -86,9 +86,7 @@ pub struct GenPythonProto {
+ impl BuildAction for GenPythonProto {
+ fn command(&self) -> &str {
+ "$protoc $
+- --plugin=protoc-gen-mypy=$protoc-gen-mypy $
+ --python_out=$builddir/pylib $
+- --mypy_out=$builddir/pylib $
+ -Iproto $in"
+ }
+
+@@ -106,7 +104,6 @@ impl BuildAction for GenPythonProto {
+ .collect();
+ build.add_inputs("in", &self.proto_files);
+ build.add_inputs("protoc", inputs!["$protoc_binary"]);
+- build.add_inputs("protoc-gen-mypy", inputs![":pyenv:protoc-gen-mypy"]);
+ build.add_outputs("", python_outputs);
+ }
+ }