# Maintainer: Jeremy Drake <github@jdrake.com>

pkgname=mm-common
pkgver=1.0.3
pkgrel=1
pkgdesc="Common build files of the C++ bindings"
url="https://www.gtkmm.org/"
arch=('i686' 'x86_64')
makedepends=('meson')
license=('GPL2')
source=("https://download.gnome.org/sources/mm-common/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"
        https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag)
sha256sums=('e81596625899aacf1d0bf27ccc2fcc7f373405ec48735ca1c7273c0fbcdc1ef5'
            'f6c8c74e8293aefaefb4d25fd154d5f537b3bc80e7ceecaa02c5a01836fc09e6')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  cp ../libstdc++.tag doctags
}

build() {
  mkdir "${srcdir}/build-${CARCH}" && cd "${srcdir}/build-${CARCH}"
  meson \
    --buildtype=plain \
    --prefix=/usr \
    "../${pkgname}-${pkgver}"

  meson compile
}

check() {
  cd "${srcdir}/build-${CARCH}"
  meson test --print-errorlogs
}

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