# Template file for 'mpv'
pkgname=mpv
version=0.9.2
revision=1
short_desc="Video player based on MPlayer/mplayer2"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="GPL-2"
homepage="http://mpv.io"
build_style=waf
hostmakedepends="pkg-config python-docutils perl"
makedepends="
 ffmpeg-devel libass-devel lcms2-devel libXinerama-devel lua-devel v4l-utils-devel
 libXv-devel libxkbcommon-devel libva-glx-devel libvdpau-devel alsa-lib-devel
 pulseaudio-devel libbluray-devel libcdio-paranoia-devel libdvdread-devel
 MesaLib-devel harfbuzz-devel libXScrnSaver-devel jack-devel libdvdnav-devel
 wayland-devel libuuid-devel libguess-devel libXrandr-devel samba-devel"
depends="desktop-file-utils hicolor-icon-theme"
conf_files="/etc/mpv/encoding-profiles.conf"
distfiles="https://github.com/mpv-player/${pkgname}/archive/v${version}.tar.gz"
checksum=c0148f55dbd17705f49bb496d0ce374419de62e1b17195d91409d7727cbd4751

pre_configure() {
	python bootstrap.py
	sed -i 's,/usr/local/etc/mpv.conf,/etc/mpv/mpv.conf,' etc/example.conf
}
do_configure() {
	python waf configure --prefix=/usr --confdir=/etc/mpv \
		--docdir=/usr/share/examples/mpv --enable-zsh-comp \
		--enable-cdda --enable-libmpv-shared \
		--disable-libbs2b --disable-oss-audio --disable-sdl2
}

mpv-devel_package() {
	depends="mpv>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
