# Maintainer: PktSurf <smlinux@pktsurf.in>
app=xfwm4
version=4.16.1
build=1sml
homepage="https://docs.xfce.org/xfce/xfwm4/start"
download="https://archive.xfce.org/src/xfce/xfwm4/4.16/xfwm4-$version.tar.bz2"
desc="Xfce Window Manager"
requires="libepoxy libxpresent libxfce4ui xfconf"

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

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

build() {

  # Results in faster window draw and less CPU on the pi
  if [ "$aarch" = "aarch64" ]; then
    compositingflag="--disable-compositor" 
  else
    compositingflag="--enable-compositor"
  fi

  ./configure \
    --prefix="" \
    --disable-static \
    --enable-startup-notification \
    --enable-randr \
    --enable-xsync \
    $compositingflag 

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
51c42e908c1807809488a4b168b8a56a29c629889123d9ec84f7b1a6f284f6ba06e40e8034846049d57a2e1623f19584605331841043eaa9464a7ff88896d78f  xfwm4-4.16.1.tar.lz
"
