# Description: Scalable Video Technology AV1 encoder and decoder
# URL: https://gitlab.com/AOMediaCodec/SVT-AV1
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: nasm

name=svt-av1
version=1.6.0
release=1
source=(https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v$version/SVT-AV1-v$version.tar.bz2)

build() {
  sed '/CMAKE_BUILD_TYPE Release/d' -i SVT-AV1-v$version/CMakeLists.txt
  cmake -S SVT-AV1-v$version -B build -G Ninja \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_INSTALL_LIBDIR=lib \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
    -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
    -D BUILD_SHARED_LIBS=ON \
    -D NATIVE=OFF \
    -Wno-dev

  cmake --build build
  DESTDIR=$PKG cmake --install build
}
