File PKGBUILD of Package whisper-git

# 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"
arch=('any')
url="https://github.com/openai/whisper"
license=('MIT')
depends=(
  'python-more-itertools'
  'python-numba'
  'python-pytorch'
  'python-tqdm'
  'python-tiktoken'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
optdepends=(
  'triton: CUDA accelerated filters'
)

provides=("$_pkgname")
conflicts=(${provides[@]})

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


build() {
  cd "$srcdir/whisper"
  python -m build --no-isolation --wheel
}

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

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

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

source[0]=whisper.tar
openSUSE Build Service is sponsored by