1 |
commit: 164240d03f6cd3d36515dcb7ae336811a6c6b8c0 |
2 |
Author: Ilya Tumaykin <itumaykin <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Feb 12 21:09:07 2017 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 14 21:41:10 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=164240d0 |
7 |
|
8 |
media-video/mpv: revbump to 0.22.0-r2 to sync with 9999 |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
media-video/mpv/mpv-0.22.0-r2.ebuild | 380 +++++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 380 insertions(+) |
14 |
|
15 |
diff --git a/media-video/mpv/mpv-0.22.0-r2.ebuild b/media-video/mpv/mpv-0.22.0-r2.ebuild |
16 |
new file mode 100644 |
17 |
index 0000000000..1ef4e46553 |
18 |
--- /dev/null |
19 |
+++ b/media-video/mpv/mpv-0.22.0-r2.ebuild |
20 |
@@ -0,0 +1,380 @@ |
21 |
+# Copyright 1999-2017 Gentoo Foundation |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+# $Id$ |
24 |
+ |
25 |
+EAPI=6 |
26 |
+ |
27 |
+PYTHON_COMPAT=( python{2_7,3_4,3_5} ) |
28 |
+PYTHON_REQ_USE='threads(+)' |
29 |
+ |
30 |
+WAF_PV=1.8.12 |
31 |
+ |
32 |
+inherit gnome2-utils pax-utils python-r1 toolchain-funcs versionator waf-utils xdg-utils |
33 |
+ |
34 |
+DESCRIPTION="Media player based on MPlayer and mplayer2" |
35 |
+HOMEPAGE="https://mpv.io/" |
36 |
+ |
37 |
+if [[ ${PV} != *9999* ]]; then |
38 |
+ SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
39 |
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux" |
40 |
+ DOCS=( RELEASE_NOTES ) |
41 |
+else |
42 |
+ EGIT_REPO_URI=( {https,git}://github.com/mpv-player/mpv.git ) |
43 |
+ inherit git-r3 |
44 |
+fi |
45 |
+SRC_URI+=" https://waf.io/waf-${WAF_PV}" |
46 |
+DOCS+=( README.md ) |
47 |
+ |
48 |
+# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC. |
49 |
+LICENSE="GPL-2+ BSD ISC" |
50 |
+SLOT="0" |
51 |
+IUSE="+alsa aqua archive bluray cdda +cli coreaudio doc drm dvb dvd +egl +enca |
52 |
+ encode gbm +iconv jack jpeg lcms +libass libav libcaca libguess libmpv +lua |
53 |
+ luajit openal +opengl oss pulseaudio raspberry-pi rubberband samba sdl |
54 |
+ selinux test tools +uchardet v4l vaapi vdpau vf-dlopen wayland +X xinerama |
55 |
+ +xscreensaver +xv zsh-completion" |
56 |
+IUSE+=" cpu_flags_x86_sse4_1" |
57 |
+ |
58 |
+REQUIRED_USE=" |
59 |
+ || ( cli libmpv ) |
60 |
+ aqua? ( opengl ) |
61 |
+ egl? ( || ( gbm X wayland ) ) |
62 |
+ enca? ( iconv ) |
63 |
+ gbm? ( drm egl ) |
64 |
+ lcms? ( || ( opengl egl ) ) |
65 |
+ libguess? ( iconv ) |
66 |
+ luajit? ( lua ) |
67 |
+ opengl? ( || ( aqua X !cli? ( libmpv ) ) ) |
68 |
+ test? ( || ( opengl egl ) ) |
69 |
+ tools? ( cli ) |
70 |
+ uchardet? ( iconv ) |
71 |
+ v4l? ( || ( alsa oss ) ) |
72 |
+ vaapi? ( || ( gbm X wayland ) ) |
73 |
+ vdpau? ( X ) |
74 |
+ wayland? ( egl ) |
75 |
+ xinerama? ( X ) |
76 |
+ xscreensaver? ( X ) |
77 |
+ xv? ( X ) |
78 |
+ zsh-completion? ( cli ) |
79 |
+" |
80 |
+ |
81 |
+COMMON_DEPEND=" |
82 |
+ !libav? ( >=media-video/ffmpeg-2.4:0=[encode?,threads,vaapi?,vdpau?] ) |
83 |
+ libav? ( >=media-video/libav-11:0=[encode?,threads,vaapi?,vdpau?] ) |
84 |
+ sys-libs/zlib |
85 |
+ alsa? ( >=media-libs/alsa-lib-1.0.18 ) |
86 |
+ archive? ( >=app-arch/libarchive-3.0.0:= ) |
87 |
+ bluray? ( >=media-libs/libbluray-0.3.0 ) |
88 |
+ cdda? ( dev-libs/libcdio-paranoia ) |
89 |
+ drm? ( x11-libs/libdrm ) |
90 |
+ dvd? ( |
91 |
+ >=media-libs/libdvdnav-4.2.0 |
92 |
+ >=media-libs/libdvdread-4.1.0 |
93 |
+ ) |
94 |
+ egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] ) |
95 |
+ iconv? ( |
96 |
+ virtual/libiconv |
97 |
+ enca? ( app-i18n/enca ) |
98 |
+ libguess? ( >=app-i18n/libguess-1.0 ) |
99 |
+ uchardet? ( app-i18n/uchardet ) |
100 |
+ ) |
101 |
+ jack? ( virtual/jack ) |
102 |
+ jpeg? ( virtual/jpeg:0 ) |
103 |
+ lcms? ( >=media-libs/lcms-2.6:2 ) |
104 |
+ libass? ( |
105 |
+ >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz] |
106 |
+ virtual/ttf-fonts |
107 |
+ ) |
108 |
+ libcaca? ( >=media-libs/libcaca-0.99_beta18 ) |
109 |
+ lua? ( |
110 |
+ !luajit? ( <dev-lang/lua-5.3:= ) |
111 |
+ luajit? ( dev-lang/luajit:2 ) |
112 |
+ ) |
113 |
+ openal? ( >=media-libs/openal-1.13 ) |
114 |
+ opengl? ( X? ( virtual/opengl ) ) |
115 |
+ pulseaudio? ( media-sound/pulseaudio ) |
116 |
+ raspberry-pi? ( |
117 |
+ >=media-libs/raspberrypi-userland-0_pre20160305-r1 |
118 |
+ virtual/opengl |
119 |
+ ) |
120 |
+ rubberband? ( >=media-libs/rubberband-1.8.0 ) |
121 |
+ samba? ( net-fs/samba[smbclient(+)] ) |
122 |
+ sdl? ( media-libs/libsdl2[sound,threads,video,X?,wayland?] ) |
123 |
+ v4l? ( media-libs/libv4l ) |
124 |
+ vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] ) |
125 |
+ vdpau? ( >=x11-libs/libvdpau-0.2 ) |
126 |
+ wayland? ( |
127 |
+ >=dev-libs/wayland-1.6.0 |
128 |
+ >=x11-libs/libxkbcommon-0.3.0 |
129 |
+ ) |
130 |
+ X? ( |
131 |
+ x11-libs/libX11 |
132 |
+ x11-libs/libXext |
133 |
+ >=x11-libs/libXrandr-1.2.0 |
134 |
+ opengl? ( x11-libs/libXdamage ) |
135 |
+ xinerama? ( x11-libs/libXinerama ) |
136 |
+ xscreensaver? ( x11-libs/libXScrnSaver ) |
137 |
+ xv? ( x11-libs/libXv ) |
138 |
+ ) |
139 |
+" |
140 |
+DEPEND="${COMMON_DEPEND} |
141 |
+ ${PYTHON_DEPS} |
142 |
+ dev-lang/perl |
143 |
+ dev-python/docutils |
144 |
+ virtual/pkgconfig |
145 |
+ doc? ( dev-python/rst2pdf ) |
146 |
+ dvb? ( virtual/linuxtv-dvb-headers ) |
147 |
+ test? ( >=dev-util/cmocka-1.0.0 ) |
148 |
+ v4l? ( virtual/os-headers ) |
149 |
+" |
150 |
+RDEPEND="${COMMON_DEPEND} |
151 |
+ selinux? ( sec-policy/selinux-mplayer ) |
152 |
+ tools? ( ${PYTHON_DEPS} ) |
153 |
+" |
154 |
+ |
155 |
+PATCHES=( |
156 |
+ "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch" |
157 |
+ "${FILESDIR}/${PN}-rely-on-pkgconfig-for-raspberrypi-compiler-flags.patch" |
158 |
+) |
159 |
+ |
160 |
+mpv_check_compiler() { |
161 |
+ if [[ ${MERGE_TYPE} != "binary" ]]; then |
162 |
+ if tc-is-gcc && ( [[ $(gcc-major-version) -lt 4 ]] || \ |
163 |
+ ( [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -lt 5 ]] ) ); then |
164 |
+ die "${PN} requires GCC>=4.5." |
165 |
+ fi |
166 |
+ if ( use opengl || use egl ) && ! tc-has-tls; then |
167 |
+ die "Your compiler lacks C++11 TLS support. Use GCC>=4.8 or Clang>=3.3." |
168 |
+ fi |
169 |
+ if use vaapi && use cpu_flags_x86_sse4_1 && ! tc-is-gcc; then |
170 |
+ die "${PN} requires GCC for SSE4.1 intrinsics." |
171 |
+ fi |
172 |
+ fi |
173 |
+} |
174 |
+ |
175 |
+pkg_pretend() { |
176 |
+ mpv_check_compiler |
177 |
+} |
178 |
+ |
179 |
+pkg_setup() { |
180 |
+ mpv_check_compiler |
181 |
+ [[ ${MERGE_TYPE} != "binary" ]] && python_setup |
182 |
+} |
183 |
+ |
184 |
+src_prepare() { |
185 |
+ cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die |
186 |
+ chmod +x "${S}"/waf || die |
187 |
+ default_src_prepare |
188 |
+} |
189 |
+ |
190 |
+src_configure() { |
191 |
+ tc-export CC PKG_CONFIG AR |
192 |
+ |
193 |
+ if tc-is-cross-compiler && use raspberry-pi; then |
194 |
+ export EXTRA_PKG_CONFIG_LIBDIR="${SYSROOT%/}${EPREFIX}/opt/vc/lib/pkgconfig" |
195 |
+ # Drop next line when Gentoo bug 607344 is fixed or if you fixed it locally. |
196 |
+ die "${PN} can't be cross built with raspberry-pi USE enabled. See Gentoo bug 607344." |
197 |
+ fi |
198 |
+ |
199 |
+ local mywafargs=( |
200 |
+ --confdir="${EPREFIX}/etc/${PN}" |
201 |
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" |
202 |
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" |
203 |
+ |
204 |
+ $(usex cli '' '--disable-cplayer') |
205 |
+ $(use_enable libmpv libmpv-shared) |
206 |
+ |
207 |
+ # See deep down below for build-date. |
208 |
+ --disable-libmpv-static |
209 |
+ --disable-static-build |
210 |
+ --disable-optimize # Don't add '-O2' to CFLAGS. |
211 |
+ --disable-debug-build # Don't add '-g' to CFLAGS. |
212 |
+ --enable-html-build |
213 |
+ |
214 |
+ $(use_enable doc pdf-build) |
215 |
+ $(use_enable vf-dlopen vf-dlopen-filters) |
216 |
+ $(use_enable zsh-completion zsh-comp) |
217 |
+ $(use_enable test) |
218 |
+ |
219 |
+ $(use_enable iconv) |
220 |
+ $(use_enable samba libsmbclient) |
221 |
+ $(use_enable lua) |
222 |
+ $(usex luajit '--lua=luajit' '') |
223 |
+ $(use_enable libass) |
224 |
+ $(use_enable libass libass-osd) |
225 |
+ $(use_enable encode encoding) |
226 |
+ $(use_enable bluray libbluray) |
227 |
+ $(use_enable dvd dvdread) |
228 |
+ $(use_enable dvd dvdnav) |
229 |
+ $(use_enable cdda) |
230 |
+ $(use_enable enca) |
231 |
+ $(use_enable libguess) |
232 |
+ $(use_enable uchardet) |
233 |
+ $(use_enable rubberband) |
234 |
+ $(use_enable lcms lcms2) |
235 |
+ --disable-vapoursynth # Only available in overlays. |
236 |
+ --disable-vapoursynth-lazy |
237 |
+ $(use_enable archive libarchive) |
238 |
+ |
239 |
+ --enable-libavdevice |
240 |
+ |
241 |
+ # Audio outputs: |
242 |
+ $(use_enable sdl sdl2) # Listed under audio, but also includes video. |
243 |
+ --disable-sdl1 |
244 |
+ $(use_enable oss oss-audio) |
245 |
+ --disable-rsound # Only available in overlays. |
246 |
+ --disable-sndio # Only available in overlays. |
247 |
+ $(use_enable pulseaudio pulse) |
248 |
+ $(use_enable jack) |
249 |
+ $(use_enable openal) |
250 |
+ --disable-opensles |
251 |
+ $(use_enable alsa) |
252 |
+ $(use_enable coreaudio) |
253 |
+ |
254 |
+ # Video outputs: |
255 |
+ $(use_enable aqua cocoa) |
256 |
+ $(use_enable drm) |
257 |
+ $(use_enable gbm) |
258 |
+ $(use_enable wayland) |
259 |
+ $(use_enable X x11) |
260 |
+ $(use_enable xscreensaver xss) |
261 |
+ $(use_enable X xext) |
262 |
+ $(use_enable xv) |
263 |
+ $(use_enable xinerama) |
264 |
+ $(use_enable X xrandr) |
265 |
+ $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa') |
266 |
+ $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11') |
267 |
+ $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11') |
268 |
+ $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm') |
269 |
+ $(use_enable wayland gl-wayland) |
270 |
+ $(use_enable vdpau) |
271 |
+ $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11') |
272 |
+ $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl. |
273 |
+ $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11') |
274 |
+ $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland') |
275 |
+ $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm') |
276 |
+ $(use_enable libcaca caca) |
277 |
+ $(use_enable jpeg) |
278 |
+ --disable-android |
279 |
+ $(use_enable raspberry-pi rpi) |
280 |
+ $(usex opengl "$(use_enable !aqua standard-gl)" '--disable-standard-gl') |
281 |
+ --disable-ios-gl |
282 |
+ $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl') |
283 |
+ --disable-mali-fbdev # Only available in overlays. |
284 |
+ |
285 |
+ # HWaccels: |
286 |
+ # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332. |
287 |
+ $(use_enable vaapi vaapi-hwaccel) |
288 |
+ # Automagic VDPAU HW acceleration. See Gentoo bug 558870. |
289 |
+ --disable-cuda # No support in ffmpeg. See Gentoo bug 595450. |
290 |
+ |
291 |
+ # TV features: |
292 |
+ $(use_enable v4l tv) |
293 |
+ $(use_enable v4l tv-v4l2) |
294 |
+ $(use_enable v4l libv4l2) |
295 |
+ $(use_enable v4l audio-input) |
296 |
+ $(use_enable dvb dvbin) |
297 |
+ |
298 |
+ # Miscellaneous features: |
299 |
+ --disable-apple-remote # Needs testing first. See Gentoo bug 577332. |
300 |
+ ) |
301 |
+ |
302 |
+ if use vaapi && use X; then |
303 |
+ mywafargs+=( |
304 |
+ $(use_enable opengl vaapi-glx) |
305 |
+ $(use_enable egl vaapi-x-egl) |
306 |
+ ) |
307 |
+ fi |
308 |
+ |
309 |
+ if ! use egl && ! use opengl && ! use raspberry-pi; then |
310 |
+ mywafargs+=(--disable-gl) |
311 |
+ fi |
312 |
+ |
313 |
+ # Create reproducible non-live builds. |
314 |
+ [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date) |
315 |
+ |
316 |
+ waf-utils_src_configure "${mywafargs[@]}" |
317 |
+} |
318 |
+ |
319 |
+src_install() { |
320 |
+ waf-utils_src_install |
321 |
+ |
322 |
+ if use lua; then |
323 |
+ insinto /usr/share/${PN} |
324 |
+ doins -r TOOLS/lua |
325 |
+ fi |
326 |
+ |
327 |
+ if use cli && use luajit; then |
328 |
+ pax-mark -m "${ED}"usr/bin/${PN} |
329 |
+ fi |
330 |
+ |
331 |
+ if use tools; then |
332 |
+ dobin TOOLS/{mpv_identify.sh,umpv} |
333 |
+ newbin TOOLS/idet.sh mpv_idet.sh |
334 |
+ python_replicate_script "${ED}"usr/bin/umpv |
335 |
+ fi |
336 |
+} |
337 |
+ |
338 |
+pkg_preinst() { |
339 |
+ gnome2_icon_savelist |
340 |
+} |
341 |
+ |
342 |
+pkg_postinst() { |
343 |
+ local rv softvol_0_18_1=0 osc_0_21_0=0 |
344 |
+ |
345 |
+ for rv in ${REPLACING_VERSIONS}; do |
346 |
+ version_compare ${rv} 0.18.1 |
347 |
+ [[ $? -eq 1 ]] && softvol_0_18_1=1 |
348 |
+ version_compare ${rv} 0.21.0 |
349 |
+ [[ $? -eq 1 ]] && osc_0_21_0=1 |
350 |
+ done |
351 |
+ |
352 |
+ if [[ ${softvol_0_18_1} -eq 1 ]]; then |
353 |
+ elog "Since version 0.18.1 the software volume control is always enabled." |
354 |
+ elog "This means that volume controls don't change the system volume," |
355 |
+ elog "e.g. per-application volume with PulseAudio." |
356 |
+ elog "If you want to restore the previous behaviour, please refer to" |
357 |
+ elog |
358 |
+ elog "https://wiki.gentoo.org/wiki/Mpv#Volume_in_0.18.1" |
359 |
+ elog |
360 |
+ fi |
361 |
+ |
362 |
+ if [[ ${osc_0_21_0} -eq 1 ]]; then |
363 |
+ elog "In version 0.21.0 the default OSC layout was changed." |
364 |
+ elog "If you want to restore the previous layout, please refer to" |
365 |
+ elog |
366 |
+ elog "https://wiki.gentoo.org/wiki/Mpv#OSC_in_0.21.0" |
367 |
+ elog |
368 |
+ fi |
369 |
+ |
370 |
+ # bash-completion < 2.3-r1 already installs (mostly broken) mpv completion. |
371 |
+ if use cli && ! has_version '<app-shells/bash-completion-2.3-r1' && \ |
372 |
+ ! has_version 'app-shells/mpv-bash-completion'; then |
373 |
+ elog "If you want to have command-line completion via bash-completion," |
374 |
+ elog "please install app-shells/mpv-bash-completion." |
375 |
+ fi |
376 |
+ |
377 |
+ if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \ |
378 |
+ has_version 'app-shells/mpv-bash-completion'; then |
379 |
+ elog "If command-line completion doesn't work after mpv update," |
380 |
+ elog "please rebuild app-shells/mpv-bash-completion." |
381 |
+ fi |
382 |
+ |
383 |
+ gnome2_icon_cache_update |
384 |
+ xdg_desktop_database_update |
385 |
+} |
386 |
+ |
387 |
+pkg_postrm() { |
388 |
+ gnome2_icon_cache_update |
389 |
+ xdg_desktop_database_update |
390 |
+} |
391 |
+ |
392 |
+src_test() { |
393 |
+ cd "${S}"/build/test || die |
394 |
+ local test |
395 |
+ for test in *; do |
396 |
+ if [[ -x ${test} ]]; then |
397 |
+ ./"${test}" || die "Test suite failed" |
398 |
+ fi |
399 |
+ done |
400 |
+} |