# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=liblc3
pkgver=%version%
pkgrel=%release%
pkgdesc="Low Complexity Communication Codec library and tools"
url="https://github.com/google/liblc3"
arch=(x86_64)
license=(Apache)
depends=(glibc)
makedepends=(
  git
  meson
)
provides=(liblc3.so)
_commit=0d45f4ecf6d5d0e9c0dd392d84f371c4e01aed60  # tags/v1.1.0
source=("git+$url#commit=$_commit")
b2sums=('66b10340d2e422f2e7bcef8b0be56ebc135b02995bc1a003fb9eae7409471d6b7d5596dfbd5e770458b20f2f6bf6cedeeb6f69c12977572cb1e7480cc923a0e7')

pkgver() {
  cd liblc3
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd liblc3
}

build() {
  arch-meson liblc3 build -D tools=true
  meson compile -C build
}

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

package() {
  meson install -C build --destdir "$pkgdir"
  install -Dt "$pkgdir/usr/share/doc/$pkgname" -m644 liblc3/README.md
}

# vim:set sw=2 sts=-1 et:
