diff --git a/srcpkgs/synfig/patches/ffmpeg6.patch b/srcpkgs/synfig/patches/ffmpeg6.patch new file mode 100644 index 00000000000..10780b42782 --- /dev/null +++ b/srcpkgs/synfig/patches/ffmpeg6.patch @@ -0,0 +1,71 @@ +--- a/src/modules/mod_libavcodec/trgt_av.cpp 2022-10-25 09:14:12.000000000 -0400 ++++ b/src/modules/mod_libavcodec/trgt_av.cpp 2023-05-05 21:34:17.899194559 -0400 +@@ -38,6 +41,7 @@ + extern "C" + { + #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H ++# include + # include + #elif defined(HAVE_AVFORMAT_H) + # include +@@ -155,11 +156,11 @@ + } + + bool open_video_stream() { +- if (avcodec_open2(video_context, NULL, NULL) < 0) { ++ if (avcodec_open2(video_context, nullptr, nullptr) < 0) { + synfig::error("Target_LibAVCodec: could not open video codec"); + // seems the calling of avcodec_free_context after error will cause crash + // so just forget about this context +- video_context = NULL; ++ video_context = nullptr; + close(); + return false; + } +@@ -234,15 +235,21 @@ + close(); + + if (!av_registered) { ++#if LIBAVCODEC_VERSION_MAJOR < 58 // FFMPEG < 4.0 + av_register_all(); ++#endif + av_registered = true; + } + + // guess format +- AVOutputFormat *format = av_guess_format(NULL, filename.c_str(), NULL); ++#if LIBAVCODEC_VERSION_MAJOR < 59 // FFMPEG < 5.0 ++ AVOutputFormat* format = av_guess_format(nullptr, filename.c_str(), nullptr); ++#else ++ const AVOutputFormat* format = av_guess_format(nullptr, filename.c_str(), nullptr); ++#endif + if (!format) { + synfig::warning("Target_LibAVCodec: unable to guess the output format, defaulting to MPEG"); +- format = av_guess_format("mpeg", NULL, NULL); ++ format = av_guess_format("mpeg", nullptr, nullptr); + } + if (!format) { + synfig::error("Target_LibAVCodec: unable to find 'mpeg' output format"); +@@ -254,6 +261,7 @@ + context = avformat_alloc_context(); + assert(context); + context->oformat = format; ++#if LIBAVCODEC_VERSION_MAJOR < 58 // FFMPEG < 4.0 + if (filename.size() + 1 > sizeof(context->filename)) { + synfig::error( + "Target_LibAVCodec: filename too long, max length is %d, filename is '%s'", +@@ -263,6 +271,14 @@ + return false; + } + memcpy(context->filename, filename.c_str(), filename.size() + 1); ++#else ++ context->url = av_strndup(filename.c_str(), filename.size()); ++ if (!context->url) { ++ synfig::error("Target_LibAVCodec: cannot allocate space for filename"); ++ close(); ++ return false; ++ } ++#endif + + packet = av_packet_alloc(); + assert(packet); diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template index 510eb2b4dbf..6308bdf1758 100644 --- a/srcpkgs/synfig/template +++ b/srcpkgs/synfig/template @@ -2,12 +2,12 @@ # Should be kept in sync with 'synfigstudio' and 'ETL' pkgname=synfig version=1.4.5 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib" hostmakedepends="boost-build ImageMagick pkg-config intltool" -makedepends="ETL gettext-devel libxml++-devel mlt-devel libmagick-devel - libmng-devel boost-build boost-devel libopenexr-devel ffmpeg-devel" +makedepends="ETL gettext-devel libxml++-devel mlt7-devel libmagick-devel + libmng-devel boost-build boost-devel libopenexr-devel ffmpeg6-devel" depends="ImageMagick" short_desc="CLI 2D vector and timeline-based animation software" maintainer="Orphaned " @@ -20,7 +20,7 @@ CXXFLAGS="-std=c++11 -DHAVE_LOCALE_H=1" synfig-devel_package() { depends="${sourcepkg}>=${version}_${revision} - libopenexr-devel libxml++-devel mlt-devel" + libopenexr-devel libxml++-devel mlt7-devel" short_desc+=" - development files" pkg_install() { vmove usr/bin/synfig-config