# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: György Balló <ballogy@freestart.hu>

#Included in Slint by Didier Spaier didieratslintdotfr
pkgname=zeitgeist
pkgver=1.0.4
pkgrel=1slint
slackdesc="$pkgname (Service logging user activities and events)"
docs=("copying" "authors" "README*" "LICENSE*")
options=("nosrcpack")
url="https://launchpad.net/zeitgeist/"
license=(
  "BSD-3-Clause OR CC-BY-3.0"
  GPL-3.0-or-later
  LGPL-2.1-or-later
  LGPL-3.0-or-later
)
depends=(
  gtk3
  json-glib
  sqlite
  telepathy-glib
  xapian-core
)
makedepends=(
  git
  gobject-introspection
  python-rdflib
  raptor
  vala
)
checkdepends=(xorg-server-xvfb)
optdepends=('python: Python bindings')
provides=(zeitgeist-datahub)
conflicts=(zeitgeist-datahub)
replaces=(zeitgeist-datahub)
_commit=8b89364c077b46734d193c5b8a80f83b0fc917dd  # tags/v1.0.4^0

b2sums=('SKIP')
validpgpkeys=(
  E4884AEEDE4CC02043C3D8045DECDBA89270E723  # Rico Tzschichholz <ricotz@ubuntu.com>
)

build() {
  git clone https://gitlab.freedesktop.org/zeitgeist/zeitgeist.git
  cd $pkgname
  git checkout $_commit
  # Fix some crashes
  # https://gitlab.freedesktop.org/zeitgeist/zeitgeist/issues/19
  # https://gitlab.freedesktop.org/zeitgeist/zeitgeist/issues/26
  git cherry-pick -n 1be2a5fff77cdf61c843edc8356dfdef3fd2dbfc \
                     33ab4cce74857f928382ba6cfada111a64dafe88
[ -f README.md ] && pandoc -f gfm -t html5 -o README.html README.md
  autoreconf -fi
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --libdir=/usr/lib64 \
    --localstatedir=/var \
    --enable-telepathy \
    --enable-introspection \
    --libexecdir=/usr/libexec \
    --enable-fts \
    --with-dee-icu=yes
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
  make DESTDIR="$PKG" install
}
