summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ead934ea20fcc58dc949433a33279d1c1b0abb99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Maintainer: Alexander Bocken <alexander@bocken.org>

# Contributor: Posi <posi1981@gmail.com>
# Contributor: Johannes Löthberg <johannes@kyriasis.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Timm Preetz <timm@preetz.us>
# Contributor: Michael 'manveru' Fellinger <m.fellinger@gmail.com>
# Contributor: Dave Pretty <david dot pretty at gmail dot com>

pkgname=anki
pkgver=2.1.55
pkgrel=2
pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
url="https://apps.ankiweb.net/"
license=('AGPL3')
arch=('x86_64')
provides=('anki')
conflicts=('anki-bin' 'anki-git' 'anki-official-binary-bundle' 'anki-qt5')
options=('!ccache')
depends=(
    # anki & aqt
    'python-beautifulsoup4'
    'python-flask'
    'python-waitress'

    # anki
    'python-decorator'
    'python-markdown'
    'python-orjson'
    'python-protobuf'
    'python-pysocks'
    'python-distro'

    #aqt
    'python-flask-cors'
    'python-jsonschema'
    'python-requests'
    'python-send2trash'
    'qt6-multimedia'	# recording voice
    'python-pyqt6-webengine'
)
makedepends=(
    'rsync'
    'git'

    'ninja'
    'python-installer'
    'libxcrypt-compat'
)
optdepends=(
    'lame: record sound'
    'mpv: play sound. prefered over mplayer'
    'mplayer: play sound'
)
# 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=("anki-${pkgver}::git+https://github.com/ankitects/anki#tag=${pkgver}"
"no-update.patch"
)
sha256sums=('SKIP'
'137827586d2a72adddaaf98599afa9fc80cdd73492d7f5cbcf4d2f6082e5f797'
)

prepare(){
    cd "anki-$pkgver"
    # pro-actively prevent "module not found" error (TODO: verify whether still required)
    [ -d ts/node_modules ] && rm -r ts/node_modules
    patch -p1 < "$srcdir/no-update.patch"
}

build() {
    cd "anki-$pkgver"
    ./tools/build
}

package() {
    cd "anki-$pkgver"
    for file in out/wheels/*.whl; do
    	python -m installer --destdir="$pkgdir" $file
    done

    # TODO: verify whether still required
    find $pkgdir -iname __pycache__ | xargs -r rm -rf
    find $pkgdir -iname direct_url.json | xargs -r rm -rf
}