Package Details: anki-git r10935.eb597475c-1

Git Clone URL: https://aur.archlinux.org/anki-git.git (read-only, click to copy)
Package Base: anki-git
Description: Helps you remember facts (like words/phrases in a foreign language) efficiently
Upstream URL: hhttps://apps.ankiweb.net/
Keywords: anki memorise memory study
Licenses: AGPL3
Conflicts: anki, anki-official-binary-bundle, anki20
Provides: anki
Submitter: degeberg
Maintainer: DarkShadow44
Last Packager: DarkShadow44
Votes: 25
Popularity: 0.026318
First Submitted: 2017-02-12 11:51 (UTC)
Last Updated: 2024-03-05 19:32 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 .. 12 Next › Last »

tobias.predel commented on 2022-11-27 20:34 (UTC) (edited on 2022-11-27 20:38 (UTC) by tobias.predel)

Anki has recently changed its build system to Ninja.

I applied something like the following changes to adapt the PKGBUILD in compliance with development.md:

diff --git a/PKGBUILD b/PKGBUILD
index 0fbf561..9c7182f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,15 +8,15 @@
 # Contributor: Michael 'manveru' Fellinger <m.fellinger@gmail.com>
 # Contributor: Dave Pretty <david dot pretty at gmail dot com>

 pkgname=anki-git
 pkgver=r9412.bc6ede7c1
 pkgrel=1
 pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
 url="http://ankisrs.net/"
 license=('AGPL3')
 arch=('any')
 provides=('anki')
 conflicts=('anki' 'anki20' 'anki-official-binary-bundle')
 depends=(
     # anki and aqt
     'python-beautifulsoup4'
@@ -36,22 +36,20 @@ depends=(
     'python-markdown'
     'python-jsonschema'
     'python-pyaudio'
-    'python-pyqtwebengine'
     'python-flask'
     'python-flask-cors'
     'python-waitress'
-    'python-pyqt5'
+    'python-pyqt6'
+    'python-pyqt6-webengine'
 )
 makedepends=(
     'git'
     'rsync'
-
-    'bazel'
+    'ninja'
     'clang'

     'maturin'
     'rust'
-
     'python-pip'
     'python-mypy-protobuf'
     'npm'
@@ -65,13 +63,11 @@ optdepends=(
 )
 source=(
     $pkgname::git+https://github.com/dae/anki.git
-
-    #ankitects-anki-core-i18n-master.tar.gz::https://github.com/ankitects/anki-core-i18n/tarball/master
-    #ankitects-anki-desktop-ftl-master.tar.gz::https://github.com/ankitects/anki-desktop-ftl/tarball/master
-    #ankitects-anki-desktop-i18n-master.tar.gz::https://github.com/ankitects/anki-desktop-i18n/tarball/master
 )
 sha512sums=('SKIP')

 pkgver() {
     cd "$pkgname"
     printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
@@ -80,34 +76,21 @@ pkgver() {
 prepare() {
     cd "$pkgname"

-    # Disable foring a specific bazel version to build with
-    rm .bazelversion
-
-    # Work around option that got removed in bazel
-    sed -i 's/--experimental_no_product_name_out_symlink//g' .bazelrc
-
-    # Put translations in place.
-    #ln -sf "$srcdir"/ankitects-anki-core-i18n-*/ rslib/ftl/repo
-    #ln -sf "$srcdir"/ankitects-anki-desktop-ftl-*/ qt/ftl/repo
-    #ln -sf "$srcdir"/ankitects-anki-desktop-i18n-*/ qt/po/repo
-
-    echo "build --action_env=PYO3_PYTHON=/usr/bin/python3" > "$srcdir/$pkgname/user.bazelrc"
 }

 build() {
     cd "$pkgname"

     export CC=/usr/bin/clang
     export CXX=/usr/bin/clang++
-    export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
     ./tools/build
 }

 package() {
     cd "$pkgname"
-    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps .bazel/out/dist/anki-*.whl .bazel/out/dist/aqt-*.whl
+    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps out/wheels/*.whl

     install -Dm755 qt/runanki.py "$pkgdir"/usr/bin/anki
     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
 }

Hope this helps.

york commented on 2022-09-17 23:53 (UTC)

Hi @DarkShadow44,

Just saw the pinned comments, and tried:

rm -rf ./cache/bazel

and then the build succeeded. Thank you for the help.

york commented on 2022-09-17 23:40 (UTC)

@DarkShadow44. Yes I did clean the cache from "~/.cache/yay/anki-git" before running

yay -S anki-git

Also, I just tried it again hopping to have different results as I just upgraded my Arch Linux system lately, but I still got the exact same errors.

DarkShadow44 commented on 2022-08-16 21:37 (UTC)

@york Did you try cleaning the cache from "~/.cache/yay/anki-git/"?

york commented on 2022-08-15 19:43 (UTC) (edited on 2022-08-15 19:46 (UTC) by york)

I wasn't able to install anki-git. The following was the full log. Any help would be greatly appreciated.

$ uname -a
Linux xxxxx 5.19.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 11 Aug 2022 16:06:13 +0000 x86_64 GNU/Linux

$ yay -S anki-git
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  anki-git-r9412.bc6ede7c1-1

:: (1/1) Downloaded PKGBUILD: anki-git
  1 anki-git                         (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (1/1) Parsing SRCINFO: anki-git
==> Making package: anki-git r9412.bc6ede7c1-1 (Mon 15 Aug 2022 03:35:36 PM EDT)
==> Retrieving sources...
  -> Cloning anki-git git repo...
Cloning into bare repository '~/.cache/yay/anki-git/anki-git'...
remote: Enumerating objects: 130342, done.
remote: Counting objects: 100% (1246/1246), done.
remote: Compressing objects: 100% (473/473), done.
remote: Total 130342 (delta 839), reused 1092 (delta 772), pack-reused 129096
Receiving objects: 100% (130342/130342), 70.12 MiB | 51.69 MiB/s, done.
Resolving deltas: 100% (102280/102280), done.
==> Validating source files with sha512sums...
    anki-git ... Skipped
==> Making package: anki-git r9412.bc6ede7c1-1 (Mon 15 Aug 2022 03:35:45 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating anki-git git repo...
==> Validating source files with sha512sums...
    anki-git ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of anki-git git repo...
Cloning into 'anki-git'...
done.
==> Starting prepare()...
==> Starting pkgver()...
==> Updated version: anki-git r9576.9ca13ca3b-1
==> Sources are ready.
==> Making package: anki-git r9576.9ca13ca3b-1 (Mon 15 Aug 2022 03:35:49 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Starting build()...
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:wheels (723 packages loaded, 31483 targets configured).
INFO: Found 1 target...
Target //:wheels up-to-date:
  .bazel/bin/wheels.tar
INFO: Elapsed time: 14.626s, Critical Path: 1.87s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
wheels are in .bazel/out/dist
==> Entering fakeroot environment...
==> Starting package()...
Processing ./.bazel/out/dist/anki-2.1.51-cp39-abi3-manylinux_2_28_x86_64.whl
Processing ./.bazel/out/dist/anki-2.1.55-cp39-abi3-manylinux_2_28_x86_64.whl
Processing ./.bazel/out/dist/aqt-2.1.51-py3-none-any.whl
Processing ./.bazel/out/dist/aqt-2.1.55-py3-none-any.whl
ERROR: Cannot install anki 2.1.51 (from ~/.cache/yay/anki-git/src/anki-git/.bazel/out/dist/anki-2.1.51-cp39-abi3-manylinux_2_28_x86_64.whl) and anki 2.1.55 (from ~/.cache/yay/anki-git/src/anki-git/.bazel/out/dist/anki-2.1.55-cp39-abi3-manylinux_2_28_x86_64.whl) because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested anki 2.1.51 (from ~/.cache/yay/anki-git/src/anki-git/.bazel/out/dist/anki-2.1.51-cp39-abi3-manylinux_2_28_x86_64.whl)
    The user requested anki 2.1.55 (from ~/.cache/yay/anki-git/src/anki-git/.bazel/out/dist/anki-2.1.55-cp39-abi3-manylinux_2_28_x86_64.whl)

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
==> ERROR: A failure occurred in package().
    Aborting...
 -> error making: anki-git

DarkShadow44 commented on 2022-04-13 17:13 (UTC)

@homocomputeris Just changing the dependencies to qt6 won't work, since I still will have the qt5 dependencies installed. Not sure how to make anki pick qt6.

homocomputeris commented on 2022-04-13 08:31 (UTC) (edited on 2022-04-13 11:27 (UTC) by homocomputeris)

@DarkShadow44

UPD: Seems that copypaste from/to Anki Qt6 doesn't work.

There is a Qt6 PKGBUILD (with other minor fixes too) in the comments below, which is basically changing qt5 to qt6 counterparts.

It seems that Anki doesn't depend on Java explicitly, because it was replaced by Rust.

Sorry, I did flag this because back then it didn't build even with the bazel cache removed, so it seemed that something had changed on the build process side.

DarkShadow44 commented on 2022-04-11 00:38 (UTC) (edited on 2022-04-11 00:43 (UTC) by DarkShadow44)

@homocomputeris Sure, how do you configure the build for qt6?

Also, please don't flag the package out of date for something addressed as pinned issue.

homocomputeris commented on 2022-04-10 20:07 (UTC)

I suggest switching it to Qt6 since 2.1.50 https://github.com/ankitects/anki/releases/tag/2.1.50

Qt6

The packaged builds now come in separate Qt5 and Qt6 versions. Each version
has some advantages and disadvantages.

The Qt6 version is built with a more recent graphics toolkit. Advantages
include:

    Various bugfixes.
    Native support for recent Apple Silicon Macs (faster, better battery life).
    Compatibility with recent glibc versions on Linux (fixes blank screens).
    Better HiDPI support on Linux.

DarkShadow44 commented on 2022-03-22 20:18 (UTC)

Just got the following error

  File "/usr/bin/anki", line 17, in <module>
    import aqt
  File "/usr/lib/python3.10/site-packages/aqt/__init__.py", line 69, in <module>
    from aqt.main import AnkiQt  # isort:skip
  File "/usr/lib/python3.10/site-packages/aqt/main.py", line 20, in <module>
    import aqt.mediasrv
  File "/usr/lib/python3.10/site-packages/aqt/mediasrv.py", line 18, in <module>
    import flask
  File "/usr/lib/python3.10/site-packages/flask/__init__.py", line 6, in <module>
    from . import json as json
  File "/usr/lib/python3.10/site-packages/flask/json/__init__.py", line 9, in <module>
    from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.10/site-packages/markupsafe/__init__.py)

If you happen to get the same, try removing ~/.local/lib/python3.10/site-packages/jinja2