commit:     eeba8be174a1d795b2a7bea5d050fd95f4751f03
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 09:48:38 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=eeba8be1

media-video/dvdstyler: bump to 3.2.1

use gtk3, fix build with ffmpeg 5

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

 media-video/dvdstyler/Manifest               |  1 +
 media-video/dvdstyler/dvdstyler-3.2.1.ebuild | 70 ++++++++++++++++++++++
 media-video/dvdstyler/files/ffmpeg5.patch    | 89 ++++++++++++++++++++++++++++
 media-video/dvdstyler/files/wx30.patch       | 14 +++++
 4 files changed, 174 insertions(+)

diff --git a/media-video/dvdstyler/Manifest b/media-video/dvdstyler/Manifest
index 685628c2b439..1bfc852cc5dc 100644
--- a/media-video/dvdstyler/Manifest
+++ b/media-video/dvdstyler/Manifest
@@ -1 +1,2 @@
 DIST DVDStyler-3.0.4.tar.bz2 8870498 BLAKE2B 
c1ec7651d90613cebbd8d4e62b4626b8a7e2069eadc07bfe9a91e51bf33638135ca975f4857242b3f9ff34606a4e6084200059c82ebc3aa146f446f9b77483ae
 SHA512 
2747e6a494d331b6f35405d7d2ed47789f4452bb3d4e86b0c68cf0fafffb4e6de452b28fac0e9995c312017c7e4e8a3f89ad42bf0a0c99ce19c5d6c0ca6e351a
+DIST DVDStyler-3.2.1.tar.bz2 9040634 BLAKE2B 
f6c3ec5d6595b650ead167ae6532a0849cc6545e1531f10483a7dd2f9962ea6cd4494b7eb8224bbc6e70588b1054fc13a13a5e2f5d977b5b80692c7cc2553d53
 SHA512 
09124a6c8db2b8d8072bfe2f7de98474d736a36a66d5124eab1b925da9ca830901f554ca80d9a4403365616001d869237002a2cb467cf3cc11b37aea12ff9d90

diff --git a/media-video/dvdstyler/dvdstyler-3.2.1.ebuild 
b/media-video/dvdstyler/dvdstyler-3.2.1.ebuild
new file mode 100644
index 000000000000..b42c542e370e
--- /dev/null
+++ b/media-video/dvdstyler/dvdstyler-3.2.1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_P=${P/dvds/DVDS}
+WX_GTK_VER=3.0-gtk3
+
+inherit wxwidgets
+
+DESCRIPTION="A cross-platform free DVD authoring application"
+HOMEPAGE="https://www.dvdstyler.org/";
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +udev"
+
+DEPEND="
+       app-cdr/cdrtools
+       >=app-cdr/dvd+rw-tools-7.1
+       media-libs/libexif:=
+       >=media-libs/wxsvg-1.5.23:=
+       >=media-video/dvdauthor-0.7.1
+       >=media-video/ffmpeg-2.6:0=[encode]
+       >=media-video/xine-ui-0.99.7
+       virtual/jpeg:0
+       x11-libs/wxGTK:${WX_GTK_VER}=[gstreamer,X]
+       sys-apps/dbus
+       udev? ( >=virtual/libudev-215:= )"
+RDEPEND="${DEPEND}
+       >=app-cdr/dvdisaster-0.72.4
+       media-video/mjpegtools"
+BDEPEND="
+       app-arch/zip
+       app-text/xmlto
+       sys-devel/gettext
+       virtual/yacc
+       virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/ffmpeg5.patch "${FILESDIR}"/wx30.patch )
+
+src_prepare() {
+       default
+
+       # disable obsolete GNOME 2.x libraries wrt #508854
+       sed -i -e '/PKG_CONFIG/s:libgnomeui-2.0:dIsAbLeAuToMaGiC&:' configure 
|| die
+       # rmdir: failed to remove `tempfoobar': Directory not empty
+       sed -i -e '/rmdir "$$t"/d' docs/Makefile.in || die
+       # fix underlinking wrt #367863
+       sed -i -e 's:@LIBS@:& -ljpeg:' wxVillaLib/Makefile.in || die
+       # silence desktop-file-validate QA check
+       sed -i \
+               -e '/Icon/s:.png::' -e '/^Encoding/d' -e 
'/Categories/s:Application;::' \
+               data/dvdstyler.desktop || die
+}
+
+src_configure() {
+       setup-wxwidgets unicode
+       econf \
+               $(use_enable debug) \
+               --with-wx-config="${WX_CONFIG}"
+}
+
+src_install() {
+       default
+       rm "${ED}"/usr/share/doc/${PF}/{COPYING*,INSTALL*} || die
+}

