NAME="libavif"
DESC="Library used for encoding and decoding AVIF files"
VERSION="0.11.1"
FILES=("https://github.com/AOMediaCodec/libavif/archive/v$VERSION/libavif-$VERSION.tar.gz")
HASHES=("dde524dfc0e0e37a468277b128662990")
DEPENDS=("libaom" "gdk-pixbuf")

PACKAGE() {
  tar xf $NAME-$VERSION.tar.gz
  cd $NAME-$VERSION

  mkdir build
  cd    build

  cmake -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_BUILD_TYPE=Release  \
      -DAVIF_CODEC_AOM=ON         \
      -DAVIF_BUILD_GDK_PIXBUF=ON  \
      -G Ninja ..
  ninja && DESTDIR="$ROOTDIR" ninja install

  cd ../.. && rm -r $NAME-$VERSION
}

INSTALL(){
  gdk-pixbuf-query-loaders --update-cache
  exit 0
}
