Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/vice/files/, app-emulation/vice/
Date: Thu, 29 Nov 2018 22:04:42
Message-Id: 1543529059.1b6961ef0347393ca69eb7e03a3cc07d316d36b2.asturm@gentoo
1 commit: 1b6961ef0347393ca69eb7e03a3cc07d316d36b2
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 29 21:46:13 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 29 22:04:19 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b6961ef
7
8 app-emulation/vice: Fix build with ffmpeg-4
9
10 Rename PATCH to PATCHES (again!) and restore missing patch.
11
12 Thanks-to: Adam Jones <adam <AT> eidolon.org.uk>
13 Closes: https://bugs.gentoo.org/670620
14 Package-Manager: Portage-2.3.52, Repoman-2.3.12
15 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
16
17 .../vice/files/vice-2.4.27-autotools.patch | 11 ++++
18 app-emulation/vice/files/vice-3.1-ffmpeg4.patch | 74 ++++++++++++++++++++++
19 app-emulation/vice/vice-3.1.ebuild | 7 +-
20 3 files changed, 89 insertions(+), 3 deletions(-)
21
22 diff --git a/app-emulation/vice/files/vice-2.4.27-autotools.patch b/app-emulation/vice/files/vice-2.4.27-autotools.patch
23 new file mode 100644
24 index 00000000000..7bebd2800ef
25 --- /dev/null
26 +++ b/app-emulation/vice/files/vice-2.4.27-autotools.patch
27 @@ -0,0 +1,11 @@
28 +--- vice-2.4.7.orig/configure.ac
29 ++++ vice-2.4.7/configure.ac
30 +@@ -124,7 +118,7 @@
31 + AC_SUBST(VICE_VERSION)
32 +
33 + AM_INIT_AUTOMAKE(vice, $VICE_VERSION)
34 +-AM_CONFIG_HEADER(src/config.h)
35 ++AC_CONFIG_HEADERS(src/config.h)
36 +
37 + if test x"$VICE_VERSION_BUILD" = "x" -o x"$VICE_VERSION_BUILD" = "x0" ; then
38 + VERSION_RC=$VICE_VERSION_MAJOR","$VICE_VERSION_MINOR",0,0"
39
40 diff --git a/app-emulation/vice/files/vice-3.1-ffmpeg4.patch b/app-emulation/vice/files/vice-3.1-ffmpeg4.patch
41 new file mode 100644
42 index 00000000000..d232ee22337
43 --- /dev/null
44 +++ b/app-emulation/vice/files/vice-3.1-ffmpeg4.patch
45 @@ -0,0 +1,74 @@
46 +--- a/src/gfxoutputdrv/ffmpegdrv.c
47 ++++ b/src/gfxoutputdrv/ffmpegdrv.c
48 +@@ -46,6 +46,13 @@
49 + #include "util.h"
50 + #include "soundmovie.h"
51 +
52 ++/** \brief Helper macro to determine ffmpeg version
53 ++ */
54 ++#if (LIBAVCODEC_VERSION_MAJOR >= 58) && (LIBAVCODEC_VERSION_MINOR >= 18)
55 ++# define HAVE_FFMPEG4
56 ++#endif
57 ++
58 ++
59 + static gfxoutputdrv_codec_t avi_audio_codeclist[] = {
60 + { AV_CODEC_ID_MP2, "MP2" },
61 + { AV_CODEC_ID_MP3, "MP3" },
62 +@@ -354,7 +361,11 @@
63 + }
64 +
65 + audio_is_open = 1;
66 ++#ifdef HAVE_FFMPEG4
67 ++ if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) {
68 ++#else
69 + if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) {
70 ++#endif
71 + audio_inbuf_samples = 10000;
72 + } else {
73 + audio_inbuf_samples = c->frame_size;
74 +@@ -447,8 +458,13 @@
75 + audio_st.samples_count = 0;
76 +
77 + /* Some formats want stream headers to be separate. */
78 +- if (ffmpegdrv_oc->oformat->flags & AVFMT_GLOBALHEADER)
79 ++ if (ffmpegdrv_oc->oformat->flags & AVFMT_GLOBALHEADER) {
80 ++#ifdef HAVE_FFMPEG4
81 ++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
82 ++#else
83 + c->flags |= CODEC_FLAG_GLOBAL_HEADER;
84 ++#endif
85 ++ }
86 +
87 + /* create resampler context */
88 + #ifndef HAVE_FFMPEG_AVRESAMPLE
89 +@@ -781,7 +797,11 @@
90 +
91 + /* Some formats want stream headers to be separate. */
92 + if (ffmpegdrv_oc->oformat->flags & AVFMT_GLOBALHEADER) {
93 ++#ifdef HAVE_FFMPEG4
94 ++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
95 ++#else
96 + c->flags |= CODEC_FLAG_GLOBAL_HEADER;
97 ++#endif
98 + }
99 +
100 + if (audio_init_done) {
101 +@@ -961,6 +981,7 @@
102 +
103 + video_st.frame->pts = video_st.next_pts++;
104 +
105 ++#ifdef AVFMT_RAWPICTURE
106 + if (ffmpegdrv_oc->oformat->flags & AVFMT_RAWPICTURE) {
107 + AVPacket pkt;
108 + VICE_P_AV_INIT_PACKET(&pkt);
109 +@@ -971,7 +992,9 @@
110 + pkt.pts = pkt.dts = video_st.frame->pts;
111 +
112 + ret = VICE_P_AV_INTERLEAVED_WRITE_FRAME(ffmpegdrv_oc, &pkt);
113 +- } else {
114 ++ } else
115 ++#endif
116 ++ {
117 + AVPacket pkt = { 0 };
118 + int got_packet;
119 +
120
121 diff --git a/app-emulation/vice/vice-3.1.ebuild b/app-emulation/vice/vice-3.1.ebuild
122 index 6fe9e2623e2..d7267e2b207 100644
123 --- a/app-emulation/vice/vice-3.1.ebuild
124 +++ b/app-emulation/vice/vice-3.1.ebuild
125 @@ -1,4 +1,4 @@
126 -# Copyright 1999-2018 Gentoo Foundation
127 +# Copyright 1999-2018 Gentoo Authors
128 # Distributed under the terms of the GNU General Public License v2
129
130 EAPI=6
131 @@ -85,8 +85,9 @@ DEPEND="${RDEPEND}
132 )
133 )"
134
135 -PATCH=(
136 - "${FILESDIR}"/${P}-autotools.patch
137 +PATCHES=(
138 + "${FILESDIR}"/${PN}-2.4.27-autotools.patch
139 + "${FILESDIR}"/${P}-ffmpeg4.patch
140 )
141
142 src_prepare() {