diff --git a/media-video/dvdstyler/files/ffmpeg5.patch 
b/media-video/dvdstyler/files/ffmpeg5.patch
new file mode 100644
index 000000000000..c7ef02833076
--- /dev/null
+++ b/media-video/dvdstyler/files/ffmpeg5.patch
@@ -0,0 +1,89 @@
+Index: DVDStyler-3.2.1/src/mediaenc_ffmpeg.cpp
+===================================================================
+--- DVDStyler-3.2.1.orig/src/mediaenc_ffmpeg.cpp
++++ DVDStyler-3.2.1/src/mediaenc_ffmpeg.cpp
+@@ -26,10 +26,12 @@
+ extern "C" {
+ #define __STDC_CONSTANT_MACROS
+ #define __STDC_LIMIT_MACROS
++#include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+ #include <libswscale/swscale.h>
+ #include <libavutil/mathematics.h>
+ #include <libavutil/avstring.h>
++#include <libavutil/channel_layout.h>
+ }
+ 
+ #define AUDIO_BUF_SIZE 524288
+@@ -74,6 +76,9 @@ void print_error(const char *filename, i
+ bool wxFfmpegMediaEncoder::BeginEncode(const wxString& fileName, VideoFormat 
videoFormat, AudioFormat audioFormat,
+               AspectRatio aspectRatio, int videoBitrate, bool cbr) {
+       EndEncode();
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++      const
++#endif
+       AVOutputFormat* outputFormat = NULL;
+       if (videoFormat == vfNONE || audioFormat == afNONE)
+               outputFormat = av_guess_format(NULL, (const char*) 
fileName.ToUTF8(), NULL);
+@@ -83,13 +88,16 @@ bool wxFfmpegMediaEncoder::BeginEncode(c
+               wxLogError(wxT("Cannot open output format"));
+               return false;
+       }
+-      outputFormat->video_codec = videoFormat == vfNONE ? AV_CODEC_ID_NONE : 
AV_CODEC_ID_MPEG2VIDEO;
++      enum AVCodecID video_codec, audio_codec;
++
++      video_codec = videoFormat == vfNONE ? AV_CODEC_ID_NONE : 
AV_CODEC_ID_MPEG2VIDEO;
++
+       if (audioFormat == afNONE)
+-              outputFormat->audio_codec = AV_CODEC_ID_NONE;
++              audio_codec = AV_CODEC_ID_NONE;
+       else if (audioFormat == afAC3)
+-              outputFormat->audio_codec = AV_CODEC_ID_AC3;
++              audio_codec = AV_CODEC_ID_AC3;
+       else
+-              outputFormat->audio_codec = AV_CODEC_ID_MP2;
++              audio_codec = AV_CODEC_ID_MP2;
+       
+       m_outputCtx = NULL;
+       avformat_alloc_output_context2(&m_outputCtx, outputFormat, NULL, (const 
char*) fileName.ToUTF8());
+@@ -101,9 +109,9 @@ bool wxFfmpegMediaEncoder::BeginEncode(c
+       m_outputCtx->packet_size = 2048;
+ 
+       // add video and audio streams
+-      if (!addVideoStream(outputFormat->video_codec, videoFormat, 
aspectRatio, videoBitrate, cbr))
++      if (!addVideoStream(video_codec, videoFormat, aspectRatio, 
videoBitrate, cbr))
+               return false;
+-      if (!addAudioStream(outputFormat->audio_codec))
++      if (!addAudioStream(audio_codec))
+               return false;
+ 
+       // open the output file
+@@ -170,6 +178,9 @@ bool wxFfmpegMediaEncoder::addVideoStrea
+       m_videoStm->id = 0;
+ 
+       // find the video encoder and open it
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++      const
++#endif
+       AVCodec* encoder = avcodec_find_encoder((AVCodecID) codecId);
+       if (!encoder) {
+               wxLogError(wxT("Video codec not found"));
+@@ -235,7 +246,7 @@ bool wxFfmpegMediaEncoder::addVideoStrea
+       return true;
+ }
+ 
+-bool hasSampleFmt(AVCodec* codec, AVSampleFormat sample_fmt) {
++bool hasSampleFmt(const AVCodec* codec, AVSampleFormat sample_fmt) {
+       if (codec != NULL && codec->sample_fmts != NULL) {
+               int fIdx = 0;
+               while (codec->sample_fmts[fIdx] >= 0) {
+@@ -260,6 +271,9 @@ bool wxFfmpegMediaEncoder::addAudioStrea
+       m_audioStm->id = 1;
+ 
+       // find the audio encoder and open it
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++      const
++#endif
+       AVCodec* encoder = NULL;
+       AVSampleFormat sampleFmt = AV_SAMPLE_FMT_S16;
+       if ((AVCodecID) codecId == AV_CODEC_ID_AC3) {

diff --git a/media-video/dvdstyler/files/wx30.patch 
b/media-video/dvdstyler/files/wx30.patch
new file mode 100644
index 000000000000..1ffde52696f0
--- /dev/null
+++ b/media-video/dvdstyler/files/wx30.patch
@@ -0,0 +1,14 @@
+Index: DVDStyler-3.2.1/wxVillaLib/PropDlg.cpp
+===================================================================
+--- DVDStyler-3.2.1.orig/wxVillaLib/PropDlg.cpp
++++ DVDStyler-3.2.1/wxVillaLib/PropDlg.cpp
+@@ -760,7 +760,9 @@ void wxPropDlg::OnSelectColour(wxCommand
+       ((wxButton*) event.GetEventObject())->GetName().Mid(12).ToLong(&index);
+       ColourPanel* panel = ((ColourPanel*) m_controls[index]);
+       m_colourData.SetColour(panel->GetColour());
++#if wxMAJOR_VERSION >= 3 && wxMINOR_VERSION >= 1
+       m_colourData.SetChooseAlpha(true);
++#endif
+ #ifdef __WXMSW__
+       wxGenericColourDialog dialog(propWindow, &m_colourData);
+ #else

Reply via email to