ffmpeg patches, clamav version, minor revisions ..

all versions ffmpeg patches for akode, k3b, k9copy
updated klamav build for clamav v0.104.3
koffice - install GraphicsMagick if chosen as a dependency, even if not installing koffice
inkscape - save double-conversion archive as named upstream
revised tdenetwork patch
master
Ray-V 3 years ago
parent 294770731e
commit d1a64a2c7d

@ -139,15 +139,9 @@ echo $'--- lib/sigclient.cpp
## work-around for gcc11+ - see https://gcc.gnu.org/gcc-11/porting_to.html
[[ $(gcc --version) == *1[1-9]* ]] && CXXFLAGS_="-std=gnu++14"
## clang build
## comhttpsocket.cpp:25:44: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
## const char* g_strCOMVer = "libmusicbrainz/"VERSION;
## ^
[[ $COMPILER_CXX == clang++ ]] && {
## clang build - C++11 requires a space between literal and identifier
sed -i 's|"VERSION|" VERSION|' lib/comhttpsocket.cpp
sed -i 's|"VERSION|" VERSION|' lib/musicbrainz.cpp
}
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS ${CXXFLAGS_:-}" \
@ -173,9 +167,9 @@ MUSICBRAINZ="ON"
untar_fn
## Re: commit 1f4a3ab
## Make s_codecFeatures a "const char *" to remove ISO C++ warning
patch -N -p0 << EOF || true
[[ $TDEVERSION == 14.0.12 ]] && {
## Re: commit 1f4a3ab - Make s_codecFeatures a "const char *" to remove ISO C++ warning
patch -p0 << EOF
--- libk3b/jobs/k3bvideodvdtitletranscodingjob.cpp
+++ libk3b/jobs/k3bvideodvdtitletranscodingjob.cpp
@@ -564,1 +564,1 @@
@ -186,9 +180,8 @@ patch -N -p0 << EOF || true
+ static const char* s_codecFeatures[] = { "lame", "ac3", "ac3" };
EOF
## Re: 14.0.x, commits fad8c63 & ea1dbe7
## Enable ffmpeg 5.0 compatibility
patch -N -p0 << EOF || true
## all versons ffmpeg support, ported from upstream commits
patch -p0 << EOF
--- plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -36,4 +36,2 @@
@ -255,7 +248,7 @@ patch -N -p0 << EOF || true
+ if (::avcodec_open2(d->audio_stream_ctx, d->codec, NULL) < 0) {
@@ -210,2 +235,6 @@
- ::avcodec_close(FFMPEG_CODEC(d->audio_stream));
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 63, 100)
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
+ ::avcodec_free_context(&d->audio_stream_ctx);
+#else
+ ::avcodec_close(d->audio_stream_ctx);
@ -281,7 +274,7 @@ patch -N -p0 << EOF || true
@@ -327,10 +361,37 @@
- int len = ::avcodec_decode_audio4(FFMPEG_CODEC(d->audio_stream), d->frame,
- &gotFrame, &d->packet);
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 12, 100)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 106, 100)
+ int len = avcodec_receive_frame(d->audio_stream_ctx, d->frame);
+ if (len == 0) {
+ gotFrame = 1;
@ -328,6 +321,7 @@ patch -N -p0 << EOF || true
+#endif
+}
EOF
}
## using cmake common rules
find doc -name CMakeLists.txt | xargs rm

