Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/mpv/, media-video/mpv/files/0.18.0/
Date: Tue, 28 Jun 2016 13:59:42
Message-Id: 1467120623.3432419f4f26ffbfdd6a238455dd66c207433578.monsieurp@gentoo
1 commit: 3432419f4f26ffbfdd6a238455dd66c207433578
2 Author: Ilya Tumaykin <itumaykin <AT> gmail <DOT> com>
3 AuthorDate: Mon Jun 27 00:14:50 2016 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 28 13:30:23 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3432419f
7
8 media-video/mpv: verbump to 0.18.0.
9
10 Closes: https://github.com/gentoo/gentoo/pull/1765
11 Package-Manager: portage-2.3.0
12
13 Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
14
15 media-video/mpv/Manifest | 1 +
16 .../mpv-0.18.0-fix-height-alignment-on-xv.patch | 67 +++++
17 media-video/mpv/mpv-0.18.0.ebuild | 300 +++++++++++++++++++++
18 3 files changed, 368 insertions(+)
19
20 diff --git a/media-video/mpv/Manifest b/media-video/mpv/Manifest
21 index 39ac01f..ebb57d0 100644
22 --- a/media-video/mpv/Manifest
23 +++ b/media-video/mpv/Manifest
24 @@ -1,5 +1,6 @@
25 DIST mpv-0.17.0-patches-05.tar.gz 12830 SHA256 cc63d7fe5754ceb62bc8c33d50a02376ee0d5d4c3ff0763fc85787624e32b1e1 SHA512 680b5f50e5a4749ffd63712bf6160b64b37bd14bfc9f9b3912afb1a576a1ab754cdaeb20ee206e3484e037126bec395431002590ff3417ea247d2be340b4fd09 WHIRLPOOL 01e76442ed360ca0f29404038d5b082fb87d40dcf7a868377735ac63cd2df51385dd5987fe57ed6c5928ca1aca3fa8938d7fe878360025d6ea8706b7948c8531
26 DIST mpv-0.17.0.tar.gz 2882629 SHA256 602cd2b0f5fc7e43473234fbb96e3f7bbb6418f15eb8fa720d9433cce31eba6e SHA512 fb79738a16dbc12b60199a68836aca121a800958af4eaf6c2bdf1114bde36c156bafc232e814045a16fd738d2de1e2d8392bc98507961e5a73fa692e270dc7a2 WHIRLPOOL 704133b4033a5a2be8db92a4f1e52397d5b261a99a035d38e33b91d2c478e0e9bfcb2ba0e24ee03d37fffe693b275f50f7f1e453263a5afe61e8944f51eefa61
27 +DIST mpv-0.18.0.tar.gz 2758960 SHA256 b656638d4f6bce2621baaacb60d8be384aa492fcd86dfd43996aaa2c16fee02b SHA512 5a899ea680b4da6d668a6e77a254e623bafef16f376ee46639e40f151da5a000de84b382f2b07f3a1e87b60fc8e524132767fdf243e36474966af11a88277437 WHIRLPOOL c491e61cb2d7f453cfc23605120048e81c2b7621b8d9591cad6415d3b550f55db6a6c8c6f90d27c7ce214ff89f92a9861d202b457c2de25c5b7de11d8d1d40af
28 DIST mpv-0.9.2.tar.gz 2701306 SHA256 c0148f55dbd17705f49bb496d0ce374419de62e1b17195d91409d7727cbd4751 SHA512 4f652a8e78d65b0ef44a06287b05250dfdfbce4cf5a6e21d3b446eedec268d83cf98afcc687272e2da2cfac9e9f69a303847dffdfd45cecdd4273b943ce50967 WHIRLPOOL 1512bacc2ce50e875770c76106a1bb2bc1d0cc5f6e2bdce91ff8c5cfc8bf13ffb48519858a5fa2a7d57880820dc12e5eb20f34ab71eca5d76ec303618da8f3fe
29 DIST waf-1.8.12 97567 SHA256 01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b SHA512 8e47112abb134f965f15a27a600b4453cad3075afb5dadc17f2f6dac33d80ec68b679ac0ebc5f8a0245cbd07ae9fc7b899e69afc1bd021cce74e7af2ab457939 WHIRLPOOL c36d37c2d8c08e4048b4800f511611af5cf534304fcb58388ca491ff308bfcbcdd959d153edfd6ff8c118404e7293d8b786e43b07486139bf915a82aa75d792b
30 DIST waf-1.8.4 96179 SHA256 f02035fa5d8814f33f19b2b20d43822ddef6bb39b955ca196c2a247a1f9ffaa8 SHA512 3a132d8b1cba0af0e3df046c0204c5df706fae4e0fac41cf74b53f6cdea6210ed798671c7a3cb3fee70573aacab16d4c0cc699cc4b7aa74c8a416346c5513f4c WHIRLPOOL fe8d7f42e5118a1f9490a0c9add1355c969185376b57d0bab024068dd6e7364632d862bf9432e1209165c5313ae843479ef334f4bd6285db05dfebff9a1b640e
31
32 diff --git a/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch
33 new file mode 100644
34 index 0000000..550b493
35 --- /dev/null
36 +++ b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch
37 @@ -0,0 +1,67 @@
38 +commit 22c76e85db88a772e3360892cd3a673a89c6fc7a
39 +Author: wm4 <wm4@nowhere>
40 +Date: Sat Jun 25 12:44:42 2016 +0200
41 +
42 +vo_xv: fix behavior with odd sizes
43 +
44 +The size check introduced in commit d941a57b did not consider that Xv
45 +can round up the image size to the next chroma boundary. Doing that
46 +makes sense, so it can't certainly be considered server misbehavior.
47 +
48 +Do 2 things against this: allow if the server returns a larger image (we
49 +just crop it then), and also allocate a properly aligned image in the
50 +first place.
51 +---
52 +
53 +diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
54 +index 1e7ae7c..a5a4728 100644
55 +--- a/video/out/vo_xv.c
56 ++++ b/video/out/vo_xv.c
57 +@@ -533,6 +533,8 @@ static bool allocate_xvimage(struct vo *vo, int foo)
58 + struct vo_x11_state *x11 = vo->x11;
59 + // align it for faster OSD rendering (draw_bmp.c swscale usage)
60 + int aligned_w = FFALIGN(ctx->image_width, 32);
61 ++ // round up the height to next chroma boundary too
62 ++ int aligned_h = FFALIGN(ctx->image_height, 2);
63 + #if HAVE_SHM && HAVE_XEXT
64 + if (x11->display_is_local && XShmQueryExtension(x11->display)) {
65 + ctx->Shmem_Flag = 1;
66 +@@ -546,7 +548,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
67 + ctx->xvimage[foo] =
68 + (XvImage *) XvShmCreateImage(x11->display, ctx->xv_port,
69 + ctx->xv_format, NULL,
70 +- aligned_w, ctx->image_height,
71 ++ aligned_w, aligned_h,
72 + &ctx->Shminfo[foo]);
73 + if (!ctx->xvimage[foo])
74 + return false;
75 +@@ -569,7 +571,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
76 + ctx->xvimage[foo] =
77 + (XvImage *) XvCreateImage(x11->display, ctx->xv_port,
78 + ctx->xv_format, NULL, aligned_w,
79 +- ctx->image_height);
80 ++ aligned_h);
81 + if (!ctx->xvimage[foo])
82 + return false;
83 + ctx->xvimage[foo]->data = av_malloc(ctx->xvimage[foo]->data_size);
84 +@@ -578,16 +580,16 @@ static bool allocate_xvimage(struct vo *vo, int foo)
85 + XSync(x11->display, False);
86 + }
87 +
88 +- if ((ctx->xvimage[foo]->width != aligned_w) ||
89 +- (ctx->xvimage[foo]->height != ctx->image_height)) {
90 +- MP_ERR(vo, "Got XvImage with incorrect size: %ux%u (expected %ux%u)\n",
91 ++ if ((ctx->xvimage[foo]->width < aligned_w) ||
92 ++ (ctx->xvimage[foo]->height < aligned_h)) {
93 ++ MP_ERR(vo, "Got XvImage with too small size: %ux%u (expected %ux%u)\n",
94 + ctx->xvimage[foo]->width, ctx->xvimage[foo]->height,
95 + aligned_w, ctx->image_height);
96 + return false;
97 + }
98 +
99 + struct mp_image img = get_xv_buffer(vo, foo);
100 +- img.w = aligned_w;
101 ++ mp_image_set_size(&img, aligned_w, aligned_h);
102 + mp_image_clear(&img, 0, 0, img.w, img.h);
103 + return true;
104 + }
105
106 diff --git a/media-video/mpv/mpv-0.18.0.ebuild b/media-video/mpv/mpv-0.18.0.ebuild
107 new file mode 100644
108 index 0000000..792e56c
109 --- /dev/null
110 +++ b/media-video/mpv/mpv-0.18.0.ebuild
111 @@ -0,0 +1,300 @@
112 +# Copyright 1999-2016 Gentoo Foundation
113 +# Distributed under the terms of the GNU General Public License v2
114 +# $Id$
115 +
116 +EAPI=6
117 +
118 +PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
119 +PYTHON_REQ_USE='threads(+)'
120 +
121 +WAF_PV=1.8.12
122 +
123 +inherit fdo-mime gnome2-utils pax-utils python-any-r1 toolchain-funcs waf-utils
124 +
125 +DESCRIPTION="Media player based on MPlayer and mplayer2"
126 +HOMEPAGE="https://mpv.io/"
127 +
128 +if [[ ${PV} != *9999* ]]; then
129 + SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz"
130 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux"
131 + DOCS=( RELEASE_NOTES )
132 +else
133 + EGIT_REPO_URI="git://github.com/mpv-player/mpv.git"
134 + inherit git-r3
135 +fi
136 +SRC_URI+=" https://waf.io/waf-${WAF_PV}"
137 +DOCS+=( README.md )
138 +
139 +# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
140 +LICENSE="GPL-2+ BSD ISC"
141 +SLOT="0"
142 +IUSE="aqua +alsa archive bluray cdda +cli coreaudio doc drm dvb dvd +egl +enca
143 + encode gbm +iconv jack jpeg lcms +libass libav libcaca libguess libmpv lua
144 + luajit openal +opengl oss pulseaudio raspberry-pi rubberband samba -sdl
145 + selinux test uchardet v4l vaapi vdpau vf-dlopen wayland +X xinerama
146 + +xscreensaver +xv zsh-completion"
147 +
148 +REQUIRED_USE="
149 + || ( cli libmpv )
150 + aqua? ( opengl )
151 + egl? ( || ( gbm X wayland ) )
152 + enca? ( iconv )
153 + gbm? ( drm egl )
154 + lcms? ( || ( opengl egl ) )
155 + libguess? ( iconv )
156 + luajit? ( lua )
157 + uchardet? ( iconv )
158 + v4l? ( || ( alsa oss ) )
159 + vaapi? ( || ( gbm X wayland ) )
160 + vdpau? ( X )
161 + wayland? ( egl )
162 + xinerama? ( X )
163 + xscreensaver? ( X )
164 + xv? ( X )
165 + zsh-completion? ( cli )
166 +"
167 +
168 +COMMON_DEPEND="
169 + !libav? ( >=media-video/ffmpeg-2.4:0=[encode?,threads,vaapi?,vdpau?] )
170 + libav? ( >=media-video/libav-11:0=[encode?,threads,vaapi?,vdpau?] )
171 + sys-libs/zlib
172 + alsa? ( >=media-libs/alsa-lib-1.0.18 )
173 + archive? ( >=app-arch/libarchive-3.0.0:= )
174 + bluray? ( >=media-libs/libbluray-0.3.0 )
175 + cdda? ( dev-libs/libcdio-paranoia )
176 + drm? ( x11-libs/libdrm )
177 + dvb? ( virtual/linuxtv-dvb-headers )
178 + dvd? (
179 + >=media-libs/libdvdnav-4.2.0
180 + >=media-libs/libdvdread-4.1.0
181 + )
182 + egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
183 + iconv? (
184 + virtual/libiconv
185 + enca? ( app-i18n/enca )
186 + libguess? ( >=app-i18n/libguess-1.0 )
187 + uchardet? ( dev-libs/uchardet )
188 + )
189 + jack? ( virtual/jack )
190 + jpeg? ( virtual/jpeg:0 )
191 + lcms? ( >=media-libs/lcms-2.6:2 )
192 + libass? (
193 + >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
194 + virtual/ttf-fonts
195 + )
196 + libcaca? ( >=media-libs/libcaca-0.99_beta18 )
197 + lua? (
198 + !luajit? ( <dev-lang/lua-5.3:= )
199 + luajit? ( dev-lang/luajit:2 )
200 + )
201 + openal? ( >=media-libs/openal-1.13 )
202 + opengl? ( !aqua? ( virtual/opengl ) )
203 + pulseaudio? ( media-sound/pulseaudio )
204 + raspberry-pi? (
205 + >=media-libs/raspberrypi-userland-0_pre20160305-r1
206 + media-libs/mesa[egl,gles2]
207 + )
208 + rubberband? ( >=media-libs/rubberband-1.8.0 )
209 + samba? ( net-fs/samba )
210 + sdl? ( media-libs/libsdl2[sound,threads,video,X?,wayland?] )
211 + v4l? ( media-libs/libv4l )
212 + vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] )
213 + wayland? (
214 + >=dev-libs/wayland-1.6.0
215 + >=x11-libs/libxkbcommon-0.3.0
216 + )
217 + X? (
218 + x11-libs/libX11
219 + x11-libs/libXext
220 + >=x11-libs/libXrandr-1.2.0
221 + opengl? ( x11-libs/libXdamage )
222 + vdpau? ( >=x11-libs/libvdpau-0.2 )
223 + xinerama? ( x11-libs/libXinerama )
224 + xscreensaver? ( x11-libs/libXScrnSaver )
225 + xv? ( x11-libs/libXv )
226 + )
227 +"
228 +DEPEND="${COMMON_DEPEND}
229 + ${PYTHON_DEPS}
230 + >=dev-lang/perl-5.8
231 + dev-python/docutils
232 + virtual/pkgconfig
233 + doc? ( dev-python/rst2pdf )
234 + test? ( >=dev-util/cmocka-1.0.0 )
235 +"
236 +RDEPEND="${COMMON_DEPEND}
237 + selinux? ( sec-policy/selinux-mplayer )
238 +"
239 +
240 +PATCHES=( "${FILESDIR}/${PV}/${P}-fix-height-alignment-on-xv.patch" )
241 +
242 +pkg_pretend() {
243 + if [[ ${MERGE_TYPE} != "binary" ]] && ! tc-has-tls && use vaapi && use egl; then
244 + die "Your compiler lacks C++11 TLS support. Use GCC>=4.8.0 or Clang>=3.3."
245 + fi
246 +}
247 +
248 +src_prepare() {
249 + cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
250 + chmod +x "${S}"/waf || die
251 + default_src_prepare
252 +}
253 +
254 +src_configure() {
255 + local mywafargs=(
256 + --confdir="${EPREFIX}/etc/${PN}"
257 + --docdir="${EPREFIX}/usr/share/doc/${PF}"
258 +
259 + $(usex cli '' '--disable-cplayer')
260 + $(use_enable libmpv libmpv-shared)
261 +
262 + # See deep down below for build-date.
263 + --disable-libmpv-static
264 + --disable-static-build
265 + --disable-optimize # Don't add '-O2' to CFLAGS.
266 + --disable-debug-build # Don't add '-g' to CFLAGS.
267 +
268 + $(use_enable doc html-build)
269 + $(use_enable doc pdf-build)
270 + $(use_enable vf-dlopen vf-dlopen-filters)
271 + $(use_enable zsh-completion zsh-comp)
272 + $(use_enable test)
273 +
274 + $(use_enable iconv)
275 + $(use_enable samba libsmbclient)
276 + $(use_enable lua)
277 + $(usex luajit '--lua=luajit' '')
278 + $(use_enable libass)
279 + $(use_enable libass libass-osd)
280 + $(use_enable encode encoding)
281 + $(use_enable bluray libbluray)
282 + $(use_enable dvd dvdread)
283 + $(use_enable dvd dvdnav)
284 + $(use_enable cdda)
285 + $(use_enable enca)
286 + $(use_enable libguess)
287 + $(use_enable uchardet)
288 + $(use_enable rubberband)
289 + $(use_enable lcms lcms2)
290 + --disable-vapoursynth # Only available in overlays.
291 + --disable-vapoursynth-lazy
292 + $(use_enable archive libarchive)
293 +
294 + --enable-libavdevice
295 +
296 + # Audio outputs:
297 + $(use_enable sdl sdl2) # Listed under audio, but also includes video.
298 + --disable-sdl1
299 + $(use_enable oss oss-audio)
300 + --disable-rsound # Only available in overlays.
301 + $(use_enable pulseaudio pulse)
302 + $(use_enable jack)
303 + $(use_enable openal)
304 + --disable-opensles
305 + $(use_enable alsa)
306 + $(use_enable coreaudio)
307 +
308 + # Video outputs:
309 + $(use_enable aqua cocoa)
310 + $(use_enable drm)
311 + $(use_enable gbm)
312 + $(use_enable wayland)
313 + $(use_enable X x11)
314 + $(use_enable xscreensaver xss)
315 + $(use_enable X xext)
316 + $(use_enable xv)
317 + $(use_enable xinerama)
318 + $(use_enable X xrandr)
319 + $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
320 + $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
321 + $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
322 + $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
323 + $(use_enable wayland gl-wayland)
324 + $(use_enable vdpau)
325 + $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
326 + $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
327 + $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
328 + $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
329 + $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
330 + $(use_enable libcaca caca)
331 + $(use_enable jpeg)
332 + --disable-android
333 + $(use_enable raspberry-pi rpi)
334 + $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
335 +
336 + # HWaccels:
337 + # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
338 + $(use_enable vaapi vaapi-hwaccel)
339 + # Automagic VDPAU HW acceleration. See Gentoo bug 558870.
340 +
341 + # TV features:
342 + $(use_enable v4l tv)
343 + $(use_enable v4l tv-v4l2)
344 + $(use_enable v4l libv4l2)
345 + $(use_enable v4l audio-input)
346 + $(use_enable dvb dvbin)
347 +
348 + # Miscellaneous features:
349 + --disable-apple-remote # Needs testing first. See Gentoo bug 577332.
350 + )
351 +
352 + if use vaapi && use X; then
353 + mywafargs+=(
354 + $(use_enable opengl vaapi-glx)
355 + $(use_enable egl vaapi-x-egl)
356 + )
357 + fi
358 +
359 + if ! use egl && ! use opengl && ! use raspberry-pi; then
360 + mywafargs+=(--disable-gl)
361 + fi
362 +
363 + # Create reproducible non-live builds.
364 + [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)
365 +
366 + waf-utils_src_configure "${mywafargs[@]}"
367 +}
368 +
369 +src_install() {
370 + waf-utils_src_install
371 +
372 + if use cli && use luajit; then
373 + pax-mark -m "${ED}"usr/bin/${PN}
374 + fi
375 +}
376 +
377 +pkg_preinst() {
378 + gnome2_icon_savelist
379 +}
380 +
381 +pkg_postinst() {
382 + fdo-mime_desktop_database_update
383 + gnome2_icon_cache_update
384 +
385 + # bash-completion < 2.3-r1 already installs (mostly broken) mpv completion.
386 + if use cli && ! has_version '<app-shells/bash-completion-2.3-r1' && \
387 + ! has_version 'app-shells/mpv-bash-completion'; then
388 + elog "If you want to have command-line completion via bash-completion,"
389 + elog "please install app-shells/mpv-bash-completion."
390 + fi
391 +
392 + if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \
393 + has_version 'app-shells/mpv-bash-completion'; then
394 + elog "If command-line completion doesn't work after mpv update,"
395 + elog "please rebuild app-shells/mpv-bash-completion."
396 + fi
397 +}
398 +
399 +pkg_postrm() {
400 + fdo-mime_desktop_database_update
401 + gnome2_icon_cache_update
402 +}
403 +
404 +src_test() {
405 + cd "${S}"/build/test || die
406 + for test in *; do
407 + if [[ -x ${test} ]]; then
408 + ./"${test}" || die "Test suite failed"
409 + fi
410 + done
411 +}