# Maintainer: PktSurf <smlinux@pktsurf.in>
app=libwebp
version=1.3.0
build=1sml
homepage="https://developers.google.com/speed/webp/"
download="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$version.tar.gz"
desc="WebP library and conversion tools"
requires="giflib libpng zstd libtiff"

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

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
  applypatch $srcdir/a486d800b60d0af4cc0836bf7ed8f21e12974129.patch
}

build() {
  mkdir -p smbuild && cd smbuild
  cmake .. \
    -DCMAKE_INSTALL_PREFIX="" \
    -DCMAKE_INSTALL_LIBDIR="lib" \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_SKIP_INSTALL_RPATH=ON

  make
  make install DESTDIR=$pkg

  cp ../COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
48e528d05b00ee6a5496867d66fc0265c78fd454b6c36d0b6a340fe8f126e48bc570acec026bebb65043e632381b789e75e6a1201066782e2418b3aec62104c6  libwebp-1.3.0.tar.lz
b1f592e0a7274b90cf031bd87ed296f6050a134d31b8eac9f3256e40e2e331c245fcfcbfbb592133ca060ec251ac707692d112a3439edac7d1c881b94c150906  a486d800b60d0af4cc0836bf7ed8f21e12974129.patch
"
