summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dbe2a39c8aa5f9da4a934366f9dcd5df104dec55 (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
_model='tiny'
_model_sha1sum='bd577a113a864445d4c299885e0cb97d4ba92b5f'
_pkgbase='whisper.cpp-model'
# Maintainer: Hauke Rehfeld <aur@haukerehfeld.de>
pkgname="${_pkgbase}-${_model}"
pkgver=1
pkgrel=2
pkgdesc="This is an autogenerated file, please see https://github.com/hrehfeld/archlinux-whisper.cpp-model"
arch=("i686" "x86_64")
url="https://github.com/ggerganov/whisper.cpp/tree/master/models"
license=("MIT")

makedepends=()
depends=()
conflicts=()
provides=()

_model_file="ggml-${_model}.bin"
_model_path="/usr/share/$pkgname/${_model_file}"

_download_script_name="download-ggml-model.sh"
_download_script_url="https://github.com/ggerganov/whisper.cpp/raw/master/models/download-ggml-model.sh"

source=("$_download_script_url")
sha1sums=('2446b8d3ed58e79ebdd6a0272392314791fa5a3c')

prepare() {
    chmod +x $_download_script_name
    ./$_download_script_name "$_model" "."
}

package() {
  install -Dm644 "${srcdir}/${_model_file}" "$pkgdir$_model_path"

  wrapper="whisper.cpp-${_model}"
  echo "#!/bin/sh
/usr/bin/whisper.cpp --model ${_model_path} "\"'$@'\" > "$srcdir/$wrapper"
  install -Dm755 "${srcdir}/$wrapper" "$pkgdir/usr/bin/$wrapper"


}