#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=gtk-doc
pkgver=1.33.2
pkgrel=01
pkgdesc="Documentation tool for public library API"
url="https://www.gtk.org/gtk-doc/"
arch=(any)
depends=(docbook-xsl docbook-xml glib2-docs python-lxml python-pygments
         python-anytree)
makedepends=(dblatex git yelp-tools meson)
checkdepends=(bc gtk3 python-six python-parameterized)
optdepends=('dblatex: PDF support')
_commit=14391142ee9d43da116f0f530746ae34cc46930a  # tags/1.33.2^0
source=("git+https://gitlab.gnome.org/GNOME/gtk-doc.git#commit=$_commit"
        0001-Partially-revert-a-gtk-doc-1.31-change-that-broke-e-.patch)
#161c6d94e41e2d2ec2358ac6be8233f8d1698f57 refs/tags/1.33.2
#^14391142ee9d43da116f0f530746ae34cc46930a

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/GTK_DOC_//;s/_/\./g;s/-/+/g'
}

prepare() {
  cd $pkgname

  # https://gitlab.gnome.org/GNOME/gtk-doc/-/merge_requests/58
  git apply -3 ../0001-Partially-revert-a-gtk-doc-1.31-change-that-broke-e-.patch
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

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

package() {
  DESTDIR="$pkgdir" meson install -C build
  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}

#---- license gpg-key sha256sums ----

license=(GPL FDL)

sha256sums=(SKIP
	95208f0e0dd6e888892b04e3396b131218d1d98e433edfbd4af70b158921319c) # 0001-Partially-revert-a-gtk-doc-1.31-change-that-broke-e-.patch
