# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>

pkgname=libgsf
pkgver=1.14.52
pkgrel=1
pkgdesc="Extensible I/O abstraction library for dealing with structured file formats"
url="https://gitlab.gnome.org/GNOME/libgsf"
arch=(x86_64 aarch64)
license=(LGPL-2.1-only)
depends=(
  bzip2
  gdk-pixbuf2
  libxml2
)
makedepends=(
  autoconf-archive
  git
  gobject-introspection
  gtk-doc
)
checkdepends=(
  perl-xml-parser
  unzip
  valgrind
  glibc-debug
)
provides=(libgsf-1.so)
_commit=ea9d8cd1369661bf62d0476474700a9e0887c812  # tags/LIBGSF_1_14_52^0
source=("git+https://gitlab.gnome.org/GNOME/libgsf.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd libgsf
  git describe --tags | sed 's/^LIBGSF_//;s/_/./g;s/[^-]*-g/r&/;s/-/+/g'
}

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

build() {
  local configure_options=(
    --prefix=/usr
    --sysconfdir=/etc
    --localstatedir=/var
    --disable-static
    --enable-introspection
    --enable-gtk-doc
  )

  cd libgsf
  ./configure "${configure_options[@]}"
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd libgsf
  make check
}

package_libgsf() {
  cd libgsf
  make DESTDIR="$pkgdir" install
}

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