# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gfbgraph
pkgver=0.2.4
pkgrel=1
pkgdesc="GLib/GObject wrapper for the Facebook Graph API"
url="https://wiki.gnome.org/Projects/GFBGraph"
arch=(x86_64)
license=(LGPL)
depends=(gnome-online-accounts)
makedepends=(rest json-glib gobject-introspection gtk-doc git)
_commit=1a01f9002127c074dcba76c8335850051a362164  # tags/v_0_2_4^0
source=("git+https://gitlab.gnome.org/GNOME/libgfbgraph.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libgfbgraph
  git describe --tags | sed 's/^v_//;s/_/./g;s/-/+/g'
}

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

build() {
  cd libgfbgraph
  ./configure --prefix=/usr \
    --disable-static \
    --enable-gtk-doc \
    --enable-introspection
  sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
  make
}

package() {
  cd libgfbgraph
  make DESTDIR="$pkgdir" install \
    libgfbgraphdocdir=/usr/share/doc/$pkgname
}
