From 3f3a9b45e6826a030272077c78aac2da397d0411 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Tue, 16 Sep 2025 12:01:57 +0300 Subject: [PATCH] Rebuild with ffmpeg 8.0 --- pkg.info | 5 ++-- source-files/ffmpeg8-fix.patch | 50 ++++++++++++++++++++++++++++++++++ source.sh | 19 ++++++------- 3 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 source-files/ffmpeg8-fix.patch diff --git a/pkg.info b/pkg.info index 484f377..258c4cf 100644 --- a/pkg.info +++ b/pkg.info @@ -1,10 +1,11 @@ name: gegl description: Data flow based image processing framework version: 0.4.62 +revision: 2 url: https://www.gegl.org/ license: GPL3-or-later OR LGPL3-or-later architecture: any depends: ["babl", "cairo", "gcc-libs", "gdk-pixbuf", "glib", "glibc", "jasper", "json-glib", "lcms2", "lensfun", "libjpeg-turbo", "libpng", "libraw", "librsvg", "libspiro", "libtiff", "libwebp", "luajit", "pango", "poppler"] -optional_depends: ["ffmpeg", "graphviz"] -make_depends: ["gobject-introspection", "meson", "python-pygobject", "vala"] +optional_depends: ["ffmpeg", "graphviz", "sdl2-compat"] +make_depends: ["ffmpeg", "gexiv2", "gobject-introspection", "meson", "python-pygobject", "sdl2-compat","vala"] type: source diff --git a/source-files/ffmpeg8-fix.patch b/source-files/ffmpeg8-fix.patch new file mode 100644 index 0000000..3fe3dd9 --- /dev/null +++ b/source-files/ffmpeg8-fix.patch @@ -0,0 +1,50 @@ +Submitted By: Rahul Chandra +Date: 2025-09-05 +Initial Package Version: 0.4.62 +Upstream Status: Applied eda8ba51786f197b72265eafcdab407d91ec9c70 +Origin: Gnome Gitlab +Description: Fixes building against FFMPEG 8.0 + +From eda8ba51786f197b72265eafcdab407d91ec9c70 Mon Sep 17 00:00:00 2001 +From: Bruno Lopes +Date: Fri, 5 Sep 2025 19:46:24 -0300 +Subject: [PATCH] operations: Support FFMPEG 8 on ff-load + +Closes #428 + +Patch from https://github.com/msys2/MINGW-packages/pull/25335 +--- + operations/external/ff-load.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c +index a8c266827..babd7f6d6 100644 +--- a/operations/external/ff-load.c ++++ b/operations/external/ff-load.c +@@ -349,7 +349,11 @@ decode_frame (GeglOperation *operation, + if (frame < 2 || frame > prevframe + 64 || frame < prevframe ) + { + int64_t seek_target = av_rescale_q (((frame) * AV_TIME_BASE * 1.0) / o->frame_rate ++#if LIBAVCODEC_VERSION_MAJOR < 60 + , AV_TIME_BASE_Q, p->video_stream->time_base) / p->video_ctx->ticks_per_frame; ++#else ++, AV_TIME_BASE_Q, p->video_stream->time_base) / (p->video_ctx->codec_descriptor->props & AV_CODEC_PROP_FIELDS ? 2 : 1); ++#endif + + if (av_seek_frame (p->video_fcontext, p->video_index, seek_target, (AVSEEK_FLAG_BACKWARD )) < 0) + fprintf (stderr, "video seek error!\n"); +@@ -403,7 +407,11 @@ decode_frame (GeglOperation *operation, + break; + } + got_picture = 1; ++#if LIBAVUTIL_VERSION_MAJOR < 58 + if ((pkt.dts == pkt.pts) || (p->lavc_frame->key_frame!=0)) ++#else ++ if ((pkt.dts == pkt.pts) || (p->lavc_frame->flags & AV_FRAME_FLAG_KEY)) ++#endif + { + // cur_dts and first_dts are moved to libavformat/internal.h + /* +-- +GitLab + diff --git a/source.sh b/source.sh index 69df267..ce72e20 100644 --- a/source.sh +++ b/source.sh @@ -10,33 +10,30 @@ FILENAME="${DOWNLOAD##*/}" prepare() { wget "$DOWNLOAD" tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/ffmpeg8-fix.patch } # The build function is executed in the source directory # This function is used to compile the source code build() { - mkdir build - cd build - - meson setup --prefix=/usr --buildtype=release .. - meson compile + meson setup --prefix=/usr --buildtype=release -Dworkshop=true -Dmrg=disabled -Dmaxflow=disabled build + meson compile -C build } # The check function is executed in the source directory # This function is used to run tests to verify the package has been compiled correctly check() { - cd build - # Bypass gegl:ff-load-save test suite due to incompatibilities with recent ffmpeg version - meson test --no-suite "gegl:ff-load-save" + meson test -C build --no-suite "gegl:ff-load-save" --print-errorlogs } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { - cd build - - meson install --destdir="$BPM_OUTPUT" + meson install -C build --destdir="$BPM_OUTPUT" + # Install package license install -Dm644 "$BPM_SOURCE"/COPYING -t "$BPM_OUTPUT"/usr/share/licenses/gegl/ }