# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=svt-av1
pkgver=2.1.0
pkgrel=1
pkgdesc='Scalable Video Technology AV1 encoder and decoder'
arch=(x86_64)
url=https://gitlab.com/AOMediaCodec/SVT-AV1
license=(
  BSD
  'custom: Alliance for Open Media Patent License 1.0'
)
depends=(glibc)
makedepends=(
  cmake
  git
  nasm
  ninja
)
_tag=bbcff785881b320f7e1b1f77a2f5ed025f8bfd75
source=(git+https://gitlab.com/AOMediaCodec/SVT-AV1.git#tag=${_tag})
b2sums=('ddaf012e4510cf6add9bae330784abc4d8c7ab252c0b999b249fbb2a4786a752d93cd4cc9b9d86d930b7acfd942f3842802b4bc3cde668c008a3a3383b8891b8')

prepare() {
  sed '/CMAKE_BUILD_TYPE Release/d' -i SVT-AV1/CMakeLists.txt
}

pkgver() {
  cd SVT-AV1
  git describe --tags | sed 's/^v//'
}

build() {
  cmake -S SVT-AV1 -B build -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DNATIVE=OFF
  ninja -C build
}

package() {
  DESTDIR="${pkgdir}" ninja -C build install
  install -Dm 644 SVT-AV1/{LICENSE,PATENTS}.md -t "${pkgdir}"/usr/share/licenses/svt-av1/
}

# vim: ts=2 sw=2 et:
