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-4.16.1.tar.bz2"
desc="Xfce Window Manager"
requires="libepoxy libxpresent libxfce4ui xfconf"

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

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

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

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

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
f0d5d00e58202457d0d7d5f9772e7b2aa3f3339850065609baab7d379248a628d147464cc605698970134b87d58b7867b8c09d0a3a45ab84b2f3aa95be26f0b9  xfwm4-4.16.1.tar.bz2
"