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-libs/xine-lib/files/, media-libs/xine-lib/
Date: Thu, 19 May 2022 22:46:07
Message-Id: 1653000342.9983d4ae3ee5a688bd77b17e2a99ba33074b8a2f.sam@gentoo
1 commit: 9983d4ae3ee5a688bd77b17e2a99ba33074b8a2f
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 19 22:43:57 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu May 19 22:45:42 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9983d4ae
7
8 media-libs/xine-lib: apply mmap crash fix
9
10 Applied upstream too! \o/
11
12 Closes: https://bugs.gentoo.org/845396
13 Thanks-to: aloe <aloebbert <AT> gmx.de>
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 .../files/xine-lib-1.2.12-fix-mmap-crash.patch | 15 ++
17 media-libs/xine-lib/xine-lib-1.2.12-r2.ebuild | 234 +++++++++++++++++++++
18 2 files changed, 249 insertions(+)
19
20 diff --git a/media-libs/xine-lib/files/xine-lib-1.2.12-fix-mmap-crash.patch b/media-libs/xine-lib/files/xine-lib-1.2.12-fix-mmap-crash.patch
21 new file mode 100644
22 index 000000000000..df5515f0495c
23 --- /dev/null
24 +++ b/media-libs/xine-lib/files/xine-lib-1.2.12-fix-mmap-crash.patch
25 @@ -0,0 +1,15 @@
26 +https://sourceforge.net/p/xine/tickets/12/
27 +https://sourceforge.net/p/xine/xine-lib-1.2/ci/f56d70b45346ca9363a720724b0c2d00fc798988/tree/src/input/input_file.c?diff=d6e5d46a943257f0be171fb8ab16050810a21581
28 +https://bugs.gentoo.org/846398
29 +
30 +--- a/src/input/input_file.c
31 ++++ b/src/input/input_file.c
32 +@@ -449,7 +449,7 @@
33 + #ifdef HAVE_MMAP
34 + this->mmap_base = NULL;
35 + do {
36 +- uint8_t mmap_base;
37 ++ uint8_t *mmap_base;
38 + size_t tmp_size;
39 + /* may cause truncation - if it does, DON'T mmap! */
40 + tmp_size = (size_t)sbuf.st_size;
41
42 diff --git a/media-libs/xine-lib/xine-lib-1.2.12-r2.ebuild b/media-libs/xine-lib/xine-lib-1.2.12-r2.ebuild
43 new file mode 100644
44 index 000000000000..bd9029dfd27e
45 --- /dev/null
46 +++ b/media-libs/xine-lib/xine-lib-1.2.12-r2.ebuild
47 @@ -0,0 +1,234 @@
48 +# Copyright 1999-2022 Gentoo Authors
49 +# Distributed under the terms of the GNU General Public License v2
50 +
51 +EAPI=8
52 +
53 +inherit flag-o-matic libtool
54 +
55 +if [[ ${PV} == *9999* ]]; then
56 + EHG_REPO_URI="http://hg.code.sf.net/p/xine/xine-lib-1.2"
57 + inherit autotools mercurial
58 + unset NLS_IUSE
59 + NLS_DEPEND="sys-devel/gettext"
60 + NLS_RDEPEND="virtual/libintl"
61 +else
62 + KEYWORDS="~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
63 + SRC_URI="mirror://sourceforge/xine/${P}.tar.xz"
64 + NLS_IUSE="nls"
65 + NLS_DEPEND="nls? ( sys-devel/gettext )"
66 + NLS_RDEPEND="nls? ( virtual/libintl )"
67 +fi
68 +
69 +DESCRIPTION="Core libraries for Xine movie player"
70 +HOMEPAGE="http://xine.sourceforge.net/"
71 +
72 +LICENSE="GPL-2"
73 +SLOT="1"
74 +IUSE="a52 aac aalib +alsa altivec bluray +css dav1d dts dvb dxr3 fbcon flac gtk imagemagick ipv6 jack jpeg libcaca mad +mmap mng modplug musepack nfs opengl oss pulseaudio samba sftp sdl speex theora truetype v4l vaapi vcd vdpau vdr vidix +vis vorbis vpx wavpack wayland +X xinerama +xv xvmc ${NLS_IUSE}"
75 +
76 +BDEPEND="
77 + app-arch/xz-utils
78 + >=sys-devel/libtool-2.2.6b
79 + virtual/pkgconfig
80 +"
81 +RDEPEND="
82 + dev-libs/libxdg-basedir
83 + media-libs/libdvdnav
84 + media-video/ffmpeg:0=
85 + sys-libs/zlib:=
86 + virtual/libiconv
87 + a52? ( media-libs/a52dec )
88 + aac? ( media-libs/faad2 )
89 + aalib? ( media-libs/aalib )
90 + alsa? ( media-libs/alsa-lib )
91 + bluray? ( >=media-libs/libbluray-0.2.1:= )
92 + css? ( >=media-libs/libdvdcss-1.2.10 )
93 + dav1d? ( media-libs/dav1d:= )
94 + dts? ( media-libs/libdca )
95 + dxr3? ( media-libs/libfame )
96 + flac? ( media-libs/flac )
97 + gtk? ( x11-libs/gdk-pixbuf:2 )
98 + imagemagick? ( virtual/imagemagick-tools )
99 + jack? ( virtual/jack )
100 + jpeg? ( media-libs/libjpeg-turbo:= )
101 + libcaca? ( media-libs/libcaca )
102 + mad? ( media-libs/libmad )
103 + mng? ( media-libs/libmng:= )
104 + modplug? ( >=media-libs/libmodplug-0.8.8.1 )
105 + musepack? ( >=media-sound/musepack-tools-444 )
106 + nfs? ( net-fs/libnfs:= )
107 + opengl? (
108 + virtual/glu
109 + virtual/opengl
110 + )
111 + pulseaudio? ( media-sound/pulseaudio )
112 + samba? ( net-fs/samba )
113 + sftp? ( net-libs/libssh2 )
114 + sdl? ( media-libs/libsdl )
115 + speex? (
116 + media-libs/libogg
117 + media-libs/speex
118 + )
119 + theora? (
120 + media-libs/libogg
121 + media-libs/libtheora
122 + )
123 + truetype? (
124 + media-libs/fontconfig
125 + media-libs/freetype:2
126 + )
127 + v4l? ( media-libs/libv4l )
128 + vaapi? ( x11-libs/libva:0=[X,opengl] )
129 + vcd? (
130 + >=media-video/vcdimager-0.7.23
131 + dev-libs/libcdio:0=[-minimal]
132 + )
133 + vdpau? ( x11-libs/libvdpau )
134 + vorbis? (
135 + media-libs/libogg
136 + media-libs/libvorbis
137 + )
138 + vpx? ( media-libs/libvpx:0= )
139 + wavpack? ( media-sound/wavpack )
140 + wayland? ( dev-libs/wayland )
141 + X? (
142 + x11-libs/libX11
143 + x11-libs/libXext
144 + x11-libs/libxcb
145 + )
146 + xinerama? ( x11-libs/libXinerama )
147 + xv? ( x11-libs/libXv )
148 + xvmc? ( x11-libs/libXvMC )
149 +"
150 +DEPEND="${RDEPEND}
151 + oss? ( virtual/os-headers )
152 + v4l? ( virtual/os-headers )
153 + X? (
154 + x11-base/xorg-proto
155 + x11-libs/libXt
156 + )
157 + xv? ( x11-base/xorg-proto )
158 + xvmc? ( x11-base/xorg-proto )
159 + xinerama? ( x11-base/xorg-proto )
160 +"
161 +REQUIRED_USE="
162 + vidix? ( || ( X fbcon ) )
163 + xv? ( X )
164 + xinerama? ( X )
165 +"
166 +
167 +PATCHES=(
168 + "${FILESDIR}"/${PN}-1.2.12-dav1d-1.0.0.patch
169 + "${FILESDIR}"/${PN}-1.2.12-fix-mmap-crash.patch
170 +)
171 +
172 +src_prepare() {
173 + default
174 +
175 + sed -i -e '/define VDR_ABS_FIFO_DIR/s|".*"|"/var/vdr/xine"|' src/vdr/input_vdr.c || die
176 +
177 + if [[ "${PV}" = *9999* ]] ; then
178 + eautoreconf
179 + else
180 + elibtoolize
181 + fi
182 +
183 + local x
184 + for x in 0 1 2 3; do
185 + sed -i -e "/^O${x}_CFLAGS=\"-O${x}\"/d" configure || die
186 + done
187 +}
188 +
189 +src_configure() {
190 + [[ ${CHOST} == i?86-* ]] && append-flags -fomit-frame-pointer #422519
191 +
192 + local win32dir #197236
193 + if has_multilib_profile; then
194 + win32dir=/usr/$(ABI="x86" get_libdir)/win32
195 + else
196 + win32dir=/usr/$(get_libdir)/win32
197 + fi
198 +
199 + local myconf=(
200 + --disable-directfb
201 + --disable-gnomevfs
202 + --disable-optimizations
203 + --disable-real-codecs
204 + --disable-v4l
205 + --disable-w32dll
206 + --enable-avformat
207 + --with-external-dvdnav
208 + --with-real-codecs-path=/usr/$(get_libdir)/codecs
209 + --with-w32-path=${win32dir}
210 + --with-xv-path=/usr/$(get_libdir)
211 + --without-esound
212 + --without-fusionsound
213 + # Added dav1d for now. Could support both? Does it need to be XOR?
214 + --without-libaom
215 + $(use_enable a52 a52dec)
216 + $(use_enable aac faad)
217 + $(use_enable aalib)
218 + $(use_enable altivec)
219 + $(use_enable bluray)
220 + $(use_enable dts)
221 + $(use_enable dvb)
222 + $(use_enable dxr3)
223 + $(use_enable fbcon fb)
224 + $(use_enable gtk gdkpixbuf)
225 + $(use_enable ipv6)
226 + $(use_enable jpeg libjpeg)
227 + $(use_enable mad)
228 + $(use_enable mmap)
229 + $(use_enable mng)
230 + $(use_enable modplug)
231 + $(use_enable musepack)
232 + $(use_enable nfs)
233 + $(use_enable opengl)
234 + $(use_enable opengl glu)
235 + $(use_enable oss)
236 + $(use_enable samba)
237 + $(use_enable sftp)
238 + $(use_enable v4l libv4l)
239 + $(use_enable v4l v4l2)
240 + $(use_enable vaapi)
241 + $(use_enable vdpau)
242 + $(use_enable vis)
243 + $(use_enable vidix)
244 + $(use_enable xinerama)
245 + $(use_enable xvmc)
246 + $(use_enable vcd)
247 + $(use_enable vdr)
248 + $(use_enable vpx)
249 + $(use_enable wayland)
250 + $(use_with alsa)
251 + $(use_with dav1d)
252 + $(use_with flac libflac)
253 + $(use_with imagemagick)
254 + $(use_with jack)
255 + $(use_with libcaca caca)
256 + $(use_with pulseaudio)
257 + $(use_with sdl)
258 + $(use_with speex)
259 + $(use_with theora)
260 + $(use_with truetype fontconfig)
261 + $(use_with truetype freetype)
262 + $(use_with vorbis)
263 + $(use_with wavpack)
264 + $(use_with X x)
265 + $(use_with X xcb)
266 + )
267 + [[ ${PV} == *9999* ]] || myconf+=( $(use_enable nls) )
268 +
269 + econf "${myconf[@]}"
270 +}
271 +
272 +src_compile() {
273 + # enable verbose building, bug #448140
274 + emake V=1
275 +}
276 +
277 +src_install() {
278 + default
279 + find "${D}" -name '*.la' -delete || die
280 + rm "${ED}"/usr/share/doc/${PF}/COPYING || die
281 +}