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

pkgname=gnome-break-timer
pkgver=1.1+47+ga51a32a
pkgrel=3
pkgdesc="Keeps track of how much you are using the computer, and it reminds you to take regular breaks"
arch=('x86_64')
url="https://wiki.gnome.org/Apps/BreakTimer"
license=('GPL3')
depends=('gtk3' 'libcanberra' 'libgee' 'libnotify')
makedepends=('intltool' 'git' 'gobject-introspection' 'vala')
_commit=a51a32a3c64110d8aafae2f21492754f693cd973  # master
source=("git+https://gitlab.gnome.org/GNOME/gnome-break-timer#commit=$_commit"
        0001-Fix-AppStream-metadata-validation.patch)
sha256sums=('SKIP'
            'b043a8f1687438df61199ea32f614f4541cbe1253b676761c561c24b2eded9d1')

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

prepare() {
  cd $pkgname
  patch -Np1 -i ../0001-Fix-AppStream-metadata-validation.patch
  sed -i 's/gee-1.0/gee-0.8/' configure.ac helper/helper.am settings/settings.am
  sed -i 's|$(top_builddir)/helper/libgnome_break_timer_service.la|libgnome_break_timer_service.la|' helper/Makefile.am

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              --disable-schemas-compile
  make
}

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