# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=tinysparql
pkgname=(
  tinysparql
  tinysparql-docs
)
pkgver=3.8.1
pkgrel=1
pkgdesc="Low-footprint RDF triple store with SPARQL 1.1 interface"
url="https://tinysparql.org/"
arch=(x86_64)
license=(GPL-2.0-or-later)
depends=(
  avahi
  gcc-libs
  glib2
  glibc
  icu
  json-glib
  libsoup3
  libstemmer
  libxml2
  sqlite
)
makedepends=(
  asciidoc
  bash-completion
  dbus
  gi-docgen
  git
  glib2-devel
  gobject-introspection
  meson
  python-dbus
  python-gobject
  python-tappy
  systemd
  vala
)
checkdepends=(man-db)
source=(
  # Missing 3.8.0 tag
  #"git+https://gitlab.gnome.org/GNOME/tinysparql.git#tag=${pkgver/[a-z]/.&}"
  "git+https://gitlab.gnome.org/GNOME/tinysparql.git#commit=a5f3c82f093f9e4c137270c443fd94ddf4f8009c"
)
b2sums=('1d1564bf421c70c86393f8030bddb10fef091d60bb6fac9ffede04d7082c48e2d8cdf84434965884ce30a59ad8ce1edd120dcc1614c0365e91db4e894d84528e')

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

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

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

package_tinysparql() {
  provides=(
    "tracker3=$pkgver"
    libtinysparql-3.0.so
  )
  replaces=('tracker3<=3.7.3-2')
  conflicts=('tracker3<=3.7.3-2')

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

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

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

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