# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgbase=atkmm
pkgname=(atkmm atkmm-docs)
pkgver=2.28.0
pkgrel=1
pkgdesc="C++ bindings for ATK"
url="http://www.gtkmm.org/"
arch=(x86_64)
license=(LGPL)
depends=(atk glibmm)
makedepends=(git mm-common perl glibmm-docs)
_commit=e1f4d5394a7982cc3c82ca63676a2928cd8819c1  # tags/2.28.0^0
source=("git+https://gitlab.gnome.org/GNOME/atkmm.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgbase
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgbase
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgbase
  ./configure --prefix=/usr --enable-maintainer-mode
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_atkmm() {
  cd $pkgbase
  sed -i -e 's/^doc_subdirs/#doc_subdirs/' Makefile
  make DESTDIR="$pkgdir" install
}

package_atkmm-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  cd $pkgbase
  make -C doc DESTDIR="$pkgdir" install
}
