commit:     d6fd9cfb26299c76be7483cac4451a226ab8e37f
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 09:15:14 2022 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 28 09:48:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6fd9cfb

media-libs/wxsvg: bump to 1.5.23

use gtk3, build with ffmpeg5

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 media-libs/wxsvg/Manifest            |  1 +
 media-libs/wxsvg/files/ffmpeg5.patch | 64 ++++++++++++++++++++++++++++++++++++
 media-libs/wxsvg/wxsvg-1.5.23.ebuild | 44 +++++++++++++++++++++++++
 3 files changed, 109 insertions(+)

diff --git a/media-libs/wxsvg/Manifest b/media-libs/wxsvg/Manifest
index af88c78bc422..04638ca976be 100644
--- a/media-libs/wxsvg/Manifest
+++ b/media-libs/wxsvg/Manifest
@@ -1 +1,2 @@
 DIST wxsvg-1.5.11.tar.bz2 514919 BLAKE2B 
d15d3478b69c4db4bd1cfc5032ff4909d35aca45f69694dbb74db72bc9d651fae3b8948382f60abd3f93a36dd4756f8f8f2c37acf7ac0b8859a9b03cb8cfda55
 SHA512 
d3538969bc0dda6bab740efef6952c2ca92e0ca74780c6370e3c6daf21d641e894b570d13b6ca408839b1b37df2aca9a3cf32d6423ddbf5f9f84274cfb1b8582
+DIST wxsvg-1.5.23.tar.bz2 500351 BLAKE2B 
369bd7cee8581df72712183ecb997f0cebae6e7fe942d4cad123d77472b5e3f479f604854bc267990e7ec29c9420625433a4b8a3fe799fcae0e4d6173d411c50
 SHA512 
c15f58fecbee595f0f981c9347f1e1b929656b7d9c9dfb699252111df927d554cb88b6d7801b323451b0f906ec8c7d6935c9e15372e213f1921f0fdd90733422

diff --git a/media-libs/wxsvg/files/ffmpeg5.patch 
b/media-libs/wxsvg/files/ffmpeg5.patch
new file mode 100644
index 000000000000..3b726ec79b5f
--- /dev/null
+++ b/media-libs/wxsvg/files/ffmpeg5.patch
@@ -0,0 +1,64 @@
+Index: wxsvg-1.5.23/include/wxSVG/mediadec_ffmpeg.h
+===================================================================
+--- wxsvg-1.5.23.orig/include/wxSVG/mediadec_ffmpeg.h
++++ wxsvg-1.5.23/include/wxSVG/mediadec_ffmpeg.h
+@@ -81,6 +81,7 @@ private:
+       bool OpenVideoDecoder();
+       void CloseVideoDecoder();
+       AVStream* GetVideoStream();
++      int64_t m_cur_dts;
+ };
+ 
+ #endif //FFMPEG_MEDIA_DECODER_H
+Index: wxsvg-1.5.23/src/mediadec_ffmpeg.cpp
+===================================================================
+--- wxsvg-1.5.23.orig/src/mediadec_ffmpeg.cpp
++++ wxsvg-1.5.23/src/mediadec_ffmpeg.cpp
+@@ -20,6 +20,7 @@
+ #define UINT64_C(val) val##ULL
+ #endif
+ extern "C" {
++#include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+ #include <libswscale/swscale.h>
+ #include <libavutil/avutil.h>
+@@ -153,6 +154,9 @@ StreamType wxFfmpegMediaDecoder::GetStre
+ }
+ 
+ wxString wxFfmpegMediaDecoder::GetCodecName(unsigned int streamIndex) {
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++      const
++#endif
+       AVCodec *codec = 
avcodec_find_decoder(m_formatCtx->streams[streamIndex]->codecpar->codec_id);
+       if (codec) {
+               return wxString(codec->name, wxConvLocal);
+@@ -193,6 +197,9 @@ bool wxFfmpegMediaDecoder::OpenVideoDeco
+       
+       // find and open the decoder for the video stream 
+       AVStream* stream = m_formatCtx->streams[m_videoStream];
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++      const
++#endif
+       AVCodec* codec = avcodec_find_decoder(stream->codecpar->codec_id);
+       if (!codec)
+               return false;
+@@ -255,7 +262,11 @@ double wxFfmpegMediaDecoder::GetPosition
+       AVStream *st = GetVideoStream();
+       if (st == NULL)
+               return -1;
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++      int64_t timestamp = m_cur_dts;
++#else
+       int64_t timestamp = st->cur_dts;
++#endif
+       if (timestamp == (int64_t)AV_NOPTS_VALUE)
+               return -1;
+       timestamp = av_rescale(timestamp, AV_TIME_BASE * 
(int64_t)st->time_base.num, st->time_base.den);
+@@ -308,6 +319,7 @@ wxImage wxFfmpegMediaDecoder::GetNextFra
+                               uint8_t *rgbSrc[3] = { img.GetData(), NULL, 
NULL };
+                               int rgbStride[3] = { 3 * m_width, 0, 0 };
+                               sws_scale(imgConvertCtx, m_frame->data, 
m_frame->linesize, 0, m_codecCtx->height, rgbSrc, rgbStride);
++                              m_cur_dts = packet.dts;
+                               av_packet_unref(&packet);
+                               sws_freeContext(imgConvertCtx);
+                               return img;

diff --git a/media-libs/wxsvg/wxsvg-1.5.23.ebuild 
b/media-libs/wxsvg/wxsvg-1.5.23.ebuild
new file mode 100644
index 000000000000..6ed6b1b15bf6
--- /dev/null
+++ b/media-libs/wxsvg/wxsvg-1.5.23.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+WX_GTK_VER=3.0-gtk3
+inherit wxwidgets
+
+DESCRIPTION="C++ library to create, manipulate and render SVG files"
+HOMEPAGE="http://wxsvg.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="wxWinLL-3"
+SLOT="0/3" # based on SONAME of libwxsvg.so
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND=">=dev-libs/expat-2:=
+       media-libs/libexif:=
+       >=dev-libs/glib-2.28:2=
+       dev-libs/libxml2:=
+       media-libs/fontconfig:=
+       media-libs/freetype:2=
+       media-libs/harfbuzz:=
+       x11-libs/cairo:=
+       x11-libs/pango:=
+       x11-libs/wxGTK:${WX_GTK_VER}=[X]
+       >=media-video/ffmpeg-2.6:0="
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+PATCHES=( "${FILESDIR}/ffmpeg5.patch" )
+
+src_configure() {
+       setup-wxwidgets base-unicode
+       econf \
+               --disable-static \
+               --with-wx-config=${WX_CONFIG}
+}
+
+src_install() {
+       default
+
+       # no static archives
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to