# $Id: PKGBUILD 211616 2014-04-21 16:57:39Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gst-plugins-ugly
pkgver=1.2.4
pkgrel=1
pkgdesc="GStreamer Multimedia Framework Ugly Plugins"
arch=('i686' 'x86_64')
license=('LGPL')
url="http://gstreamer.freedesktop.org/"
depends=('gst-plugins-base-libs' 'libdvdread' 'lame' 'libmpeg2' 'a52dec' 'libmad' 'libsidplay' 'libcdio' 'x264' 'opencore-amr')
makedepends=('python' 'gtk-doc')
options=(!emptydirs)
source=(${url}/src/$pkgname/$pkgname-$pkgver.tar.xz)
sha256sums=('4ef6f76a47d57b8385d457c7b620b4c28fc041ab1d7c2e3e2f5f05b12b988ea8')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-static --enable-experimental --enable-gtk-doc \
    --with-package-name="GStreamer Ugly Plugins (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
}
