#Maintainer: Dimitris Tzemos <djemos~at~slackel~dot~gr>

pkgname=vlc
pkgver=2.1.2
pkgrel=1dj
arch=${arch:-i686}

source=("http://download.videolan.org/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.xz"
		"vlc-2.0.7-vaapi-compat.patch" "vlc-2.1_deffont.patch")
        
sourcetemplate=http://people.salixos.org/djemos/$pkgname
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://www.videolan.org/vlc/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname - a multimedia player"
"VLC (initially VideoLAN Client) is a highly portable multimedia player"
"for various A/V formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg,...)"
"as well as DVDs, VCDs, and various streaming protocols. It can also be"
"used as a server to stream in unicast or multicast in IPv4 or IPv6 on"
"a high-bandwidth network."
)


build() {
	
	cd "${SRC}/${pkgname}-${pkgver/.a}"
	
	patch -Np1 -i ../vlc-2.0.7-vaapi-compat.patch || return 1
	# Configure a default Slackware TTF font:
	patch -Np1 -i ../vlc-2.1_deffont.patch || return 1
	
	NCURSES_CFLAGS="$(ncursesw5-config --cflags) -I/usr/include" \
	NCURSES_LIBS="$(ncursesw5-config --libs)" \
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} \
			--localstatedir=/var --sysconfdir=/etc \
            --disable-rpath \
            --enable-faad \
			--enable-nls \
            --enable-lirc \
            --enable-ncurses \
            --enable-realrtsp \
            --enable-aa \
            --enable-vcdx \
            --enable-upnp \
			--disable-gnomevfs
			
	make -j $numjobs || return 1
	make install DESTDIR=$PKG
	
	for res in 16 32 48 128; do
	install -D -m644 "${SRC}/vlc-${pkgver/.a}/share/icons/${res}x${res}/vlc.png" \
        "${PKG}/usr/share/icons/hicolor/${res}x${res}/apps/vlc.png"
  done
}