# Description: A GTK+ backend for xdg-desktop-portal
# URL: https://github.com/flatpak/xdg-desktop-portal-gtk
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: gtk3 xdg-desktop-portal
# Optional: dconf gnome-desktop gnome-shell

name=xdg-desktop-portal-gtk
version=1.14.1
release=1
source=(https://github.com/flatpak/xdg-desktop-portal-gtk/archive/$version/$name-$version.tar.gz)

build() {
  cd $name-$version

  prt-get isinst dconf && PKGMK_XDGDPGTK+=' --enable-settings' || PKGMK_XDGDPGTK+=' --disable-settings'
  prt-get isinst gnome-shell && PKGMK_XDGDPGTK+=' --enable-background' || PKGMK_XDGDPGTK+=' --disable-background'
  prt-get isinst gnome-desktop && PKGMK_XDGDPGTK+=' --enable-wallpaper' || PKGMK_XDGDPGTK+=' --disable-wallpaper'
  prt-get isinst gnome-shell && PKGMK_XDGDPGTK+=' --enable-screencast' || PKGMK_XDGDPGTK+=' --disable-screencast'

  NOCONFIGURE=1 ./autogen.sh
  ./configure --prefix=/usr $PKGMK_XDGDPGTK \
    --libexecdir=/usr/lib \
    --enable-appchooser \
    --enable-lockdown \
    --disable-nls
  make
  make DESTDIR=$PKG install

  rm -fr $PKG/usr/lib/systemd
}
