# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=gnome-flashback
pkgver=3.34.0
pkgrel=1
pkgdesc="GNOME Flashback session"
arch=('x86_64')
url="https://wiki.gnome.org/Projects/GnomeFlashback"
license=('GPL')
depends=('gnome-bluetooth' 'gnome-panel' 'gnome-session' 'gnome-settings-daemon' 'gnome-themes-standard' 'libibus' 'metacity')
makedepends=('autoconf-archive' 'git' 'intltool' 'python')
optdepends=('gnome-backgrounds: Default background'
            'gnome-control-center: System settings'
            'gnome-screensaver: Lock screen'
            'network-manager-applet: Network management')
_commit=58cf1160cc2716a0e1530165922a6bda42e40825  # tags/3.34.0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-flashback.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/libgnome-volume-control.git"
        gettext.diff)
sha256sums=('SKIP'
            'SKIP'
            'e947f51efca2efcae36755406f1b9a191981fc09a819fe148bc41451a08341d4')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  patch -Np1 -i ../gettext.diff  # Unbreak build with gettext 0.20

  git submodule init
  git config --local submodule.gnome-flashback/libsound-applet/gvc.url "$srcdir/libgnome-volume-control"
  git submodule update

  NOCONFIGURE=1 ./autogen.sh
}

check() {
  cd $pkgname
  make check
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/$pkgname \
              --disable-schemas-compile --enable-compile-warnings=minimum --enable-gtk-doc
  make
}

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