# Description: Library for encoding and decoding .avif files
# URL: https://github.com/AOMediaCodec/libavif
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: aom dav1d gdk-pixbuf libjpeg-turbo libpng libyuv nasm rav1e svt-av1

name=libavif
version=0.11.1
release=1
source=(https://github.com/AOMediaCodec/libavif/archive/v$version/$name-$version.tar.gz)

build() {
  cmake -S $name-$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 AVIF_BUILD_APPS=ON \
    -D AVIF_CODEC_AOM=ON \
    -D AVIF_CODEC_DAV1D=ON \
    -D AVIF_CODEC_RAV1E=ON \
    -D AVIF_CODEC_SVT=ON \
    -D AVIF_BUILD_GDK_PIXBUF=ON \
    -Wno-dev

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