# $Id$
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Nezmer <Nezmer@gmail.com>

pkgname=fribidi
pkgver=1.0.1+8+gdf7252b
pkgrel=1
pkgdesc="A Free Implementation of the Unicode Bidirectional Algorithm"
arch=('x86_64')
license=('LGPL')
url="https://github.com/fribidi/fribidi/"
makedepends=(git glib2)
depends=('glibc')
options=('!makeflags')
_commit=df7252be3fd94ceae8141a09ee86421fdd8b3b7e  # master
source=("git+https://github.com/fribidi/fribidi#commit=$_commit")
md5sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed -e 's/-/+/g' -e 's/^v//'
}


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

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

package() {
  cd "${srcdir}/$pkgname"

  make DESTDIR="${pkgdir}" install
}

check() {
  cd "${srcdir}/$pkgname"
  make check
}