pkgname=gobject-introspection
pkgver=1.84.0
pkgdesc="Introspection system for GObject-based libraries"
url="https://wiki.gnome.org/Projects/GObjectIntrospection"
arch=(x86_64)
license=(
  GPL-2.0-or-later
  LGPL-2.0-or-later
)
sources=("${pkgname}-${pkgver}.tar.xz")
_gnomeurl="https://download.gnome.org/sources"
urls=("${_gnomeurl}/${pkgname}/${_basever}/${sources[0]}")
md5sums=("2a62fb1c584616a8ebcd9dd4d045f27e")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  meson setup build \
              --prefix=/usr --buildtype=release     &&
  meson compile -C build
}

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

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

  cd "$pkgdir"
  python -m compileall -d /usr/lib/${pkgname} usr/lib/${pkgname}
  python -O -m compileall -d /usr/lib/${pkgname} usr/lib/${pkgname}
}
