# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gstreamer
pkgver=1.12.3
pkgrel=1
pkgdesc="GStreamer Multimedia Framework"
url="https://gstreamer.freedesktop.org/"
arch="all"
license="LGPL-2.0+"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools $pkgname-lang"
replaces="gstreamer1"
depends_dev="libxml2-dev"
makedepends="$depends_dev bison flex gobject-introspection-dev glib-dev"
source="https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$pkgver.tar.xz
	"
builddir="$srcdir"/gstreamer-$pkgver

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--enable-introspection \
		--with-package-name="GStreamer (${DISTRO_NAME:-Alpine Linux})" \
		--with-package-origin="${DISTRO_URL:-http://alpinelinux.org/}" \
		--disable-fatal-warnings \
		--with-ptp-helper-permissions=none
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

tools() {
	pkgdesc="common tools and files for GStreamer streaming media framework"
	# gst-feedback needs this
	depends="pkgconfig"
	mkdir -p "$subpkgdir"/usr/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

doc() {
	default_doc
	replaces="${pkgname}1-doc"
}
sha512sums="fceeeca4314aead7ff358db3474bd6fe1eef70f745a6ba20505da6c0caaea6ea6317246dc66c23edab396ca811a610c52fa930f8f99c701241ae7f15857aa2b0  gstreamer-1.12.3.tar.xz"
