view multimedia/gst-plugins-good/gst-plugins-good.sh @ 1019:ddab65a5b3f5

vanilla: use /bin/busybox sh as default shell
author David Demelier <markand@malikania.fr>
date Thu, 29 Aug 2019 23:35:00 +0200
parents a133976e0783
children 60d881a89c6a
line wrap: on
line source

#!/bin/busybox sh
#
# Copyright (c) 2019 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

PKGNAME=gst-plugins-good
PKGVERSION=1.16.0
PKGREVISION=1
PKGLICENSE="GPLv2"
PKGSUMMARY="gstreamer good plugins"
PKGDOWNLOAD="https://gstreamer.freedesktop.org/src/gst-plugins-good/$PKGNAME-$PKGVERSION.tar.xz"
PKGDEPENDS="meson:build gstreamer"
PKGOPTIONS="BZIP2 CAIRO FLAC GTK JACK JPEG LAME LIBSOUP NLS OSS PNG PULSEAUDIO QT X"

: ${CC:=clang}
: ${CFLAGS:=-O2}
: ${CXX:=clang++}
: ${CXXFLAGS:=-O2}
: ${LDFLAGS:=}
: ${BZIP2:=yes}
: ${CAIRO:=yes}
: ${FLAC:=yes}
: ${GTK:=yes}
: ${JACK:=yes}
: ${JPEG:=yes}
: ${LAME:=yes}
: ${LIBSOUP:=yes}
: ${NLS:=yes}
: ${OSS:=yes}
: ${PNG:=yes}
: ${PULSEAUDIO:=yes}
: ${QT:=no}
: ${X:=yes}

if [ "$BZIP2" = "yes" ]; then
	PKGDEPENDS="bzip2 $PKGDEPENDS"
	with_bzip2="-D bz2=enabled"
else
	with_bzip2="-D bz2=disabled"
fi

if [ "$CAIRO" = "yes" ]; then
	PKGDEPENDS="cairo $PKGDEPENDS"
	with_cairo="-D cairo=enabled"
else
	with_cairo="-D cairo=disabled"
fi

if [ "$FLAC" = "yes" ]; then
	PKGDEPENDS="flac $PKGDEPENDS"
	with_flac="-D flac=enabled"
else
	with_flac="-D flac=disabled"
fi

if [ "$GTK" = "yes" ]; then
	PKGDEPENDS="gtk gdk-pixbuf $PKGDEPENDS"
	with_gtk="-D gtk3=enabled -D gdk-pixbuf=enabled"
else
	with_gtk="-D gtk3=disabled -D gdk-pixbuf=disabled"
fi

if [ "$JACK" = "yes" ]; then
	PKGDEPENDS="audio/jack $PKGDEPENDS"
	with_jack="-D jack=enabled"
else
	with_jack="-D jack=disabled"
fi

if [ "$JPEG" = "yes" ]; then
	PKGDEPENDS="libjpeg-turbo $PKGDEPENDS"
	with_jpeg="-D jpeg=enabled"
else
	with_jpeg="-D jpeg=disabled"
fi

if [ "$LAME" = "yes" ]; then
	PKGDEPENDS="lame $PKGDEPENDS"
	with_lame="-D lame=enabled"
else
	with_lame="-D lame=disabled"
fi

if [ "$NLS" = "yes" ]; then
	PKGDEPENDS="gettext $PKGDEPENDS"
	with_nls="-D nls=enabled"
else
	with_nls="-D nls=disabled"
fi

if [ "$OSS" = "yes" ]; then
	PKGDEPENDS="linux-headers:build $PKGDEPENDS"
	with_oss="-D oss=enabled"
else
	with_oss="-D oss=disabled"
fi

if [ "$PNG" = "yes" ]; then
	PKGDEPENDS="lib/libpng $PKGDEPENDS"
	with_png="-D png=enabled"
else
	with_png="-D png=disabled"
fi

if [ "$PULSEAUDIO" = "yes" ]; then
	PKGDEPENDS="pulseaudio $PKGDEPENDS"
	with_pulseaudio="-D pulse=enabled"
else
	with_pulseaudio="-D pulse=disabled"
fi

if [ "$QT" = "yes" ]; then
	PKGDEPENDS="qtbase $PKGDEPENDS"
	with_qt="-D qt5=enabled"
else
	with_qt="-D qt5=disabled"
fi

if [ "$LIBSOUP" = "yes" ]; then
	PKGDEPENDS="libsoup $PKGDEPENDS"
	with_libsoup="-D soup=enabled"
else
	with_libsoup="-D soup=disabled"
fi

if [ "$X" = "yes" ]; then
	PKGDEPENDS="libx11
	            libxdamage
	            libxext
	            libxfixes $PKGDEPENDS"
	with_x="-D ximagesrc=enabled"
	with_x="-D ximagesrc-xshm=enabled $with_x"
	with_x="-D ximagesrc-xfixes=enabled $with_x"
	with_x="-D ximagesrc-xdmage=enabled $with_x"
else
	with_x="-D ximagesrc=disabled"
	with_x="-D ximagesrc-xshm=disabled $with_x"
	with_x="-D ximagesrc-xfixes=disabled $with_x"
	with_x="-D ximagesrc-xdmage=disabled $with_x"
fi

build()
{
	rm -rf $PKGNAME-$PKGVERSION
	tar xvf $PKGNAME-$PKGVERSION.tar.xz
	cd $PKGNAME-$PKGVERSION

	CC="$CC" \
	CFLAGS="$CFLAGS" \
	CXX="$CXX" \
	CXXFLAGS="$CXXFLAGS" \
	LDFLAGS="$LDFLAGS" \
	meson . build \
		--prefix / \
		--buildtype release \
		--default-library shared \
		-D tests=disabled \
		$with_bzip2 \
		$with_cairo \
		$with_flac \
		$with_gtk \
		$with_jpeg \
		$with_jack \
		$with_lame \
		$with_libsoup \
		$with_nls \
		$with_oss \
		$with_png \
		$with_pulseaudio \
		$with_qt \
		$with_x
	CC="$CC" ninja -C build
	DESTDIR=$DESTDIR ninja -C build install

	cd ..
	rm -rf $PKGNAME-$PKGVERSION
}