# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Timm Preetz <timm@preetz.us>

pkgname=vala
pkgver=0.56.17
pkgrel=1
pkgdesc='Compiler for the GObject type system'
url='https://wiki.gnome.org/Projects/Vala'
arch=(x86_64 aarch64)
license=(LGPL-2.1-or-later)
depends=(
  bash
  gcc
  glib2
  glibc
  graphviz
  gtk-doc
  pkg-config
  ttf-font
)
makedepends=(
  autoconf-archive
  git
  help2man
  libxslt
  vala
)
checkdepends=(
  dbus
  gobject-introspection
  libx11
)
provides=(
  libvala{,doc}-${pkgver%.*}.so
  valadoc
)
conflicts=(valadoc)
replaces=(valadoc)
_commit=ef0d911609f6691df0f10877ee97ee34cd24d689  # tags/0.56.17^0
source=("git+https://gitlab.gnome.org/GNOME/vala.git?signed#tag=$pkgver")
b2sums=('5b7b40340127905e3b36114c1e9d44c962b0980b9d9d30f3a0f65780316f8f1453d7ef3c8d253c06dfffa0ac03fc5045cc173b564144195ebcca7b7a8afc9247')
validpgpkeys=(
  E4884AEEDE4CC02043C3D8045DECDBA89270E723 # Rico Tzschichholz <ricotz@ubuntu.com>
)

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

build() {
  cd vala
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd vala
  make check
}

package() {
  cd vala
  make DESTDIR="$pkgdir" install
}

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