# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gtk-doc
pkgver=1.35.1
pkgrel=1
pkgdesc="Documentation tool for public library API"
url="https://gitlab.gnome.org/GNOME/gtk-doc"
arch=(any)
license=(
  GFDL-1.1-or-later
  GPL-2.0-or-later
)
depends=(
  docbook-xml
  docbook-xsl
  glib2-docs
  python
  python-lxml
  python-pygments
  sh
)
makedepends=(
  dblatex
  git
  meson
  yelp-tools
)
checkdepends=(
  bc
  gtk3
  python-parameterized
)
optdepends=(
  'dblatex: PDF support'
)
source=(
  "git+$url.git#tag=$pkgver"
  0001-Fix-tests.patch
)
b2sums=('dabeb601628acfc3b9a5d0f46ce3f2f1275a2e30b70be7f5ff69c19b5009a703f5efe631a27b9b951ce30f12b3459d8c42482c851d1b6452d6f59cf143203319'
        '0c099517bb57130cf2b0f941ad52fc0414a7c96e0c887b7efee6539e17b065c0bd6cf8f56eadd2407fba17d0d1b5bb9182c4f033b7f3cab9aa7a9cfb32702927')

prepare() {
  cd gtk-doc

  # test-gobject-mkhtml: ../xml/object.xml:139: element include: XInclude error : could not load ../../examples/gobject.c, and no fallback was found
  git apply -3 ../0001-Fix-tests.patch
}

build() {
  arch-meson gtk-doc build
  meson compile -C build
}

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

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

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