# Maintainer: PktSurf <smlinux@pktsurf.in>
app=libvpx
version=1.8.2
build=2sml
homepage="https://github.com/webmproject/libvpx"
download="https://github.com/webmproject/libvpx/archive/refs/tags/v$version.tar.gz"
desc="provides the WebM VP8/VP9 codec libraries"
requires="gcc-libs nasm"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
  
  sed -i 's/cp -p/cp/' build/make/Makefile 
}

build() {
  # configure creates /usr in staging if prefix is unset
  # and fails if '/' is passed as prefix
  ./configure \
    --prefix="//" \
    --enable-shared \
    --disable-static

  make
  make install DESTDIR=$pkg

  cp LICENSE $pkgdocs/

  mkfinalpkg
}

sha512sums="
2f038cf1f3306ca70c6888d9bf9853dcb0f97bfca0fa28963596da4cf39939a4e2e67e0363c674326c17dbb562ce92a5ee39131881a39d88fd2588980d3f3d0f  libvpx-1.8.2.tar.lz
"
