aboutsummaryrefslogtreecommitdiffstats
path: root/community/mpv/APKBUILD
blob: 82cc6f2e58f4a4376614e9e4a27b109d6a812f27 (plain) (blame)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Jakub Skrzypnik <j.skrzypnik@openmailbox.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mpv
pkgver=0.33.1
pkgrel=6
pkgdesc="Video player based on MPlayer/mplayer2"
url="https://mpv.io/"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	alsa-lib-dev
	cmocka-dev
	faac-dev
	ffmpeg-dev
	freetype-dev
	jack-dev
	lame-dev
	libao-dev
	libass-dev
	libbluray-dev
	libcdio-paranoia-dev
	libdvdnav-dev
	libmad-dev
	libplacebo-dev
	libtheora-dev
	libva-dev>=2.4.1
	libvdpau-dev
	libxext-dev
	libxinerama-dev
	libxkbcommon-dev
	libxrandr-dev
	libxscrnsaver-dev
	libxv-dev
	libxvmc-dev
	libxxf86dga-dev
	lua5.2-dev
	mesa-dev
	perl
	pulseaudio-dev
	py3-docutils
	python3
	shaderc-dev
	ttf-dejavu
	uchardet-dev
	vulkan-headers
	vulkan-loader-dev
	waf
	wayland-dev
	wayland-protocols
	x264-dev
	xvidcore-dev
	zlib-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-libs
	$pkgname-dev
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	"
source="mpv-$pkgver.tar.gz::https://github.com/mpv-player/mpv/archive/v$pkgver.tar.gz
	placebo_upstream_api_changes.patch
	yt-dlp.patch
	"

# secfixes:
#   0.27.0-r3:
#     - CVE-2018-6360

prepare() {
	default_prepare

	# Using our system waf so we don't have to download it at build time
	# This also fixes the build on riscv64
	ln -s /usr/bin/waf waf
}

build() {
	RST2HTML=rst2html-3 RST2MAN=rst2man-3 \
	python3 waf configure --prefix=/usr \
		--mandir=/usr/share/man \
		--confdir=/etc/mpv \
		--disable-build-date \
		--enable-alsa \
		--enable-jack \
		--enable-pulse \
		--enable-libmpv-shared \
		--enable-wayland \
		--enable-lua \
		--enable-test \
		--enable-vulkan \
		--enable-uchardet \
		--enable-cdda \
		--enable-dvdnav
	python3 waf build
}

check() {
	find build/test/ -perm -111 -exec '{}' ';'
}

package() {
	python3 waf install --destdir="$pkgdir"

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -m644 "$builddir"/DOCS/*.rst "$builddir"/DOCS/*.md \
		"$pkgdir"/usr/share/doc/$pkgname/

	# 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/
}

# NOTE(maxice8): Remove these 2 functions once the default functions as defined
# in https://gitlab.alpinelinux.org/alpine/abuild/merge_requests/16 are merged
bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
	amove usr/share/bash-completion
}

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

	amove usr/share/zsh/site-functions
}

sha512sums="
99d6c40d18c5cf83814b44ec6d8eade229800c5b51a734c9bbe831c3aeb95f8931124c94f6ae2360ffff62053c163bc3c55b254df021e005b350ebc3df7e952b  mpv-0.33.1.tar.gz
92833a516fe995289a4de40703bdf57925d86d644404a4c37b6455d952605a83872898575ae0b44432a1eeb178476079ac53ccb5487cbb9b2704fbcd460fa4ad  placebo_upstream_api_changes.patch
400f3f2aca612b76ca49214a5dd2e5c540df9691cfc663c48d0b104fb547931925232bc5f4c5a5c9aa87747b0122dc22f188122a98f41df6da250b787e323e1d  yt-dlp.patch
"