@ -33,10 +33,597 @@ getsource_fn
untar_fn
## clang build
## .../k9vamps/cputest.cpp:26:18: error: invalid suffix on literal; C++11 requires a space between literal and identifier
## clang build - C++11 requires a space between literal and identifier
sed -i 's|%%"REG_b|%%" REG_b|;s|%%"REG_S|%%" REG_S|' k9vamps/cputest.cpp
[[ $TDEVERSION == 14.0.12 ]] && {
## all versons ffmpeg support, ported from upstream commits
patch -p0 << EOF
--- config.h.in
+++ config.h.in
@@ -29,0 +30,3 @@
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
@@ -51,3 +53,0 @@
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
@@ -74,0 +75,3 @@
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
@@ -96,3 +98,0 @@
-/* swscale support */
-#undef HAVE_SWSCALE
-
@@ -120,2 +120 @@
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
@@ -124,6 +122,0 @@
-/* no */
-#undef NEEDS_AV_FREE_PACKET
-
-/* new ffmpeg */
-#undef NEW_FFMPEG
-
@@ -133,6 +125,0 @@
-/* No swscale support */
-#undef NO_SWSCALE
-
-/* old ffmpeg */
-#undef OLD_FFMPEG
-
@@ -178 +165,3 @@
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
@@ -298,4 +286,0 @@
-
-/* type to use in place of socklen_t if not defined (deprecated, use
- kde_socklen_t) */
-#undef ksize_t
--- configure.in.in
+++ configure.in.in
@@ -46,0 +47,2 @@
+PKG_CHECK_MODULES(FFMPEG, libavcodec libavformat libavutil libswscale, , \\
+ [AC_MSG_ERROR([ffmpeg installation is missing or incomplete])])
@@ -48,32 +49,0 @@
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-cxx_flags_safe="\$CXXFLAGS"
-CXXFLAGS="\$CXXFLAGS -D__STDC_CONSTANT_MACROS -I\$qt_includes"
-AC_CHECK_HEADER([ffmpeg/avcodec.h], \\
-[AC_DEFINE(OLD_FFMPEG,1, [old ffmpeg])], \\
- [AC_CHECK_HEADER([libavcodec/avcodec.h], \\
- [AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \\
- [AC_MSG_ERROR([libavcodec may be missing]) ])])
-CXXFLAGS="\$cxx_flags_safe"
-AC_LANG_RESTORE
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-cxx_flags_safe="\$CXXFLAGS"
-cflags_safe="\$CFLAGS"
-CXXFLAGS="\$CXXFLAGS -D__STDC_CONSTANT_MACROS -I\$qt_includes"
-CFLAGS="\$CFLAGS -D__STDC_CONSTANT_MACROS"
-AC_MSG_CHECKING([if libavformat/avformat.h provides av_free_packet])
-AC_TRY_LINK([#include <libavformat/avformat.h>
-],[AVPacket *packet; av_free_packet(packet);],
-AC_MSG_RESULT(yes),
-[AC_MSG_RESULT(no)
-AC_DEFINE(NEEDS_AV_FREE_PACKET,1,[no])])
-CXXFLAGS="\$cxx_flags_safe"
-CFLAGS="\$cflags_safe"
-AC_LANG_RESTORE
-
-have_swscale=no
-AC_CHECK_HEADER([libswscale/swscale.h], \\
-[AC_DEFINE(HAVE_SWSCALE, 1, [swscale support]) have_swscale=yes], \\
-[AC_DEFINE(NO_SWSCALE, 1, [No swscale support])])
--- k9author/Makefile.am
+++ k9author/Makefile.am
@@ -1 +1 @@
-AM_CPPFLAGS= -I\$(srcdir) -I\$(includedir) \$(all_includes)
+AM_CPPFLAGS= -I\$(srcdir) -I\$(includedir) \$(all_includes) \$(FFMPEG_CFLAGS)
@@ -8 +8 @@
-libk9author_la_LDFLAGS = \$(all_libraries)
+libk9author_la_LDFLAGS = \$(all_libraries) \$(FFMPEG_LIBS)
--- k9author/k9avidecode.cpp
+++ k9author/k9avidecode.cpp
@@ -15,9 +14,0 @@
-#ifdef OLD_FFMPEG
-#include <ffmpeg/avcodec.h>
-#endif
-#ifdef NEW_FFMPEG
-#include <libavcodec/avcodec.h>
-#include <libavformat/avformat.h>
-#include <libavutil/avutil.h>
-#endif
-
@@ -30 +21 @@
-#if !defined(NEW_FFMPEG) || LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51,42,0)
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51,42,0)
@@ -40,17 +30,0 @@
-void *CodecHandle=0;
-void *FormatHandle=0;
-void *UtilHandle=0;
-void *SwscaleHandle=0;
-int glibref=0;
-
-#ifdef NEW_FFMPEG
-void av_free_packet_internal(AVPacket *pkt)
-{
- if (pkt) {
-# if LIBAVCODEC_VERSION_INT < (AV_VERSION_INT(56,0,0))
- if (pkt->destruct) pkt->destruct(pkt);
-# endif
- pkt->data = NULL; pkt->size = 0;
- }
-}
-#endif
@@ -58,2 +31,0 @@
-#ifdef HAVE_SWSCALE
-#include "libswscale/swscale.h"
@@ -61 +32,0 @@
-#endif
@@ -65,89 +36,2 @@
- if (glibref==0) {
- CodecHandle=dlopen("libavcodec.so",RTLD_LAZY | RTLD_GLOBAL);
- FormatHandle=dlopen("libavformat.so",RTLD_LAZY | RTLD_GLOBAL);
- UtilHandle=dlopen("libavutil.so",RTLD_LAZY | RTLD_GLOBAL);
-# ifdef HAVE_SWSCALE
- SwscaleHandle=dlopen("libswscale.so",RTLD_LAZY);
- if (SwscaleHandle==0)
- SwscaleHandle=dlopen("libswscale.so.2",RTLD_LAZY);
-# endif
- }
- if (!CodecHandle) {
- m_error =i18n("Cannot open then library %1").arg("libavcodec");
- return;
- }
- if (!FormatHandle) {
- m_error =i18n("Cannot open then library %1").arg("libavformat");
- return;
- }
-# if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 33, 0)
- if (!UtilHandle) {
- m_error =i18n("Cannot open then library %1").arg("libavutil");
- return;
- }
-# endif
-# ifdef HAVE_SWSCALE
- if (!SwscaleHandle) {
- m_error =i18n("Cannot open the library %1").arg("libswscale");
- }
-# endif
- m_error="";
- av_register_all = (av_register_all_t)dlsym(FormatHandle,"av_register_all");
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
- avformat_open_input = (avformat_open_input_t)dlsym(FormatHandle,"avformat_open_input");
-# else
- av_open_input_file = (av_open_input_file_t)dlsym(FormatHandle,"av_open_input_file");
-# endif
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
- avformat_find_stream_info = (avformat_find_stream_info_t)dlsym(FormatHandle,"avformat_find_stream_info");
-# else
- av_find_stream_info = (av_find_stream_info_t)dlsym(FormatHandle,"av_find_stream_info");
-# endif
- avcodec_find_decoder =(avcodec_find_decoder_t) dlsym(CodecHandle,"avcodec_find_decoder");
-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
- avcodec_open2 = (avcodec_open2_t)dlsym(CodecHandle,"avcodec_open2");
-# else
- avcodec_open = (avcodec_open_t)dlsym(CodecHandle,"avcodec_open");
-# endif
- avcodec_alloc_frame = (avcodec_alloc_frame_t)dlsym(CodecHandle,"avcodec_alloc_frame");
- avpicture_get_size = (avpicture_get_size_t)dlsym(CodecHandle,"avpicture_get_size");
- av_malloc = (av_malloc_t)dlsym(CodecHandle,"av_malloc");
- avpicture_fill = (avpicture_fill_t)dlsym(CodecHandle,"avpicture_fill");
- av_read_frame = (av_read_frame_t)dlsym(FormatHandle,"av_read_frame");
-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
- avcodec_decode_video2 = (avcodec_decode_video2_t)dlsym(CodecHandle,"avcodec_decode_video2");
-# else
- avcodec_decode_video = (avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video");
-# endif
-# ifndef HAVE_SWSCALE
- img_convert = (img_convert_t)dlsym(CodecHandle,"img_convert");
- //if img_convert is null (deprecated in ffmpeg), we need libswscale
- if (!img_convert) {
- m_error = i18n("Cannot open the library %1").arg("libswscale");
- return;
- }
-# endif
- av_free = (av_free_t)dlsym(CodecHandle,"av_free");
- av_free_packet = (av_free_packet_t)dlsym(CodecHandle,"av_free_packet");
- if (av_free_packet==0)
- av_free_packet=av_free_packet_internal;
- avcodec_close = (avcodec_close_t)dlsym(FormatHandle,"avcodec_close");
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
- avformat_close_input = (avformat_close_input_t)dlsym(FormatHandle,"avformat_close_input");
-# else
- av_close_input_file = (av_close_input_file_t)dlsym(FormatHandle,"av_close_input_file");
-# endif
- av_seek_frame=(av_seek_frame_t)dlsym(FormatHandle,"av_seek_frame");
- av_rescale_q=(av_rescale_q_t)dlsym(FormatHandle,"av_rescale_q");
- avcodec_flush_buffers=(avcodec_flush_buffers_t)dlsym(CodecHandle,"avcodec_flush_buffers");
-# ifdef HAVE_SWSCALE
- sws_freeContext= (sws_freeContext_t)dlsym(SwscaleHandle,"sws_freeContext");
- sws_getContext=(sws_getContext_t)dlsym(SwscaleHandle,"sws_getContext");
- sws_scale= (sws_scale_t)dlsym(SwscaleHandle,"sws_scale");
-# endif
-
-# if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 33, 0)
- av_gettime=(av_gettime_t)dlsym(UtilHandle,"av_gettime");
-# else
- av_gettime=(av_gettime_t)dlsym(FormatHandle,"av_gettime");
-# endif
+
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)
@@ -154,0 +39 @@
+#endif
@@ -157,2 +41,0 @@
- glibref++;
-
@@ -171,14 +53,0 @@
- glibref--;
- if (glibref==0) {
- dlclose(FormatHandle);
- dlclose(CodecHandle);
- if(UtilHandle) {
- dlclose(UtilHandle);
- }
-# ifdef HAVE_SWSCALE
- if (SwscaleHandle) {
- dlclose(CodecHandle);
- }
-# endif
- }
-
@@ -197,7 +66,6 @@
- if (
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
- avformat_open_input(&m_FormatCtx, _fileName.utf8(), NULL, NULL)!=0
-# else
- av_open_input_file(&m_FormatCtx, _fileName.utf8(), NULL, 0, NULL)!=0
-# endif
- ) {
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
+ if (avformat_open_input(&m_FormatCtx, _fileName.utf8(), NULL, NULL)!=0)
+#else
+ if (av_open_input_file(&m_FormatCtx, _fileName.utf8(), NULL, 0, NULL)!=0)
+#endif
+ {
@@ -208,7 +76,6 @@
- if (
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
- avformat_find_stream_info(m_FormatCtx, NULL)<0
-# else
- av_find_stream_info(m_FormatCtx)<0
-# endif
- ) {
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
+ if (avformat_find_stream_info(m_FormatCtx, NULL)<0)
+#else
+ if (av_find_stream_info(m_FormatCtx)<0)
+#endif
+ {
@@ -218 +85 @@
- int i;
+ unsigned int i;
@@ -223 +90,6 @@
- if (m_FormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
+ if (m_FormatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_VIDEO)
+#else
+ if (m_FormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
+#endif
+ {
@@ -232,4 +103,0 @@
- // Get a pointer to the codec context for the video stream
- m_CodecCtx=m_FormatCtx->streams[m_videoStream]->codec;
-
-
@@ -237 +105,5 @@
- m_Codec=avcodec_find_decoder(m_CodecCtx->codec_id);
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
+ m_Codec=(AVCodec *)avcodec_find_decoder(m_FormatCtx->streams[m_videoStream]->codecpar->codec_id);
+#else
+ m_Codec=(AVCodec *)avcodec_find_decoder(m_FormatCtx->streams[m_videoStream]->codec->codec_id);
+#endif
@@ -241,0 +114,15 @@
+
+// Get/allocate a pointer to the codec context for the video stream
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
+ m_CodecCtx = avcodec_alloc_context3(m_Codec);
+ if (m_CodecCtx) {
+ avcodec_parameters_to_context(m_CodecCtx, m_FormatCtx->streams[m_videoStream]->codecpar);
+ }
+ else {
+ m_error=i18n("Failed to allocate a codec context");
+ return false;
+ }
+#else
+ m_CodecCtx=m_FormatCtx->streams[m_videoStream]->codec;
+#endif
+
@@ -243,7 +130,6 @@
- if (
-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
- avcodec_open2(m_CodecCtx, m_Codec, NULL)<0
-# else
- avcodec_open(m_CodecCtx, m_Codec)<0
-# endif
- ) {
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
+ if (avcodec_open2(m_CodecCtx, m_Codec, NULL)<0)
+#else
+ if (avcodec_open(m_CodecCtx, m_Codec)<0)
+#endif
+ {
@@ -255,0 +142,3 @@
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101)
+ m_Frame=av_frame_alloc();
+#else
@@ -256,0 +146 @@
+#endif
@@ -258,0 +149,3 @@
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101)
+ m_FrameRGB=av_frame_alloc();
+#else
@@ -259,0 +153 @@
+#endif
@@ -267,0 +162,4 @@
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 100)
+ numBytes=av_image_get_buffer_size(AV_PIX_FMT_RGB24, m_CodecCtx->width,
+ m_CodecCtx->height, 1);
+#else
@@ -269,0 +168 @@
+#endif
@@ -274,0 +174,4 @@
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 100)
+ av_image_fill_arrays(m_FrameRGB->data, m_FrameRGB->linesize, m_buffer,
+ AV_PIX_FMT_RGB24, m_CodecCtx->width, m_CodecCtx->height, 1);
+#else
@@ -276,0 +180 @@
+#endif
@@ -299 +203,9 @@
- AVPacket packet;
+ AVPacket *packet;
+
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 12, 100)
+ packet = av_packet_alloc();
+#else
+ AVPacket _packet;
+ av_init_packet(&_packet);
+ packet = &_packet;
+#endif
@@ -301 +212,0 @@
-# ifdef HAVE_SWSCALE
@@ -303 +213,0 @@
-# endif
@@ -305 +215 @@
- while (av_read_frame(m_FormatCtx, &packet)>=0 && !bFound) {
+ while (av_read_frame(m_FormatCtx, packet)>=0 && !bFound) {
@@ -307 +217 @@
- if (packet.stream_index==m_videoStream) {
+ if (packet->stream_index==m_videoStream) {
@@ -309,3 +219,11 @@
-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
- avcodec_decode_video2(m_CodecCtx, m_Frame, &frameFinished, &packet);
-# else
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 106, 100)
+ int ret = avcodec_receive_frame(m_CodecCtx, m_Frame);
+ if (ret == 0)
+ frameFinished = 1;
+ else if (ret == AVERROR(EAGAIN))
+ ret = 0;
+ if (ret == 0)
+ ret = avcodec_send_packet(m_CodecCtx, packet);
+#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
+ avcodec_decode_video2(m_CodecCtx, m_Frame, &frameFinished, packet);
+#else
@@ -313,2 +231,2 @@
- packet.data, packet.size);
-# endif
+ packet->data, packet->size);
+#endif
@@ -318,8 +236,7 @@
-// if (m_Frame->pts >=fspos)
- int64_t cur_dts=fspos;
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(54, 2, 0)
- cur_dts= packet.dts;
-# else
- if (m_FormatCtx->cur_st)
- cur_dts= m_FormatCtx->cur_st->cur_dts;
-# endif
+ int64_t cur_dts=fspos;
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(54, 2, 0)
+ cur_dts = packet->dts;
+#else
+ if (m_FormatCtx->cur_st)
+ cur_dts = m_FormatCtx->cur_st->cur_dts;
+#endif
@@ -328,10 +244,0 @@
-# ifndef HAVE_SWSCALE
- // Convert the image from its native format to RGB
- img_convert((AVPicture *)m_FrameRGB, AV_PIX_FMT_RGB24,
- (AVPicture*)m_Frame, m_CodecCtx->pix_fmt,
- m_CodecCtx->width, m_CodecCtx->height);
-
- // convert frame to TQImage
- SaveFrame(m_FrameRGB, m_CodecCtx->width,
- m_CodecCtx->height);
-# else
@@ -339 +246 @@
- sws_scale(toRGB_convert_ctx, m_Frame->data, m_Frame->linesize, 0, m_CodecCtx->height, m_FrameRGB->data,m_FrameRGB->linesize);
+ sws_scale(toRGB_convert_ctx, m_Frame->data, m_Frame->linesize, 0, m_CodecCtx->height, m_FrameRGB->data,m_FrameRGB->linesize);
@@ -344 +250,0 @@
-# endif
@@ -349,2 +255,7 @@
- // Free the packet that was allocated by av_read_frame
- av_free_packet(&packet);
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 25, 100)
+ // Unreference the packet from av_read_frame
+ av_packet_unref(packet);
+#else
+ // Free the packet from av_read_frame
+ av_free_packet(packet);
+#endif
@@ -352,0 +264,3 @@
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 12, 100)
+ av_packet_free(&packet);
+#endif
@@ -383 +297 @@
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
@@ -385 +299 @@
-# else
+#else
@@ -387 +301,6 @@
-# endif
+#endif
+
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
+ avcodec_free_context(&m_CodecCtx);
+#endif
+
--- k9author/k9avidecode.h
+++ k9author/k9avidecode.h
@@ -17,4 +17,2 @@
-#ifdef OLD_FFMPEG
-#include <ffmpeg/avformat.h>
-#endif
-#ifdef NEW_FFMPEG
+
+extern "C" {
@@ -21,0 +20 @@
+#include <libavcodec/avcodec.h>
@@ -23,3 +22,3 @@
-#endif
-
-#ifdef HAVE_SWSCALE
+#include <libavutil/time.h>
+#include <libavutil/imgutils.h>
+#include <libavutil/mathematics.h>
@@ -27 +26 @@
-#endif
+};
@@ -36,54 +34,0 @@
-//typedef dvd_file_t * (*DVDOpenFile_t) ( dvd_reader_t *, int, dvd_read_domain_t );
-typedef void (*av_register_all_t) (void);
-typedef int64_t (*av_gettime_t) (void);
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
-typedef int (*avformat_open_input_t)(AVFormatContext **, const char *, AVInputFormat *, AVDictionary **);
-#else
-typedef int (*av_open_input_file_t)(AVFormatContext **, const char *,AVInputFormat *,int, AVFormatParameters *);
-#endif
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
-typedef int (*avformat_find_stream_info_t)(AVFormatContext *, AVDictionary **);
-#else
-typedef int (*av_find_stream_info_t)(AVFormatContext *);
-#endif
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 25, 0)
-typedef AVCodec* (*avcodec_find_decoder_t)(enum AVCodecID);
-#else
-typedef AVCodec* (*avcodec_find_decoder_t)(enum CodecID);
-#endif
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
-typedef int (*avcodec_open2_t)(AVCodecContext *, AVCodec *, AVDictionary **);
-#else
-typedef int (*avcodec_open_t)(AVCodecContext *, AVCodec *);
-#endif
-typedef AVFrame * (*avcodec_alloc_frame_t)(void);
-
-typedef int (*avpicture_get_size_t)(int , int , int );
-typedef void * (*av_malloc_t)(unsigned int );
-typedef int (*avpicture_fill_t)(AVPicture *, uint8_t *,int , int , int);
-typedef int (*av_read_frame_t)(AVFormatContext *, AVPacket *);
-
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
-typedef int (*avcodec_decode_video2_t)(AVCodecContext *, AVFrame *, int *, AVPacket *);
-#else
-typedef int (*avcodec_decode_video_t)(AVCodecContext *, AVFrame *,int *, uint8_t *, int );
-#endif
-typedef int (*img_convert_t)(AVPicture *, int , const AVPicture *, int ,int, int);
-typedef void (*av_free_t)(void *);
-typedef int (*avcodec_close_t)(AVCodecContext *);
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
-typedef void (*avformat_close_input_t)(AVFormatContext **);
-#else
-typedef void (*av_close_input_file_t)(AVFormatContext *);
-#endif
-typedef int (*av_seek_frame_t)(AVFormatContext *,int,int64_t timestamp,int flags); typedef int64_t (*av_rescale_q_t)(int64_t , AVRational , AVRational ) ;
-typedef void (*avcodec_flush_buffers_t)(AVCodecContext *);
-typedef void (*av_free_packet_t)(AVPacket *);
-
-#ifdef HAVE_SWSCALE
-typedef void (*sws_freeContext_t)(struct SwsContext *swsContext);
-typedef struct SwsContext* (*sws_getContext_t)(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
-typedef int (*sws_scale_t)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,int srcSliceH, uint8_t* dst[], int dstStride[]);
-#endif
-
-
@@ -107 +52 @@
- TQString getError() const;
+ TQString getError() const;
@@ -110,47 +54,0 @@
- av_register_all_t av_register_all;
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
- avformat_open_input_t avformat_open_input;
-# else
- av_open_input_file_t av_open_input_file;
-# endif
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
- avformat_find_stream_info_t avformat_find_stream_info;
-# else
- av_find_stream_info_t av_find_stream_info;
-# endif
- avcodec_find_decoder_t avcodec_find_decoder;
-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
- avcodec_open2_t avcodec_open2;
-# else
- avcodec_open_t avcodec_open;
-# endif
- avcodec_alloc_frame_t avcodec_alloc_frame;
- av_seek_frame_t av_seek_frame;
- avpicture_get_size_t avpicture_get_size;
- av_malloc_t av_malloc;
- avpicture_fill_t avpicture_fill;
- av_read_frame_t av_read_frame;
-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
- avcodec_decode_video2_t avcodec_decode_video2;
-# else
- avcodec_decode_video_t avcodec_decode_video;
-# endif
- img_convert_t img_convert;
- av_free_t av_free;
- avcodec_close_t avcodec_close;
-# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
- avformat_close_input_t avformat_close_input;
-# else
- av_close_input_file_t av_close_input_file;
-# endif
- av_rescale_q_t av_rescale_q;
- av_gettime_t av_gettime;
- avcodec_flush_buffers_t avcodec_flush_buffers;
- av_free_packet_t av_free_packet;
-# ifdef HAVE_SWSCALE
- sws_freeContext_t sws_freeContext;
- sws_getContext_t sws_getContext;
- sws_scale_t sws_scale;
-# endif
-
-
--- src/Makefile.am
+++ src/Makefile.am
@@ -33 +33 @@
-k9copy_LDFLAGS = \$(all_libraries) \$(KDE_RPATH) \$(LIB_QT) -lDCOP \$(LIB_TDECORE) \$(LIB_TDEUI) -ltdefx \$(LIB_TDEIO) -ltdetexteditor \$(LIB_TDEPARTS)
+k9copy_LDFLAGS = \$(all_libraries) \$(KDE_RPATH) \$(LIB_QT) -lDCOP \$(LIB_TDECORE) \$(LIB_TDEUI) -ltdefx \$(LIB_TDEIO) -ltdetexteditor \$(LIB_TDEPARTS) \$(FFMPEG_LIBS)
EOF
}
# set support for additional language(s) as per I18N variable
# but only for languages available with this package
langs="";for Lang in $I18N;do [[ -e po/$Lang".po" ]] && langs="$langs $Lang"".po";done

@ -1,7 +1,7 @@
klamav needs clamav as a build time requirement
Download from:
https://www.clamav.net/downloads/production/clamav-0.103.3.tar.gz
https://www.clamav.net/downloads/production/clamav-0.104.3.tar.gz
If using wget, include a user agent otherwise '403 Forbidden' is returned.
For example, wget --user-agent='Mozilla'

@ -33,11 +33,12 @@ source ../../get-source.sh
## klamav needs clamav as a build time requirement
[[ $(cat $TMPVARS/PRE_DOWNLOAD) != yes ]] && {
# ### clamav - start
clamav_VERS=0.104.3
clamav_installed_fn () { pkg-config libclamav ;}
## If it's already installed, go to end
clamav_installed_fn || {
## otherwise, if the source archive is in 'src' ..
[[ -s $BUILD_TDE_ROOT/src/clamav-0.103.3.tar.gz ]] && {
[[ -s $BUILD_TDE_ROOT/src/clamav-$clamav_VERS.tar.gz ]] && {
## .. build, package, and install it
(
echo "
@ -48,48 +49,28 @@ getsource_fn # to set SLKCFLAGS
cd $TMP_BUILD
rm -rf *clamav*
tar xf $BUILD_TDE_ROOT/src/clamav-0.103.3.tar.gz
tar xf $BUILD_TDE_ROOT/src/clamav-$clamav_VERS.tar.gz
cd clamav-0.103.3/
cd clamav-$clamav_VERS/
## rpaths are to /.../lib & GNUInstallDirs determines the correct lib directory == CMAKE_INSTALL_LIBDIR
## -> delete the existing GNUInstallDirs which is too late in CMakeLists.txt to apply here for rpaths
sed -i '/GNUInstallDirs/d' CMakeLists.txt
## -> insert include(GNUInstallDirs) to set CMAKE_INSTALL_LIBDIR
sed -i '108iinclude(GNUInstallDirs)' CMakeLists.txt
## -> set RPATH relative to ORIGIN
sed -i 's|set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")|set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")|' CMakeLists.txt
## install man pages as per Slackware default
sed -i 's|/share/man/|/man/|' docs/CMakeLists.txt
mkdir -p build/docs
## install html documentation
sed -i 's|OPTIONAL||' docs/CMakeLists.txt
sed -i '100s|endif()||' docs/CMakeLists.txt
sed -i '96iendif()' docs/CMakeLists.txt
cp -a docs/html build/docs/
## clang build error:
#/tmp/build/clamav-0.103.3/clamonacc/clamonacc.c:335:96: error: use of undeclared identifier 'O_LARGEFILE'
# ctx->fan_fd = fanotify_init(FAN_CLASS_CONTENT | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS, O_LARGEFILE | O_RDONLY);
# ^
[[ $COMPILER == clang ]] && \
echo '
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DO_LARGEFILE")' >> clamonacc/CMakeLists.txt
## set RPATH relative to ORIGIN always
sed -i 's|CMAKE_INSTALL_RPATH.*$|CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")|' CMakeLists.txt
[[ -s /usr/lib64/libmilter.a ]] && MILTER="ON"
[[ $GCC_VIS == 0 ]] && unset GCC_VIS # needs to be unset for parameter expansion for CMAKE_CXX_FLAGS
mkdir build
cd build/
# LIBDIRSUFFIX not required - any suffix is included in CMAKE_INSTALL_LIBDIR
# LIBDIRSUFFIX not required - any suffix is included in CMAKE_INSTALL_LIBDIR which is set by GNUInstallDirs
cmake ${G_NINJA:-} \
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKCFLAGS ${GCC_VIS:+-fvisibility=hidden -fvisibility-inlines-hidden}" \
-DCMAKE_C_COMPILER=$COMPILER \
-DCMAKE_CXX_COMPILER=$COMPILER_CXX \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_MAN_PAGES="ON" \
-DCMAKE_INSTALL_MANDIR=/usr/local/man \
-DENABLE_SYSTEMD="OFF" \
-DENABLE_MILTER=${MILTER:-"OFF"} \
-Wno-dev \
@ -104,8 +85,8 @@ mangzip_fn
strip_fn
cd $TMP_BUILD/package-clamav
makepkg -l y -c n $OUTPUT/clamav-0.103.3-$ARCH-$BUILD.txz
installpkg $OUTPUT/clamav-0.103.3-$ARCH-$BUILD.txz
makepkg -l y -c n $OUTPUT/clamav-$clamav_VERS-$ARCH-$BUILD.txz
installpkg $OUTPUT/clamav-$clamav_VERS-$ARCH-$BUILD.txz
)
clamav_installed_fn && echo "
now building klamav" || { echo -e "\033[39;1m
@ -115,13 +96,12 @@ clamav_installed_fn && echo "
echo -e "
############
clamav is required for klamav
It's not installed nor is the source archive in the 'src' directory
clamav is required for building klamav
Download [including user-agent, otherwise '403 Forbidden' is returned]:
\033[39;1m
( cd $BUILD_TDE_ROOT/src
wget --user-agent='Mozilla' https://www.clamav.net/downloads/production/clamav-0.103.3.tar.gz )
wget --user-agent='Mozilla' https://www.clamav.net/downloads/production/clamav-$clamav_VERS.tar.gz )
\033[0m
and re-run this script ..

@ -63,10 +63,7 @@ patch -p0 -N << EOF || true
' | while read line
EOF
#
## clang build
## ../../../../krusader/DiskUsage/radialMap/map.cpp:329:26: error: non-constant-expression cannot be narrowed from type 'uint' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
## int a[3] = { (*it)->start(), (*it)->length(), 0 };
## ^~~~~~~~~~~~~~
## commit 57f84ff
patch -p0 -N << EOF || true
--- krusader/DiskUsage/radialMap/map.cpp

@ -443,7 +443,7 @@ ${app_2:-} ${about_2:-} ${status_2:-} ${comment_2:-} \
"Apps/knetstats" "A network monitor that shows rx/tx LEDs" off "\Zb\Z6 \Zn" \
"Apps/knights" "A graphical chess interface" off "\Zb\Z6 \Zn" \
"Apps/knmap" "A graphical nmap interface" off "\Zb\Z6 Might need tdesudo \Zn" \
" Misc/GraphicsMagick" "Swiss army knife of image processing" off "\Zb\Z6 Buildtime option for chalk[krita] in koffice \Zn" \
" Misc/GraphicsMagick" "Swiss army knife of image processing" off "\Zb\Z6 Buildtime option for chalk[krita] in koffice, and inkscape \Zn" \
"Apps/koffice" "Office Suite" off "\Zb\Z6 Optional build-time dependency - GraphicsMagick \Zn" \
"Apps/koffice-i18n" "Internationalization files for koffice" off "\Zb\Z6 Provides \Zb\Z3Additional language support\Zb\Z6 for koffice \Zn" \
${app_3:-} ${about_3:-} ${status_3:-} ${comment_3:-} \
@ -633,7 +633,7 @@ There are two options that can be set for building the imaging app.
[1] It is called \Zb\Z3chalk\Zn in TDE but was originally \Zb\Z3krita\Zn.
[2] GraphicsMagick will enable an extended range of image formats to be loaded and saved. ImageMagick should be an alternative, but building fails with that, so without GM, the range of supported image formats will be limited.
Choosing \Zb\Z3useGM\Zn here will add it to the build list if not already selected or installed.
Choosing \Zb\Z3useGM\Zn here will add it to the build list if not already selected or installed, and it will be installed for the koffice build.
" \
21 75 2 \
" krita" "Set the app name to krita" on "\Zb\Z6 otherwise will be \Zb\Z3chalk\Zn" \
@ -1091,6 +1091,9 @@ ${EXIT_FAIL:-":"}
}
## install packages - any 'Cannot install /tmp/....txz: file not found' error message caused by build failure deliberately not suppressed.
[[ $INST == 1 ]] && [[ $package != tde-i18n* ]] && upgradepkg --install-new --reinstall $TMP/$TDE_PFX$package-$(eval echo $version)-*-$build*.txz
## If GraphicsMagick has been selected as a dependency for koffice, install it even if the build has been set to 'build only'
[[ $INST == 0 ]] && [[ $(cat $TMPVARS/Krita_OPTS) == *useGM* && $package == GraphicsMagick ]] && \
upgradepkg --install-new --reinstall $TMP/$TDE_PFX$package-$(eval echo $version)-*-$build*.txz
}
# back to original directory

@ -50,8 +50,6 @@ cd ocaml-4.05.0/
## patch for error caused by glibc-2.34:
## signals_asm.c:197:13: error: variably modified sig_alt_stack at file scope
## 197 | static char sig_alt_stack[SIGSTKSZ];
## | ^~~~~~~~~~~~~
## Refs: https://github.com/ocaml/ocaml/{issues/10250,pull/10266}
## https://github.com/dra27/ocaml/[pull/56]
## └ 0d2c1fd77b4715c70d0ffc4348f1bc2d3eaacbf7 refs/remotes/origin/alt-signal-stack-4.05
@ -166,13 +164,9 @@ patch -p0 << EOF
+#endif
EOF
## clang build error:
## clang build errors:
#amd64.S:728:9: error: changed section flags for .rodata.cst8, expected: 0x12
# .section .rodata.cst8,"a",@progbits
# ^
#amd64.S:728:9: error: changed section entsize for .rodata.cst8, expected: 8
# .section .rodata.cst8,"a",@progbits
# ^
## backport from ocaml commit 8a46d76bf9359b5cc505b3f2f9c81eb624c631fa
patch -p0 << EOF
--- asmcomp/amd64/emit.mlp

@ -33,13 +33,21 @@ getsource_fn
untar_fn
## commit 4fa7deb, TDE issue 44
## r14.0.x branch commit 3e7a60bf
## libvncserver: remove unnecessary re-definition of true/false boolean values.
patch -p0 -N << EOF || true
--- krfb/libvncserver/main.cpp
+++ krfb/libvncserver/main.cpp
@@ -21,1 +21,1 @@
@@ -19,5 +19,0 @@
- #ifndef false
- #define false 0
- #define true -1
+ #define true 1
- #endif
-
@@ -830,1 +825,1 @@
-#include "main.moc"
\ No newline at end of file
+#include "main.moc"
EOF
listdocs_fn

@ -35,8 +35,6 @@ untar_fn
## clang build failure
## ...kmilo/generic/generic_monitor.cpp:78:16: error: non-constant-expression cannot be narrowed from type 'int' to 'uint' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
## { "Search", TDEShortcut("XF86Search"), TQT_SLOT(launchSearch()) },
## ^~~~~~~~~~~~~~~~~~~~~~~~~
## commit 4046d4e - fixes issue 28
patch -p0 -N << EOF || true
--- kmilo/generic/generic_monitor.h

@ -33,8 +33,9 @@ getsource_fn
untar_fn
## for ffmpeg-5, branch 14.0.x, commit 9e2710c
patch -p0 -N << EOF || true
[[ $TDEVERSION == 14.0.12 ]] && {
## all versons ffmpeg support, ported from upstream commits
patch -p0 << EOF
--- akode/plugins/ffmpeg_decoder/ffmpeg_decoder.cpp
+++ akode/plugins/ffmpeg_decoder/ffmpeg_decoder.cpp
@@ -40 +40 @@
@ -159,7 +160,7 @@ patch -p0 -N << EOF || true
@@ -339 +380,23 @@
- int len = avcodec_decode_audio4( d->ic->streams[d->audioStream]->codec,
+
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 12, 100)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 106, 100)
+ int len = avcodec_receive_frame(d->audioStream_ctx, decodeFrame);
+ if (len == 0) {
+ decoded = 1;
@ -205,6 +206,7 @@ patch -p0 -N << EOF || true
@@ -400,0 +466 @@
+ d->packet = NULL;
EOF
}
chown_fn

@ -41,14 +41,14 @@ getsource_fn
## If it is already installed, go to end
ldconfig -p|grep libdouble-conversion 1>/dev/null || {
## otherwise, if the source archive is in 'src' ..
[[ -s $BUILD_TDE_ROOT/src/double-conversion-3.1.5.tar.gz ]] && {
[[ -s $BUILD_TDE_ROOT/src/v3.1.5.tar.gz ]] && {
## .. build, package, and install ..
(
echo -e "\n building double-conversion \n"
cd /$TMP_BUILD
rm -rf *double-conversion*
tar xf $BUILD_TDE_ROOT/src/double-conversion-3.1.5.tar.gz
tar xf $BUILD_TDE_ROOT/src/v3.1.5.tar.gz
cd double-conversion-3.1.5/
cd cmake/
@ -68,10 +68,20 @@ installpkg $OUTPUT/double-conversion-3.1.5-$ARCH-$BUILD.txz
)
echo -e "\n now building inkscape \n"
} || { ## .. but if the source archive isn't in 'src', display download URL ..
echo -e "\n ############ \n\n\033[39;1m double-conversion is not installed and is required for this build \n \033[34;1m
echo -e "
############
double-conversion is required for building inkscape
Download:
\n wget -O $BUILD_TDE_ROOT/src/double-conversion-3.1.5.tar.gz https://github.com/google/double-conversion/archive/v3.1.5.tar.gz
\n and re-run this script .. \n\n \033[0m ############ \n" ; exit 1 ; }
\033[39;1m
( cd $BUILD_TDE_ROOT/src
wget https://github.com/google/double-conversion/archive/v3.1.5.tar.gz )
\033[0m
and re-run this script ..
############
" ; exit 1 ; }
}
}
# ### double-conversion - end

Loading…
Cancel
Save