### this file is sourced not run
PKGVER=1.22.4
PKGBUILD=1
PKGARCH=i686

# source: BLFS 11.3 updated to SVN r890
TARBALL=gst-plugins-bad-$PKGVER.tar.xz
MD5SUM=1fc0788308eeaa9f3af8c69c9577caa8
SRC_URL=http://gstreamer.freedesktop.org/src/gst-plugins-bad/$TARBALL
BUNDLE=

SLACKREQ='gstreamer2_32 gst2-plugins-base32 curl32 liborc32 libfaad2_32 libfaac32 libjasper32 \
libmodplug32 librsvg32 libsndfile32 librtmp32 libschroedinger32 libSDL32 libxvidcore32 \
libopus32 libvpx32 libass32 libvdpau32 libneon32' # mjpegtools32 we don't build it
SLACKDESC="gst2-plugins-bad32: gst2-plugins-bad32 $PKGVER (Gstreamer bad plugins)  
gst2-plugins-bad32:  
gst2-plugins-bad32: The GStreamer Bad Plug-ins package contains a set a set of 
gst2-plugins-bad32: plug-ins that aren'\''t up to par compared to the rest. They 
gst2-plugins-bad32: might be close to being good quality, but they'\''re missing 
gst2-plugins-bad32: something - be it a good code review, some documentation, a 
gst2-plugins-bad32: set of tests, a real live maintainer, or some actual wide 
gst2-plugins-bad32: use.  
gst2-plugins-bad32: 
gst2-plugins-bad32: This set of plugins are for gstreamer2 framework.
gst2-plugins-bad32: This contains 32-bit version of the library.
"

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
	mkdir usr/share
	if [ -d tmp/gir ]; then
		mv -v tmp/*-32 usr/bin
		mv -v tmp/gir usr/share/gir-1.0-$USE_ARCH
	fi	
}

### build
pkg_build() {
	cp /tmp/pkg/ladspa.h /usr/include &&
	
	cd /tmp/gst-*

	mkdir build &&
	cd build &&
	meson setup $MESONFLAGS \
		-Dgpl=enabled       \
		-Dpackage-origin=https://www.linuxfromscratch.org/blfs/view/11.3/ \
		-Dpackage-name="GStreamer $PKGVER BLFS" \
		--wrap-mode=nodownload           \
		-Dintrospection=disabled         \
		--libexec=/usr/$LIBDIR/gstreamer \
	.. &&
	ninja $NINJAFLAGS &&
	ninja $NINJAINSTALLFLAGS install &&
	
	pkg_build_slackdesc &&
	rm -f /usr/include/ladspa.h &&
	
	# multilib
	if [ -d /usr/share/gir-1.0-32 ]; then
		mkdir -p /tmp/gir && mv -v /usr/share/gir-1.0/* /tmp/gir
	fi
}


