# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jelle van der Waa <jelle at vdwaa dot nl>
# Contributor: Borromini <gotleenucks at g-male dot com>

pkgname=evolution-rss
pkgver=0.3.96
pkgrel=4
pkgdesc="Plugin for Evolution Mail that enables reading of RSS/RDF/ATOM feeds"
arch=('x86_64')
url="https://gnome.eu.org/index.php/Evolution_RSS_Reader_Plugin"
license=('GPL')
depends=(evolution)
makedepends=(intltool git gnome-common)
_commit=696f57c5451ccf425dcca57e796feded788417dc  # tags/EVOLUTION_RSS_0_3_96^0
source=("git+https://gitlab.gnome.org/GNOME/evolution-rss.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^EVOLUTION_RSS_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  sed -i '/GCONF/d' configure.ac

  # Hide desktop file, it's useless in the current form
  sed -i 's/#NoDisplay=true/NoDisplay=true/' evolution-rss.desktop.in.in

  NOCONFIGURE=1 ./autogen.sh
}

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

  #https://bugzilla.gnome.org/show_bug.cgi?id=656231
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

check() {
  make -C $pkgname check
}

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