summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e05975c624d7fef69667be36279cad11f44b95d8 (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
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer:  Fabian Maurer<dark.shadow4@web.de>
# Contributor: Martin Dünkelmann<nc-duenkekl3@netcologne.de>
# Contributor: Shaoyu Tseng<zandimna@autistici.org>
# Contributor: Daniel Egeberg <daniel.egeberg@gmail.com
# Contributor: Sławomir Kowalski <suawekk+aur@gmail.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-git
pkgver=r11208.b7cb0c0d0
pkgrel=1
pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
url="hhttps://apps.ankiweb.net/"
license=('AGPL3')
arch=('any')
provides=('anki')
conflicts=('anki' 'anki20' 'anki-official-binary-bundle')
depends=(
    # anki and aqt
    'python-beautifulsoup4'
    'python-requests'
    'python-wheel'

    # anki
    'python-pysocks' # requests[socks]
    'python-decorator'
    'python-protobuf'
    'python-orjson'
    'python-distro'
    'python-pip-system-certs'

    # aqt
    'python-send2trash'
    'python-markdown'
    'python-jsonschema'
    'python-pyaudio'
    'python-pyqtwebengine'
    'python-flask'
    'python-flask-cors'
    'python-waitress'
    'python-pyqt6'
    'python-pyqt6-webengine'
)
makedepends=(
    'git'
    'rsync'

    'ninja'
    'clang'

    'rust'
    'libxcrypt-compat'

    'python-pip'
    'npm'
)
optdepends=(
    'lame: record sound'
    'mpv: play sound. prefered over mplayer'
    'mplayer: play sound'
)
source=('git+https://github.com/ankitects/anki.git')
sha512sums=('SKIP')

pkgver() {
    cd anki
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd anki

    # 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
}

build() {
    cd anki

    export CC=/usr/bin/clang
    export CXX=/usr/bin/clang++
    export PROTOC_BINARY=$(which protoc)
    ./tools/build
}

package() {
    cd anki
    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-warn-script-location --root-user-action=ignore --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
}