# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>

buildarch=4

pkgname=gst-imx
_commit=467c91a91651eb41d2a50419de8791cbe34be7aa
pkgver=0.10.0
pkgrel=3
pkgdesc="GStreamer plugins for i.MX platforms"
arch=('armv7h')
license=('LGPL')
url="https://github.com/Freescale/gstreamer-imx"
depends=('gst-plugins-base-libs' 'libfslvpuwrap' 'gpu-viv-bin-mx6q-fb')
makedepends=('python2' 'linux-headers-imx6-fsl')
source=("https://github.com/Freescale/gstreamer-imx/archive/${_commit}.tar.gz")
md5sums=('c60c77aede853a9b97d62a90b0d3e3a0')

LDFLAGS+=' -L/opt/fsl/lib'
CPPFLAGS+=' -I/opt/fsl/include'

build() {
  cd gstreamer-imx-${_commit}

  export PKG_CONFIG_PATH='/opt/fsl/lib/pkgconfig'

  python2 waf configure --prefix=/usr \
    --with-package-name="GStreamer plugins for i.MX platforms" \
    --with-package-origin="https://github.com/archlinuxarm/PKGBUILDs/tree/master/alarm/gst-imx" \
    --egl-platform=fb \
    --kernel-headers=/usr/include
  
  python2 waf build $MAKEFLAGS
}

package() {
  cd gstreamer-imx-${_commit}
  python2 waf install --destdir="$pkgdir"
}