# Maintainer: Connor Behan <connor.behan@gmail.com>
# Contributor: mar77i <mysatyre at gmail dot com>

pkgname=ming
pkgver=0.4.8
pkgrel=1
pkgdesc="SWF output library"
arch=('x86_64')
url="http://www.libming.net/"
license=('GPL' 'LGPL')
depends=('freetype2' 'libpng' 'flex' 'giflib')
makedepends=('bison' 'pkg-config' 'python2')
options=('!emptydirs')
source=(https://github.com/libming/libming/archive/${pkgname}-${pkgver//./_}.tar.gz)
md5sums=('70c28c1e41d5888aa158e6e15644b742')

build() {
  cd "$srcdir"/libming-${pkgname}-${pkgver//./_}/
  ./autogen.sh
  PYTHON=/usr/bin/python2 ./configure --prefix=/usr --enable-python

  # Strange that this can fail when we let the Makefile do it
  pushd src/actioncompiler
  bison -y -p swf4 -b swf4compiler swf4compiler.y
  bison -y -p swf5 -b swf5compiler swf5compiler.y
  popd
  make
}

package() {
  cd "$srcdir"/libming-${pkgname}-${pkgver//./_}/
  make DESTDIR="$pkgdir" install
}

