# Maintainer: PktSurf <smlinux@pktsurf.in>
app=scrcpy
version=1.16
build=1sml
homepage="https://github.com/Genymobile/scrcpy"
download="https://github.com/Genymobile/scrcpy/archive/refs/tags/v$version.tar.gz"
desc="Lightweight display and control utility to interact with Android 5.1+ devices over USB or TCP/IP"
requires="meson sdl2 ffmpeg"

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

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

build() {
  mkdir -p build/server && cd build
  cp $srcdir/scrcpy-server-v"$version".zip server/scrcpy-server
  meson .. \
    --prefix="/" \
    --buildtype release 

  ninja
  DESTDIR="$pkg" ninja install

  cp ../LICENSE $pkgdocs/

  mkfinalpkg
}

sha512sums="
b100ab05ea7251e756ee01e3ea0ff4abe452d829884e9eb3ffca7b5dd5aec4559dedf649509f689db1b897846b7013f84571700b59e7792e4f14a785ede3743a  scrcpy-1.16.tar.lz
52d4fbf48a91e61abff5e0bbc510c83fb4c1238a2791f888baf9fb04f04c5c19dfc82525c717fc1b92bd86fb2152cb29f6932784e1e2115329288ec97d8594fc  scrcpy-server-v1.16.zip
"
