# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=uhttpmock
pkgver=0.10.0
pkgrel=1
pkgdesc="HTTP web service mocking project for projects which use libsoup"
url="https://gitlab.freedesktop.org/pwithnall/uhttpmock"
depends=(
  gcc-libs
  glib2
  glibc
  libsoup3
)
makedepends=(
  git
  gobject-introspection
  gtk-doc
  meson
  vala
)
license=(LGPL-2.1-or-later)
arch=(x86_64 aarch64)
_commit=38a95734050f35165dd8d222476dd0828d80cbfa  # tags/0.10.0^0
source=("git+https://gitlab.freedesktop.org/pwithnall/uhttpmock.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

build() {
  local meson_options=(
  )

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

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
