Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/vlc/files/, media-video/vlc/
Date: Thu, 07 Apr 2022 22:33:50
Message-Id: 1649370797.57322daae014d657b2b063abff4af216f1d90151.sam@gentoo
1 commit: 57322daae014d657b2b063abff4af216f1d90151
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 7 22:32:43 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 7 22:33:17 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57322daa
7
8 media-video/vlc: add dav1d-1.0.0 patch
9
10 It's unmerged (pending upstream) but
11 nobody's complained of runtime issues and the
12 patch itself wasn't disputed; just whether there's
13 another separate runtime bug which people
14 noticed during review of the patch.
15
16 Closes: https://bugs.gentoo.org/835787
17 Signed-off-by: Sam James <sam <AT> gentoo.org>
18
19 .../vlc/files/vlc-3.0.17.3-dav1d-1.0.0.patch | 78 ++++
20 media-video/vlc/vlc-3.0.17.3-r2.ebuild | 515 +++++++++++++++++++++
21 2 files changed, 593 insertions(+)
22
23 diff --git a/media-video/vlc/files/vlc-3.0.17.3-dav1d-1.0.0.patch b/media-video/vlc/files/vlc-3.0.17.3-dav1d-1.0.0.patch
24 new file mode 100644
25 index 000000000000..deb748cdba92
26 --- /dev/null
27 +++ b/media-video/vlc/files/vlc-3.0.17.3-dav1d-1.0.0.patch
28 @@ -0,0 +1,78 @@
29 +https://code.videolan.org/videolan/vlc/-/merge_requests/1618.patch
30 +https://bugs.gentoo.org/835787
31 +
32 +From 0efdfe8799b0100f41c5b8d6e1b43451001386cb Mon Sep 17 00:00:00 2001
33 +From: Steve Lhomme <robux4@×××××.xyz>
34 +Date: Fri, 18 Mar 2022 11:42:49 +0100
35 +Subject: [PATCH 1/2] dav1d: fix compilation with (upcoming) dav1d 1.0
36 +
37 +(cherry picked from commit dbf45cea2a8abdfbef897b8a71f3eb782bb1b712) (edited)
38 +edited:
39 +- 3.0 has the 128 pixels padding elsewhere
40 +- 3.0 has an extra parameter for add_integer_with_range()
41 +- 3.0 was setting i_extra_picture_buffers further down in the code
42 +- 3.0 uses 16 threads max
43 +
44 +Signed-off-by: Steve Lhomme <robux4@×××××.xyz>
45 +--- a/modules/codec/dav1d.c
46 ++++ b/modules/codec/dav1d.c
47 +@@ -63,10 +63,16 @@ vlc_module_begin ()
48 + set_category(CAT_INPUT)
49 + set_subcategory(SUBCAT_INPUT_VCODEC)
50 +
51 ++#if DAV1D_API_VERSION_MAJOR >= 6
52 ++ add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_THREADS,
53 ++ THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
54 ++ add_obsolete_string("dav1d-thread-tiles") // unused with dav1d 1.0
55 ++#else
56 + add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
57 + THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
58 + add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
59 + THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
60 ++#endif
61 + vlc_module_end ()
62 +
63 + /*****************************************************************************
64 +@@ -294,6 +300,11 @@ static int OpenDecoder(vlc_object_t *p_this)
65 + return VLC_ENOMEM;
66 +
67 + dav1d_default_settings(&p_sys->s);
68 ++#if DAV1D_API_VERSION_MAJOR >= 6
69 ++ p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
70 ++ if (p_sys->s.n_threads == 0)
71 ++ p_sys->s.n_threads = (i_core_count < 16) ? i_core_count : 16;
72 ++#else
73 + p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
74 + if (p_sys->s.n_tile_threads == 0)
75 + p_sys->s.n_tile_threads =
76 +@@ -303,6 +314,7 @@ static int OpenDecoder(vlc_object_t *p_this)
77 + p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
78 + if (p_sys->s.n_frame_threads == 0)
79 + p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
80 ++#endif
81 + p_sys->s.allocator.cookie = dec;
82 + p_sys->s.allocator.alloc_picture_callback = NewPicture;
83 + p_sys->s.allocator.release_picture_callback = FreePicture;
84 +@@ -313,12 +325,20 @@ static int OpenDecoder(vlc_object_t *p_this)
85 + return VLC_EGENERIC;
86 + }
87 +
88 ++#if DAV1D_API_VERSION_MAJOR >= 6
89 ++ msg_Dbg(p_this, "Using dav1d version %s with %d threads",
90 ++ dav1d_version(), p_sys->s.n_threads);
91 ++
92 ++ dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1);
93 ++#else
94 + msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
95 + dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
96 +
97 ++ dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
98 ++#endif
99 ++
100 + dec->pf_decode = Decode;
101 + dec->pf_flush = FlushDecoder;
102 +- dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
103 +
104 + dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
105 + dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
106 +GitLab
107
108 diff --git a/media-video/vlc/vlc-3.0.17.3-r2.ebuild b/media-video/vlc/vlc-3.0.17.3-r2.ebuild
109 new file mode 100644
110 index 000000000000..33d9f2b17a26
111 --- /dev/null
112 +++ b/media-video/vlc/vlc-3.0.17.3-r2.ebuild
113 @@ -0,0 +1,515 @@
114 +# Copyright 2000-2022 Gentoo Authors
115 +# Distributed under the terms of the GNU General Public License v2
116 +
117 +EAPI=7
118 +
119 +LUA_COMPAT=( lua5-{1..2} )
120 +
121 +MY_PV="${PV/_/-}"
122 +MY_PV="${MY_PV/-beta/-test}"
123 +MY_P="${PN}-${MY_PV}"
124 +if [[ ${PV} = *9999 ]] ; then
125 + if [[ ${PV%.9999} != ${PV} ]] ; then
126 + EGIT_BRANCH="3.0.x"
127 + fi
128 + EGIT_REPO_URI="https://code.videolan.org/videolan/vlc.git"
129 + inherit git-r3
130 +else
131 + if [[ ${MY_P} = ${P} ]] ; then
132 + SRC_URI="https://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.xz"
133 + else
134 + SRC_URI="https://download.videolan.org/pub/videolan/testing/${MY_P}/${MY_P}.tar.xz"
135 + fi
136 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv -sparc ~x86"
137 +fi
138 +inherit autotools flag-o-matic lua-single toolchain-funcs virtualx xdg
139 +
140 +DESCRIPTION="Media player and framework with support for most multimedia files and streaming"
141 +HOMEPAGE="https://www.videolan.org/vlc/"
142 +
143 +LICENSE="LGPL-2.1 GPL-2"
144 +SLOT="0/5-9" # vlc - vlccore
145 +
146 +IUSE="a52 alsa aom archive aribsub bidi bluray cddb chromaprint chromecast dav1d dbus
147 + dc1394 debug directx dts +dvbpsi dvd +encode faad fdk +ffmpeg flac fluidsynth
148 + fontconfig +gcrypt gme gnome-keyring gstreamer +gui ieee1394 jack jpeg kate
149 + libass libcaca libnotify +libsamplerate libtar libtiger linsys lirc live lua
150 + macosx-notifications mad matroska modplug mp3 mpeg mtp musepack ncurses nfs ogg
151 + omxil optimisememory opus png projectm pulseaudio rdp run-as-root samba sdl-image
152 + sftp shout sid skins soxr speex srt ssl svg taglib theora tremor truetype twolame
153 + udev upnp vaapi v4l vdpau vnc vpx wayland +X x264 x265 xml zeroconf zvbi
154 + cpu_flags_arm_neon cpu_flags_ppc_altivec cpu_flags_x86_mmx cpu_flags_x86_sse
155 +"
156 +REQUIRED_USE="
157 + chromecast? ( encode )
158 + directx? ( ffmpeg )
159 + fontconfig? ( truetype )
160 + libcaca? ( X )
161 + libtar? ( skins )
162 + libtiger? ( kate )
163 + lua? ( ${LUA_REQUIRED_USE} )
164 + skins? ( gui truetype X xml )
165 + ssl? ( gcrypt )
166 + vaapi? ( ffmpeg X )
167 + vdpau? ( ffmpeg X )
168 +"
169 +BDEPEND="
170 + >=sys-devel/gettext-0.19.8
171 + virtual/pkgconfig
172 + lua? ( ${LUA_DEPS} )
173 + amd64? ( dev-lang/yasm )
174 + x86? ( dev-lang/yasm )
175 +"
176 +RDEPEND="
177 + media-libs/libvorbis
178 + net-dns/libidn:=
179 + sys-libs/zlib[minizip]
180 + virtual/libintl
181 + virtual/opengl
182 + a52? ( media-libs/a52dec )
183 + alsa? ( media-libs/alsa-lib )
184 + aom? ( media-libs/libaom:= )
185 + archive? ( app-arch/libarchive:= )
186 + aribsub? ( media-libs/aribb24 )
187 + bidi? (
188 + dev-libs/fribidi
189 + media-libs/freetype:2[harfbuzz]
190 + media-libs/harfbuzz:=
191 + virtual/ttf-fonts
192 + )
193 + bluray? ( >=media-libs/libbluray-1.3.0:= )
194 + cddb? ( media-libs/libcddb )
195 + chromaprint? ( media-libs/chromaprint:= )
196 + chromecast? (
197 + >=dev-libs/protobuf-2.5.0:=
198 + >=net-libs/libmicrodns-0.1.2:=
199 + )
200 + dav1d? ( media-libs/dav1d:= )
201 + dbus? ( sys-apps/dbus )
202 + dc1394? (
203 + media-libs/libdc1394:2
204 + sys-libs/libraw1394
205 + )
206 + dts? ( media-libs/libdca )
207 + dvbpsi? ( >=media-libs/libdvbpsi-1.2.0:= )
208 + dvd? (
209 + >=media-libs/libdvdnav-6.1.1:0=
210 + >=media-libs/libdvdread-6.1.2:0=
211 + )
212 + faad? ( media-libs/faad2 )
213 + fdk? ( media-libs/fdk-aac:= )
214 + ffmpeg? ( >=media-video/ffmpeg-3.1.3:0=[postproc,vaapi?,vdpau?] )
215 + flac? (
216 + media-libs/flac
217 + media-libs/libogg
218 + )
219 + fluidsynth? ( media-sound/fluidsynth:= )
220 + fontconfig? ( media-libs/fontconfig:1.0 )
221 + gcrypt? (
222 + dev-libs/libgcrypt:0=
223 + dev-libs/libgpg-error
224 + )
225 + gme? ( media-libs/game-music-emu )
226 + gnome-keyring? ( app-crypt/libsecret )
227 + gstreamer? ( >=media-libs/gst-plugins-base-1.4.5:1.0 )
228 + gui? (
229 + dev-qt/qtcore:5
230 + dev-qt/qtgui:5
231 + dev-qt/qtsvg:5
232 + dev-qt/qtwidgets:5
233 + X? (
234 + dev-qt/qtx11extras:5
235 + x11-libs/libX11
236 + )
237 + )
238 + ieee1394? (
239 + sys-libs/libavc1394
240 + sys-libs/libraw1394
241 + )
242 + jack? ( virtual/jack )
243 + jpeg? ( virtual/jpeg:0 )
244 + kate? ( media-libs/libkate )
245 + libass? (
246 + media-libs/fontconfig:1.0
247 + media-libs/libass:=
248 + )
249 + libcaca? ( media-libs/libcaca )
250 + libnotify? (
251 + dev-libs/glib:2
252 + x11-libs/gdk-pixbuf:2
253 + x11-libs/gtk+:3
254 + x11-libs/libnotify
255 + )
256 + libsamplerate? ( media-libs/libsamplerate )
257 + libtar? ( dev-libs/libtar )
258 + libtiger? ( media-libs/libtiger )
259 + linsys? ( media-libs/zvbi )
260 + lirc? ( app-misc/lirc )
261 + live? ( media-plugins/live:= )
262 + lua? ( ${LUA_DEPS} )
263 + mad? ( media-libs/libmad )
264 + matroska? (
265 + >=dev-libs/libebml-1.4.2:=
266 + media-libs/libmatroska:=
267 + )
268 + modplug? ( >=media-libs/libmodplug-0.8.9.0 )
269 + mp3? ( media-sound/mpg123 )
270 + mpeg? ( media-libs/libmpeg2 )
271 + mtp? ( media-libs/libmtp:= )
272 + musepack? ( media-sound/musepack-tools )
273 + ncurses? ( sys-libs/ncurses:=[unicode(+)] )
274 + nfs? ( >=net-fs/libnfs-0.10.0:= )
275 + ogg? ( media-libs/libogg )
276 + opus? ( >=media-libs/opus-1.0.3 )
277 + png? ( media-libs/libpng:0= )
278 + projectm? (
279 + media-fonts/dejavu
280 + >=media-libs/libprojectm-3.1.12:0=
281 + )
282 + pulseaudio? ( media-sound/pulseaudio )
283 + rdp? ( >=net-misc/freerdp-2.0.0_rc0:=[client(+)] )
284 + samba? ( >=net-fs/samba-4.0.0:0[client,-debug(-)] )
285 + sdl-image? ( media-libs/sdl-image )
286 + sftp? ( net-libs/libssh2 )
287 + shout? ( media-libs/libshout )
288 + sid? ( media-libs/libsidplay:2 )
289 + skins? (
290 + x11-libs/libXext
291 + x11-libs/libXinerama
292 + x11-libs/libXpm
293 + )
294 + soxr? ( >=media-libs/soxr-0.1.2 )
295 + speex? (
296 + >=media-libs/speex-1.2.0
297 + media-libs/speexdsp
298 + )
299 + srt? ( >=net-libs/srt-1.4.2:= )
300 + ssl? ( net-libs/gnutls:= )
301 + svg? (
302 + gnome-base/librsvg:2
303 + x11-libs/cairo
304 + )
305 + taglib? ( >=media-libs/taglib-1.9 )
306 + theora? ( media-libs/libtheora )
307 + tremor? ( media-libs/tremor )
308 + truetype? (
309 + media-libs/freetype:2
310 + virtual/ttf-fonts
311 + !fontconfig? ( media-fonts/dejavu )
312 + )
313 + twolame? ( media-sound/twolame )
314 + udev? ( virtual/udev )
315 + upnp? ( net-libs/libupnp:=[ipv6] )
316 + v4l? ( media-libs/libv4l:= )
317 + vaapi? ( x11-libs/libva:=[drm(+),wayland?,X?] )
318 + vdpau? ( x11-libs/libvdpau )
319 + vnc? ( net-libs/libvncserver )
320 + vpx? ( media-libs/libvpx:= )
321 + wayland? (
322 + >=dev-libs/wayland-1.15
323 + dev-libs/wayland-protocols
324 + )
325 + X? (
326 + x11-libs/libX11
327 + x11-libs/libxcb
328 + x11-libs/xcb-util
329 + x11-libs/xcb-util-keysyms
330 + )
331 + x264? ( >=media-libs/x264-0.0.20190214:= )
332 + x265? ( media-libs/x265:= )
333 + xml? ( dev-libs/libxml2:2 )
334 + zeroconf? ( net-dns/avahi[dbus] )
335 + zvbi? ( media-libs/zvbi )
336 +"
337 +DEPEND="${RDEPEND}
338 + X? ( x11-base/xorg-proto )
339 +"
340 +
341 +PATCHES=(
342 + "${FILESDIR}"/${PN}-2.1.0-fix-libtremor-libs.patch # build system
343 + "${FILESDIR}"/${PN}-2.2.8-freerdp-2.patch # bug 590164
344 + "${FILESDIR}"/${PN}-3.0.6-fdk-aac-2.0.0.patch # bug 672290
345 + "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch
346 + "${FILESDIR}"/${PN}-3.0.14-fix-live-address-api.patch # bug 835072
347 + "${FILESDIR}"/${PN}-3.0.17.3-dav1d-1.0.0.patch # bug 835787
348 +)
349 +
350 +DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt )
351 +
352 +S="${WORKDIR}/${MY_P}"
353 +
354 +pkg_setup() {
355 + if use lua; then
356 + lua-single_pkg_setup
357 + fi
358 +}
359 +
360 +src_prepare() {
361 + xdg_src_prepare # bug 608256
362 +
363 + has_version 'net-libs/libupnp:1.8' && \
364 + eapply "${FILESDIR}"/${PN}-2.2.8-libupnp-slot-1.8.patch
365 +
366 + # Bootstrap when we are on a git checkout.
367 + if [[ ${PV} = *9999 ]] ; then
368 + ./bootstrap
369 + fi
370 +
371 + # Make it build with libtool 1.5
372 + rm m4/lt* m4/libtool.m4 || die
373 +
374 + # We are not in a real git checkout due to the absence of a .git directory.
375 + touch src/revision.txt || die
376 +
377 + # Don't use --started-from-file when not using dbus.
378 + if ! use dbus ; then
379 + sed -i 's/ --started-from-file//' share/vlc.desktop.in || die
380 + fi
381 +
382 + # Disable running of vlc-cache-gen, we do that in pkg_postinst
383 + sed -e "/test.*build.*host/s/\$(host)/nothanks/" \
384 + -i Makefile.am -i bin/Makefile.am || die "Failed to disable vlc-cache-gen"
385 +
386 + # Fix gettext version mismatch errors.
387 + sed -i -e s/GETTEXT_VERSION/GETTEXT_REQUIRE_VERSION/ configure.ac || die
388 +
389 + eautoreconf
390 +
391 + # Disable automatic running of tests.
392 + find . -name 'Makefile.in' -exec sed -i 's/\(..*\)check-TESTS/\1/' {} \; || die
393 +}
394 +
395 +src_configure() {
396 + local -x BUILDCC="$(tc-getBUILD_CC)"
397 +
398 + local myeconfargs=(
399 + --disable-aa
400 + --disable-optimizations
401 + --disable-rpath
402 + --disable-update-check
403 + --enable-fast-install
404 + --enable-screen
405 + --enable-vcd
406 + --enable-vlc
407 + --enable-vorbis
408 + $(use_enable a52)
409 + $(use_enable alsa)
410 + $(use_enable aom)
411 + $(use_enable archive)
412 + $(use_enable aribsub)
413 + $(use_enable bidi fribidi)
414 + $(use_enable bidi harfbuzz)
415 + $(use_enable bluray)
416 + $(use_enable cddb libcddb)
417 + $(use_enable chromaprint)
418 + $(use_enable chromecast)
419 + $(use_enable chromecast microdns)
420 + $(use_enable cpu_flags_arm_neon neon)
421 + $(use_enable cpu_flags_ppc_altivec altivec)
422 + $(use_enable cpu_flags_x86_mmx mmx)
423 + $(use_enable cpu_flags_x86_sse sse)
424 + $(use_enable dav1d)
425 + $(use_enable dbus)
426 + $(use_enable dbus kwallet)
427 + $(use_enable dc1394)
428 + $(use_enable debug)
429 + $(use_enable directx)
430 + $(use_enable directx d3d11va)
431 + $(use_enable directx dxva2)
432 + $(use_enable dts dca)
433 + $(use_enable dvbpsi)
434 + $(use_enable dvd dvdnav)
435 + $(use_enable dvd dvdread)
436 + $(use_enable encode sout)
437 + $(use_enable encode vlm)
438 + $(use_enable faad)
439 + $(use_enable fdk fdkaac)
440 + $(use_enable ffmpeg avcodec)
441 + $(use_enable ffmpeg avformat)
442 + $(use_enable ffmpeg postproc)
443 + $(use_enable ffmpeg swscale)
444 + $(use_enable flac)
445 + $(use_enable fluidsynth)
446 + $(use_enable fontconfig)
447 + $(use_enable gcrypt libgcrypt)
448 + $(use_enable gme)
449 + $(use_enable gnome-keyring secret)
450 + $(use_enable gstreamer gst-decode)
451 + $(use_enable gui qt)
452 + $(use_enable ieee1394 dv1394)
453 + $(use_enable jack)
454 + $(use_enable jpeg)
455 + $(use_enable kate)
456 + $(use_enable libass)
457 + $(use_enable libcaca caca)
458 + $(use_enable libnotify notify)
459 + $(use_enable libsamplerate samplerate)
460 + $(use_enable libtar)
461 + $(use_enable libtiger tiger)
462 + $(use_enable linsys)
463 + $(use_enable lirc)
464 + $(use_enable live live555)
465 + $(use_enable lua)
466 + $(use_enable macosx-notifications osx-notifications)
467 + $(use_enable mad)
468 + $(use_enable matroska)
469 + $(use_enable modplug mod)
470 + $(use_enable mp3 mpg123)
471 + $(use_enable mpeg libmpeg2)
472 + $(use_enable mtp)
473 + $(use_enable musepack mpc)
474 + $(use_enable ncurses)
475 + $(use_enable nfs)
476 + $(use_enable ogg)
477 + $(use_enable omxil)
478 + $(use_enable omxil omxil-vout)
479 + $(use_enable optimisememory optimize-memory)
480 + $(use_enable opus)
481 + $(use_enable png)
482 + $(use_enable projectm)
483 + $(use_enable pulseaudio pulse)
484 + $(use_enable rdp freerdp)
485 + $(use_enable run-as-root)
486 + $(use_enable samba smbclient)
487 + $(use_enable sdl-image)
488 + $(use_enable sftp)
489 + $(use_enable shout)
490 + $(use_enable sid)
491 + $(use_enable skins skins2)
492 + $(use_enable soxr)
493 + $(use_enable speex)
494 + $(use_enable srt)
495 + $(use_enable ssl gnutls)
496 + $(use_enable svg)
497 + $(use_enable svg svgdec)
498 + $(use_enable taglib)
499 + $(use_enable theora)
500 + $(use_enable tremor)
501 + $(use_enable twolame)
502 + $(use_enable udev)
503 + $(use_enable upnp)
504 + $(use_enable v4l v4l2)
505 + $(use_enable vaapi libva)
506 + $(use_enable vdpau)
507 + $(use_enable vnc)
508 + $(use_enable vpx)
509 + $(use_enable wayland)
510 + $(use_with X x)
511 + $(use_enable X xcb)
512 + $(use_enable X xvideo)
513 + $(use_enable x264)
514 + $(use_enable x264 x26410b)
515 + $(use_enable x265)
516 + $(use_enable xml libxml2)
517 + $(use_enable zeroconf avahi)
518 + $(use_enable zvbi)
519 + $(use_enable !zvbi telx)
520 + --with-kde-solid="${EPREFIX}"/usr/share/solid/actions
521 + --disable-asdcp
522 + --disable-coverage
523 + --disable-cprof
524 + --disable-crystalhd
525 + --disable-decklink
526 + --disable-gles2
527 + --disable-goom
528 + --disable-kai
529 + --disable-kva
530 + --disable-libplacebo
531 + --disable-maintainer-mode
532 + --disable-merge-ffmpeg
533 + --disable-mfx
534 + --disable-mmal
535 + --disable-opencv
536 + --disable-opensles
537 + --disable-oss
538 + --disable-rpi-omxil
539 + --disable-schroedinger
540 + --disable-shine
541 + --disable-sndio
542 + --disable-spatialaudio
543 + --disable-vsxu
544 + --disable-wasapi
545 + --disable-wma-fixed
546 + )
547 + # ^ We don't have these disabled libraries in the Portage tree yet.
548 +
549 + # Compatibility fix for Samba 4.
550 + use samba && append-cppflags "-I/usr/include/samba-4.0"
551 +
552 + if use x86; then
553 + # We need to disable -fstack-check if use >=gcc 4.8.0. bug #499996
554 + append-cflags $(test-flags-CC -fno-stack-check)
555 + # Bug 569774
556 + replace-flags -Os -O2
557 + fi
558 +
559 + # VLC now requires C++11 after commit 4b1c9dcdda0bbff801e47505ff9dfd3f274eb0d8
560 + append-cxxflags -std=c++11
561 +
562 + if use omxil; then
563 + # bug #723006
564 + # https://trac.videolan.org/vlc/ticket/24617
565 + append-cflags -fcommon
566 + fi
567 +
568 + # FIXME: Needs libresid-builder from libsidplay:2 which is in another directory...
569 + append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/sidplay/builders/"
570 +
571 + if use riscv; then
572 + # bug #803473
573 + append-libs -latomic
574 + fi
575 +
576 + if use truetype || use bidi; then
577 + myeconfargs+=( --enable-freetype )
578 + else
579 + myeconfargs+=( --disable-freetype )
580 + fi
581 +
582 + if use truetype || use projectm; then
583 + local dejavu="${EPREFIX}/usr/share/fonts/dejavu/"
584 + myeconfargs+=(
585 + --with-default-font=${dejavu}/DejaVuSans.ttf
586 + --with-default-font-family=Sans
587 + --with-default-monospace-font=${dejavu}/DejaVuSansMono.ttf
588 + --with-default-monospace-font-family=Monospace
589 + )
590 + fi
591 +
592 + econf "${myeconfargs[@]}"
593 +
594 + # _FORTIFY_SOURCE is set to 2 in config.h, which is also the default value on Gentoo.
595 + # Other values may break the build (bug 523144), so definition should not be removed.
596 + # To prevent redefinition warnings, we undefine _FORTIFY_SOURCE at the start of config.h
597 + sed -i '1i#undef _FORTIFY_SOURCE' config.h || die
598 +}
599 +
600 +src_test() {
601 + virtx emake check-TESTS
602 +}
603 +
604 +src_install() {
605 + default
606 + find "${ED}" -name '*.la' -delete || die
607 +}
608 +
609 +pkg_postinst() {
610 + if [[ -z "${ROOT}" ]] && [[ -x "${EROOT}/usr/$(get_libdir)/vlc/vlc-cache-gen" ]] ; then
611 + einfo "Running ${EPREFIX}/usr/$(get_libdir)/vlc/vlc-cache-gen on ${EROOT}/usr/$(get_libdir)/vlc/plugins/"
612 + "${EPREFIX}/usr/$(get_libdir)/vlc/vlc-cache-gen" "${EROOT}/usr/$(get_libdir)/vlc/plugins/"
613 + else
614 + ewarn "We cannot run vlc-cache-gen (most likely ROOT != /)"
615 + ewarn "Please run ${EPREFIX}/usr/$(get_libdir)/vlc/vlc-cache-gen manually"
616 + ewarn "If you do not do it, vlc will take a long time to load."
617 + fi
618 +
619 + xdg_pkg_postinst
620 +}
621 +
622 +pkg_postrm() {
623 + if [[ -e "${EROOT}"/usr/$(get_libdir)/vlc/plugins/plugins.dat ]]; then
624 + rm "${EROOT}"/usr/$(get_libdir)/vlc/plugins/plugins.dat || die "Failed to rm plugins.dat"
625 + fi
626 +
627 + xdg_pkg_postrm
628 +}