# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=tracker3
pkgname=(
  tracker3
  tracker3-docs
)
pkgver=3.7.3
pkgrel=2
pkgdesc="SQLite-based RDF triplestore database with SPARQL interface"
url="https://tracker.gnome.org/"
arch=(x86_64)
license=(LGPL-2.1-or-later)
depends=(
  avahi
  bash
  gcc-libs
  glib2
  glibc
  icu
  json-glib
  libsoup3
  libstemmer
  libxml2
  python
  sqlite
)
makedepends=(
  asciidoc
  bash-completion
  dbus
  gi-docgen
  git
  gobject-introspection
  libsoup
  meson
  python-dbus
  python-gobject
  python-tappy
  systemd
  vala
)
source=(
  "git+https://gitlab.gnome.org/GNOME/tracker.git#tag=$pkgver"
  "git+https://gitlab.gnome.org/GNOME/gvdb.git"
)
b2sums=('9c6a1dff13973ed3ae56cef27af13d4402644d47fb12ce11ed27f6c547673ad8f93b4781890f7d235197591ba9b29424bacb0fda3861e181dc7862791cf7b884'
        'SKIP')

prepare() {
  cd tracker

  git submodule init
  git submodule set-url subprojects/gvdb "$srcdir/gvdb"
  git -c protocol.file.allow=always -c protocol.allow=never submodule update
}

build() {
  local meson_options=(
    -D tests_tap_protocol=true
  )

  arch-meson tracker build "${meson_options[@]}"
  meson compile -C build
}

check() {
  dbus-run-session meson test -C build --print-errorlogs -t 3
}

package_tracker3() {
  optdepends=('libsoup: Alternative remoting backend')
  provides=(libtracker-sparql-3.0.so)

  meson install -C build --destdir "$pkgdir"

  mkdir -p docs/usr/share
  mv {"$pkgdir",docs}/usr/share/doc
}

package_tracker3-docs() {
  pkgdesc+=" (documentation)"
  depends=()
  mv docs/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
