aboutsummaryrefslogtreecommitdiffstats
path: root/community/mpv/APKBUILD
blob: d5f06b8e710015f90a4618ae502bfaf5e1166229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mpv
pkgver=0.17.0
pkgrel=0
pkgdesc="Video player based on MPlayer/mplayer2"
url="http://mpv.io/"
arch="all"
license="GPL"
depends=""
makedepends="libxxf86dga-dev libxv-dev libmad-dev lame-dev libao-dev
	libtheora-dev xvidcore-dev zlib-dev sdl-dev freetype-dev
	x264-dev faac-dev ttf-dejavu libxvmc-dev alsa-lib-dev libva-dev
	mesa-dev ffmpeg-dev libass-dev perl lua5.2-dev libvdpau-dev python
	libxext-dev libxscrnsaver-dev py-docutils rsound-dev libxrandr-dev"
install=""
subpackages="
	$pkgname-doc
	$pkgname-libs
	$pkgname-zsh-completion:zshcomp"
source="$pkgname-$pkgver.tar.gz::https://github.com/mpv-player/mpv/archive/v$pkgver.tar.gz
	"

_builddir="$srcdir"/mpv-$pkgver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	./bootstrap.py || return 1
}

build() {
	cd "$_builddir"
	./waf configure --prefix=/usr \
		--mandir=/usr/share/man \
		--confdir=/etc/mpv \
		--enable-alsa \
		--enable-libass \
		--enable-libmpv-shared \
		--enable-rsound \
		--enable-xrandr \
		--enable-xss \
		--enable-zsh-comp \
		|| return 1
	./waf build || return 1
}

package() {
	cd "$_builddir"
	./waf install --destdir="$pkgdir" || return 1

	local file=
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	for file in "$_builddir"/DOCS/*.rst "$_builddir"/DOCS/*.md; do
		install -Dm644 "$file" \
			"$pkgdir"/usr/share/doc/$pkgname || return 1
	done

	# Move example configuration files to subdirectory
	mkdir -p "$pkgdir"/usr/share/doc/mpv/examples
	mv "$pkgdir"/usr/share/doc/mpv/*.conf \
		"$pkgdir"/usr/share/doc/mpv/examples/ || return 1
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"
	arch="noarch"

	mkdir -p "$subpkgdir/usr/share/zsh/site-functions"
	mv "$pkgdir/usr/share/zsh/site-functions"/* \
		"$subpkgdir/usr/share/zsh/site-functions" || return 1
}

md5sums="6253da021af1fcc8c1998a190ac593cc  mpv-0.17.0.tar.gz"
sha256sums="602cd2b0f5fc7e43473234fbb96e3f7bbb6418f15eb8fa720d9433cce31eba6e  mpv-0.17.0.tar.gz"
sha512sums="fb79738a16dbc12b60199a68836aca121a800958af4eaf6c2bdf1114bde36c156bafc232e814045a16fd738d2de1e2d8392bc98507961e5a73fa692e270dc7a2  mpv-0.17.0.tar.gz"