summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45518ab50c0e6498481f7e57da34d077fb9a6473 (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
# Maintainer: blinry <mail@blinry.org>

_pkgname="whisper"
pkgname="$_pkgname-git"
pkgver=2023.11.17.r2.gba3f3cd5
pkgrel=1
pkgdesc="General-purpose speech-recognition model by OpenAI"
url="https://github.com/openai/whisper"
license=('MIT')
arch=('any')

depends=(
  'python-more-itertools'
  'python-numba'
  'python-pytorch'
  'python-tqdm'

  # AUR
  'python-tiktoken'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
optdepends=(
  # AUR
  'triton: CUDA accelerated filters'
)

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgname"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=8 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^v([0-9]{4})([0-9]{2})([0-9]{2})-/\1.\2.\3-r/;s/-/./g'
}

build() {
  cd "$_pkgsrc"
  python -m build --no-isolation --wheel
}

package() {
  depends+=(
    'ffmpeg'
  )

  cd "$_pkgsrc"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}