# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Evangelos Foutras <foutrelis@archlinux.org>
# Maintainer: Robin Candau <antiz@archlinux.org>
# Contributor: tobias <tobias funnychar archlinux.org>

pkgname=xfce4-session
pkgver=4.18.4
pkgrel=2
pkgdesc="Xfce's session manager"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://docs.xfce.org/xfce/xfce4-session/start"
license=('GPL-2.0-or-later')
groups=('xfce4')
depends=('libxfce4ui' 'libwnck3' 'xfconf' 'libsm' 'polkit' 'xorg-iceauth'
         'xorg-xinit' 'xorg-xrdb' 'polkit-gnome' 'hicolor-icon-theme')
makedepends=('git' 'glib2-devel' 'intltool' 'xfce4-dev-tools')
optdepends=('gnome-keyring: for keyring support when GNOME compatibility is enabled'
            'xfce4-screensaver: for locking screen with xflock4'
            'xscreensaver: for locking screen with xflock4'
            'light-locker: for locking screen with xflock4')
source=("git+https://gitlab.xfce.org/xfce/xfce4-session.git#tag=$pkgname-$pkgver"
        source-system-xinitrc-scripts.patch
        xfce-polkit-gnome-authentication-agent-1.desktop)
sha256sums=('fe898ab1a486111034faa00a565dd522edbe5f1452fd880e8a8362253235059b'
            '5706e37a8ca692d66d23f478bc462c96fe173b35945020b550be36c56f310fb2'
            '74c94c5f7893d714e04ec7d8b8520c978a5748757a0cdcf5128492f09f31b643')

prepare() {
  cd $pkgname
  
  # https://bugzilla.xfce.org/show_bug.cgi?id=15440
  patch -Np1 -i ../source-system-xinitrc-scripts.patch

  ./autogen.sh \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --disable-debug
}

build() {
  cd $pkgname
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install

  # Provide a default PolicyKit Authentication Agent (FS#42569)
  install -d "$pkgdir/etc/xdg/autostart"
  cp "$srcdir/xfce-polkit-gnome-authentication-agent-1.desktop" \
    "$pkgdir/etc/xdg/autostart/"
}

# vim:set ts=2 sw=2 et:
