git » gobject-introspection.git » main » tree

[main] / PKGBUILD

# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgbase=gobject-introspection
pkgname=(
  gobject-introspection
  gobject-introspection-runtime
  libgirepository
)
pkgver=1.80.1
pkgrel=3
pkgdesc="Introspection system for GObject-based libraries"
url="https://wiki.gnome.org/Projects/GObjectIntrospection"
arch=('armv7h' 'aarch64')
license=(
  GPL-2.0-or-later
  LGPL-2.0-or-later
)
_glibver=2.80.0
makedepends=(
  "glib2=$_glibver"
  git
  glibc
  libffi
  meson
  python
)
source=(
  "git+https://gitlab.gnome.org/GNOME/gobject-introspection.git#tag=$pkgver"
  "git+https://gitlab.gnome.org/GNOME/glib.git?signed#tag=$_glibver"
)
b2sums=('1615fb991f5eba1a384ce684d89acaeb08417b65d77b33019e6e2b94ee0c7038186f0c09011268092194339cc870f3f6ef25ca8f32dc454f9a298fce36400d86'
        'cc3a6a7a14fef1aabc08d3bdfe98f66e3ecf3591ac054d83aa9404c8c9cd72e690a4c26c16934700d067bb2cb3d58730387482032cd9ffa04b041869426165ba')
validpgpkeys=(
  923B7025EE03C1C59F42684CF0942E894B2EAFA0  # Philip Withnall <philip@tecnocode.co.uk>
  D4C501DA48EB797A081750939449C2F50996635F  # Marco Trevisan <marco@trevi.me>
)

prepare() {
  cd $pkgbase
}
  
build() {
  local meson_options=(
    -D glib_src_dir="$srcdir/glib"
     -Dcairo=disabled
	-Ddoctool=disabled
  )

  arch-meson $pkgbase build "${meson_options[@]}"
  meson compile -C build
}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_gobject-introspection() {
  depends=(
    "gobject-introspection-runtime=$pkgver-$pkgrel"
    "libgirepository=$pkgver-$pkgrel"
    glib2
    glibc
    libffi
    python
  )

  meson install -C build --destdir "$pkgdir"

  cd "$pkgdir"

  python3 -m compileall -d /usr/lib/$pkgbase usr/lib/$pkgbase
  python3 -O -m compileall -d /usr/lib/$pkgbase usr/lib/$pkgbase

  _pick libg usr/include/gobject-introspection-1.0
  _pick libg usr/lib/libgirepository-1.0.so*
  _pick libg usr/lib/pkgconfig/gobject-introspection*-1.0.pc
  _pick libg usr/lib/girepository-1.0/GIRepository-2.0.typelib
  _pick libg usr/share/gir-1.0/GIRepository-2.0.gir
#  _pick libg usr/share/gtk-doc

  _pick runtime usr/lib/girepository-1.0
}

package_gobject-introspection-runtime() {
  pkgdesc+=" - runtime"
  depends=("libgirepository=$pkgver-$pkgrel")

  mv runtime/* "$pkgdir"
}

package_libgirepository() {
  pkgdesc+=" - runtime library"
  depends=(
    glib2
    glibc
    libffi
    libg{lib,object,module}-2.0.so
  )
  provides=(libgirepository-1.0.so)

  mv libg/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et: