# $Id: PKGBUILD 218238 2014-07-27 18:40:21Z heftig $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gst-libav
pkgver=1.4.0
pkgrel=2
pkgdesc="Gstreamer libav Plugin"
arch=('i686' 'x86_64')
license=('GPL')
url="http://gstreamer.freedesktop.org/"
depends=('gst-plugins-base-libs' 'bzip2')
makedepends=('python' 'yasm')
options=(!emptydirs)
provides=("gst-ffmpeg=$pkgver-$pkgrel")
source=(${url}/src/$pkgname/$pkgname-$pkgver.tar.xz)
sha256sums=('c82c7a657863f2e27ac5cba539b0bd0a8114ad6bd4ba33bae777e4dbfab9e380')

prepare() {
  cd $pkgname-$pkgver
}

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-static --with-libav-extra-configure="--enable-runtime-cpudetect" \
    --with-package-name="GStreamer libav Plugin (Arch Linux)" \
    --with-package-origin="http://www.archlinux.org/"

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
}
