summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1a7c786ee9da04b18fbdbc55dd0ccf45f789232e (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
# Maintainer: Antonin Décimo <antonin dot decimo at gmail dot com>
pkgname=galene-stt
pkgver=0.1
pkgrel=2
epoch=
pkgdesc="Real-time speech-to-text support for Galene"
arch=('i686' 'x86_64')
url='https://galene.org'
license=('MIT')
depends=('go' 'opus' 'whisper.cpp')
optdepends=('whisper.cpp-model-medium: a model for whisper.cpp'
            'whisper.cpp-model-large: a model for whisper.cpp')
source=("https://github.com/jech/$pkgname/archive/$pkgname-$pkgver.tar.gz")
sha256sums=('1bd076de68c59c3c0775f43026f54a26e544a15ca1889080dc6377483cad4642')

prepare() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"

  mkdir -p _build
}

build() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"

  go build \
     -trimpath \
     -buildmode=pie \
     -mod=readonly \
     -modcacherw \
     -ldflags "-s -w" \
     -o _build \
     ./...
}

check() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"

  go test ./...
}

package() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"

  install -dm755 "${pkgdir}/usr/bin"
  install -m755 "_build/galene-stt" "${pkgdir}/usr/bin"
  install -Dm644 LICENCE "$pkgdir/usr/share/licenses/$pkgname/LICENCE"
}