summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7872b650db8c42b68f8e58c4f08c67c5a37161da (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
# Maintainer: sant0s <diego.delossantos@mailbox.org>
pkgname=livecaptions
_pkgname=LiveCaptions
pkgver=0.4.1
pkgrel=2
pkgdesc="Linux Desktop application that provides live captioning"
arch=('x86_64')
url="https://github.com/abb128/LiveCaptions"
license=('GPL3')
depends=(
	'libadwaita'
	'onnxruntime'
)
makedepends=(
	git
	cmake
	ninja
	gcc
	meson
)
source=("${_pkgname}::git+https://github.com/abb128/${_pkgname}.git"
		"https://april.sapples.net/april-english-dev-01110_en.april")
md5sums=('SKIP'
         '3151046bd9f80655117dd6c3a0ecdcb3')

pkgver() {
  cd "${_pkgname}"
  git describe --tags --abbrev=0 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd "${_pkgname}"
	arch-meson . build
	meson compile -C build
}

check() {
  meson test -C ${_pkgname}/build --print-errorlogs
}

prepare() {
	cd "${_pkgname}"
	git checkout v${pkgver}
	git submodule update --init --recursive
	find . \( -name "*.c" -o -name "*.h" \) -type f -exec sed -i \
		 "s|/app/LiveCaptions/|/usr/share/${_pkgname}/|" {} \;
}

package() {
	mkdir -p "${pkgdir}/etc/profile.d/"
	mkdir -p "${pkgdir}/usr/share/${_pkgname}/models"

	meson install -C "${_pkgname}/build" --destdir "${pkgdir}"

	install -Dm644 "$_pkgname"/COPYING -t "${pkgdir}/usr/share/licenses/${_pkgname}"
	install -Dm644 april-english-dev-01110_en.april -T "${pkgdir}/usr/share/${_pkgname}/models/aprilv0_en-us.april"
}