NAME="picom"
DESC="A lightweight compositor for X11"
VERSION="11.2"
FILES=("https://github.com/yshui/picom/archive/refs/tags/v$VERSION.tar.gz")
HASHES=("1c1063936faf09ed9bba726e7737a562564b7a5f8cdef79d48fcdaf3669a4df4")
DEPENDS=(
  "hicolor-icon-theme" "libconfig" "dbus" 
  "libev" "libglvnd" "pcre2" "pixman"
  "xcb-util-image" "xcb-util-renderutil" 
  "libepoxy"
)

PACKAGE() {
  tar xf v$VERSION.tar.gz
  cd $NAME-$VERSION

  setconf picom.sample.conf 'frame-opacity=0.9;'
  setconf picom.sample.conf 'inactive-opacity=0.95;'
  setconf -u picom.sample.conf 'glx-no-stencil=true;'

  mkdir build
  cd    build

  meson --buildtype=release -D with_docs=true ..
  ninja && DESTDIR="$ROOTDIR" ninja install

  install -Dm644 ../picom.sample.conf "$ROOTDIR/etc/xdg/picom.conf"
  install -Dm644 ../picom.sample.conf "$ROOTDIR/usr/share/doc/picom/picom.conf.example"
  install -Dm644 man/picom.1 "$ROOTDIR/usr/share/man/man1/picom.1"
  install -Dm644 man/picom-trans.1 "$ROOTDIR/usr/share/man/man1/picom-trans.1"

  cd ../.. && rm -r $NAME-$VERSION
}
