1 |
commit: d6fd9cfb26299c76be7483cac4451a226ab8e37f |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 28 09:15:14 2022 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 28 09:48:47 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6fd9cfb |
7 |
|
8 |
media-libs/wxsvg: bump to 1.5.23 |
9 |
|
10 |
use gtk3, build with ffmpeg5 |
11 |
|
12 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
13 |
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org> |
14 |
|
15 |
media-libs/wxsvg/Manifest | 1 + |
16 |
media-libs/wxsvg/files/ffmpeg5.patch | 64 ++++++++++++++++++++++++++++++++++++ |
17 |
media-libs/wxsvg/wxsvg-1.5.23.ebuild | 44 +++++++++++++++++++++++++ |
18 |
3 files changed, 109 insertions(+) |
19 |
|
20 |
diff --git a/media-libs/wxsvg/Manifest b/media-libs/wxsvg/Manifest |
21 |
index af88c78bc422..04638ca976be 100644 |
22 |
--- a/media-libs/wxsvg/Manifest |
23 |
+++ b/media-libs/wxsvg/Manifest |
24 |
@@ -1 +1,2 @@ |
25 |
DIST wxsvg-1.5.11.tar.bz2 514919 BLAKE2B d15d3478b69c4db4bd1cfc5032ff4909d35aca45f69694dbb74db72bc9d651fae3b8948382f60abd3f93a36dd4756f8f8f2c37acf7ac0b8859a9b03cb8cfda55 SHA512 d3538969bc0dda6bab740efef6952c2ca92e0ca74780c6370e3c6daf21d641e894b570d13b6ca408839b1b37df2aca9a3cf32d6423ddbf5f9f84274cfb1b8582 |
26 |
+DIST wxsvg-1.5.23.tar.bz2 500351 BLAKE2B 369bd7cee8581df72712183ecb997f0cebae6e7fe942d4cad123d77472b5e3f479f604854bc267990e7ec29c9420625433a4b8a3fe799fcae0e4d6173d411c50 SHA512 c15f58fecbee595f0f981c9347f1e1b929656b7d9c9dfb699252111df927d554cb88b6d7801b323451b0f906ec8c7d6935c9e15372e213f1921f0fdd90733422 |
27 |
|
28 |
diff --git a/media-libs/wxsvg/files/ffmpeg5.patch b/media-libs/wxsvg/files/ffmpeg5.patch |
29 |
new file mode 100644 |
30 |
index 000000000000..3b726ec79b5f |
31 |
--- /dev/null |
32 |
+++ b/media-libs/wxsvg/files/ffmpeg5.patch |
33 |
@@ -0,0 +1,64 @@ |
34 |
+Index: wxsvg-1.5.23/include/wxSVG/mediadec_ffmpeg.h |
35 |
+=================================================================== |
36 |
+--- wxsvg-1.5.23.orig/include/wxSVG/mediadec_ffmpeg.h |
37 |
++++ wxsvg-1.5.23/include/wxSVG/mediadec_ffmpeg.h |
38 |
+@@ -81,6 +81,7 @@ private: |
39 |
+ bool OpenVideoDecoder(); |
40 |
+ void CloseVideoDecoder(); |
41 |
+ AVStream* GetVideoStream(); |
42 |
++ int64_t m_cur_dts; |
43 |
+ }; |
44 |
+ |
45 |
+ #endif //FFMPEG_MEDIA_DECODER_H |
46 |
+Index: wxsvg-1.5.23/src/mediadec_ffmpeg.cpp |
47 |
+=================================================================== |
48 |
+--- wxsvg-1.5.23.orig/src/mediadec_ffmpeg.cpp |
49 |
++++ wxsvg-1.5.23/src/mediadec_ffmpeg.cpp |
50 |
+@@ -20,6 +20,7 @@ |
51 |
+ #define UINT64_C(val) val##ULL |
52 |
+ #endif |
53 |
+ extern "C" { |
54 |
++#include <libavcodec/avcodec.h> |
55 |
+ #include <libavformat/avformat.h> |
56 |
+ #include <libswscale/swscale.h> |
57 |
+ #include <libavutil/avutil.h> |
58 |
+@@ -153,6 +154,9 @@ StreamType wxFfmpegMediaDecoder::GetStre |
59 |
+ } |
60 |
+ |
61 |
+ wxString wxFfmpegMediaDecoder::GetCodecName(unsigned int streamIndex) { |
62 |
++#if LIBAVCODEC_VERSION_MAJOR >= 59 |
63 |
++ const |
64 |
++#endif |
65 |
+ AVCodec *codec = avcodec_find_decoder(m_formatCtx->streams[streamIndex]->codecpar->codec_id); |
66 |
+ if (codec) { |
67 |
+ return wxString(codec->name, wxConvLocal); |
68 |
+@@ -193,6 +197,9 @@ bool wxFfmpegMediaDecoder::OpenVideoDeco |
69 |
+ |
70 |
+ // find and open the decoder for the video stream |
71 |
+ AVStream* stream = m_formatCtx->streams[m_videoStream]; |
72 |
++#if LIBAVCODEC_VERSION_MAJOR >= 59 |
73 |
++ const |
74 |
++#endif |
75 |
+ AVCodec* codec = avcodec_find_decoder(stream->codecpar->codec_id); |
76 |
+ if (!codec) |
77 |
+ return false; |
78 |
+@@ -255,7 +262,11 @@ double wxFfmpegMediaDecoder::GetPosition |
79 |
+ AVStream *st = GetVideoStream(); |
80 |
+ if (st == NULL) |
81 |
+ return -1; |
82 |
++#if LIBAVCODEC_VERSION_MAJOR >= 59 |
83 |
++ int64_t timestamp = m_cur_dts; |
84 |
++#else |
85 |
+ int64_t timestamp = st->cur_dts; |
86 |
++#endif |
87 |
+ if (timestamp == (int64_t)AV_NOPTS_VALUE) |
88 |
+ return -1; |
89 |
+ timestamp = av_rescale(timestamp, AV_TIME_BASE * (int64_t)st->time_base.num, st->time_base.den); |
90 |
+@@ -308,6 +319,7 @@ wxImage wxFfmpegMediaDecoder::GetNextFra |
91 |
+ uint8_t *rgbSrc[3] = { img.GetData(), NULL, NULL }; |
92 |
+ int rgbStride[3] = { 3 * m_width, 0, 0 }; |
93 |
+ sws_scale(imgConvertCtx, m_frame->data, m_frame->linesize, 0, m_codecCtx->height, rgbSrc, rgbStride); |
94 |
++ m_cur_dts = packet.dts; |
95 |
+ av_packet_unref(&packet); |
96 |
+ sws_freeContext(imgConvertCtx); |
97 |
+ return img; |
98 |
|
99 |
diff --git a/media-libs/wxsvg/wxsvg-1.5.23.ebuild b/media-libs/wxsvg/wxsvg-1.5.23.ebuild |
100 |
new file mode 100644 |
101 |
index 000000000000..6ed6b1b15bf6 |
102 |
--- /dev/null |
103 |
+++ b/media-libs/wxsvg/wxsvg-1.5.23.ebuild |
104 |
@@ -0,0 +1,44 @@ |
105 |
+# Copyright 1999-2022 Gentoo Authors |
106 |
+# Distributed under the terms of the GNU General Public License v2 |
107 |
+ |
108 |
+EAPI=7 |
109 |
+ |
110 |
+WX_GTK_VER=3.0-gtk3 |
111 |
+inherit wxwidgets |
112 |
+ |
113 |
+DESCRIPTION="C++ library to create, manipulate and render SVG files" |
114 |
+HOMEPAGE="http://wxsvg.sourceforge.net/" |
115 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" |
116 |
+ |
117 |
+LICENSE="wxWinLL-3" |
118 |
+SLOT="0/3" # based on SONAME of libwxsvg.so |
119 |
+KEYWORDS="~amd64 ~x86" |
120 |
+ |
121 |
+RDEPEND=">=dev-libs/expat-2:= |
122 |
+ media-libs/libexif:= |
123 |
+ >=dev-libs/glib-2.28:2= |
124 |
+ dev-libs/libxml2:= |
125 |
+ media-libs/fontconfig:= |
126 |
+ media-libs/freetype:2= |
127 |
+ media-libs/harfbuzz:= |
128 |
+ x11-libs/cairo:= |
129 |
+ x11-libs/pango:= |
130 |
+ x11-libs/wxGTK:${WX_GTK_VER}=[X] |
131 |
+ >=media-video/ffmpeg-2.6:0=" |
132 |
+DEPEND="${RDEPEND}" |
133 |
+BDEPEND="virtual/pkgconfig" |
134 |
+PATCHES=( "${FILESDIR}/ffmpeg5.patch" ) |
135 |
+ |
136 |
+src_configure() { |
137 |
+ setup-wxwidgets base-unicode |
138 |
+ econf \ |
139 |
+ --disable-static \ |
140 |
+ --with-wx-config=${WX_CONFIG} |
141 |
+} |
142 |
+ |
143 |
+src_install() { |
144 |
+ default |
145 |
+ |
146 |
+ # no static archives |
147 |
+ find "${ED}" -name '*.la' -delete || die |
148 |
+} |