# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gtk-doc
pkgver=1.33.2
pkgrel=1
pkgdesc="Documentation tool for public library API"
arch=('i686' 'x86_64')
url="https://www.gtk.org/gtk-doc/"
license=("GPL" "FDL")
options=(staticlibs strip)
depends=("docbook-xsl"
         "glib2"
         "gnome-doc-utils"
         "libxml2-python"
         "python"
         "python-pygments"
         "vim"
         "yelp-tools"
        )
makedepends=("pkg-config"
             "glib2-devel"
             'itstool'
            )
source=(https://download.gnome.org/sources/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz)
sha256sums=('cc1b709a20eb030a278a1f9842a362e00402b7f834ae1df4c1998a723152bf43')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  libtoolize --force --copy
  autoreconf -fi
}

build() {
  mkdir -p "${srcdir}/build-${CHOST}"
  cd "${srcdir}/build-${CHOST}"
  export PYTHON=/usr/bin/python
  ../${pkgname}-${pkgver}/configure \
    --prefix=/usr \
    --build=${CHOST} \
    --host=${CHOST} \
    --enable-shared \
    --enable-static \
    --with-xml-catalog=/etc/xml/catalog
  make
}

check() {
  cd "${srcdir}/build-${CHOST}"
  make check || true
}

package() {
  cd "${srcdir}/build-${CHOST}"
  make DESTDIR="${pkgdir}" install
}
