From b7352eecfdaee2a746c2cf068af725f4529b96a0 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 2 Nov 2026 11:47:14 +0100 Subject: [PATCH] Update ffmpeg6 and add ffmpeg9 --- recipes/libs/ffmpeg6/binutils-2.41.patch | 76 ---------------------- recipes/libs/ffmpeg6/ffmpeg.patch | 20 ++---- recipes/libs/ffmpeg6/recipe.toml | 5 +- recipes/wip/libs/media/ffmpeg9/recipe.toml | 44 +++++++++++++ recipes/wip/libs/media/ffmpeg9/redox.patch | 13 ++++ 5 files changed, 63 insertions(+), 95 deletions(-) delete mode 100644 recipes/libs/ffmpeg6/binutils-2.41.patch create mode 100644 recipes/wip/libs/media/ffmpeg9/recipe.toml create mode 100644 recipes/wip/libs/media/ffmpeg9/redox.patch diff --git a/recipes/libs/ffmpeg6/binutils-2.41.patch b/recipes/libs/ffmpeg6/binutils-2.41.patch deleted file mode 100644 index 33fd3d484..000000000 --- a/recipes/libs/ffmpeg6/binutils-2.41.patch +++ /dev/null @@ -1,76 +0,0 @@ -From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 -From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= -Date: Sun, 16 Jul 2023 18:18:02 +0300 -Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift - instructions within inline assembly - -Fixes assembling with binutil as >= 2.41 - -Signed-off-by: James Almer ---- - libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- - 1 file changed, 23 insertions(+), 3 deletions(-) - -diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h -index 6298f5ed19..ca7e2dffc1 100644 ---- a/libavcodec/x86/mathops.h -+++ b/libavcodec/x86/mathops.h -@@ -35,12 +35,20 @@ - static av_always_inline av_const int MULL(int a, int b, unsigned shift) - { - int rt, dummy; -+ if (__builtin_constant_p(shift)) - __asm__ ( - "imull %3 \n\t" - "shrdl %4, %%edx, %%eax \n\t" - :"=a"(rt), "=d"(dummy) -- :"a"(a), "rm"(b), "ci"((uint8_t)shift) -+ :"a"(a), "rm"(b), "i"(shift & 0x1F) - ); -+ else -+ __asm__ ( -+ "imull %3 \n\t" -+ "shrdl %4, %%edx, %%eax \n\t" -+ :"=a"(rt), "=d"(dummy) -+ :"a"(a), "rm"(b), "c"((uint8_t)shift) -+ ); - return rt; - } - -@@ -113,19 +121,31 @@ __asm__ volatile(\ - // avoid +32 for shift optimization (gcc should do that ...) - #define NEG_SSR32 NEG_SSR32 - static inline int32_t NEG_SSR32( int32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("sarl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("sarl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - - #define NEG_USR32 NEG_USR32 - static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("shrl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("shrl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - --- -2.30.2 - diff --git a/recipes/libs/ffmpeg6/ffmpeg.patch b/recipes/libs/ffmpeg6/ffmpeg.patch index 9d24920c0..d6eea9d6b 100644 --- a/recipes/libs/ffmpeg6/ffmpeg.patch +++ b/recipes/libs/ffmpeg6/ffmpeg.patch @@ -1,7 +1,7 @@ -diff -rupN source-original/configure source/configure ---- source-original/configure 2018-03-04 11:13:59.000000000 +0100 -+++ source/configure 2018-03-04 11:18:10.026033282 +0100 -@@ -5141,6 +5141,8 @@ case $target_os in +diff -ruwN source/configure source-new/configure +--- source/configure 2026-05-05 14:22:01.000000000 +0000 ++++ source-new/configure 2026-11-02 05:18:51.788806151 +0000 +@@ -5814,6 +5814,8 @@ ;; minix) ;; @@ -10,15 +10,3 @@ diff -rupN source-original/configure source/configure none) ;; *) -diff -rupN source-original/fftools/ffmpeg.c source/fftools/ffmpeg.c ---- source-original/fftools/ffmpeg.c 2018-03-04 11:13:59.000000000 +0100 -+++ source/fftools/ffmpeg.c 2018-03-04 11:45:38.326394016 +0100 -@@ -91,7 +91,7 @@ - - #if HAVE_TERMIOS_H - #include --#include -+//#include - #include - #include - #elif HAVE_KBHIT diff --git a/recipes/libs/ffmpeg6/recipe.toml b/recipes/libs/ffmpeg6/recipe.toml index f18ff3bf4..f10c50cac 100644 --- a/recipes/libs/ffmpeg6/recipe.toml +++ b/recipes/libs/ffmpeg6/recipe.toml @@ -1,9 +1,8 @@ [source] -tar = "https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz" -blake3 = "4879074c357102f85932673044c57c144b0c188ae58edec2a115965536ee340f" +tar = "https://ffmpeg.org/releases/ffmpeg-6.1.5.tar.xz" +blake3 = "da8e6743d96f27d5b5425339218f9a954d9440cb27ba449b449d686b411292e9" patches = [ "ffmpeg.patch", - "binutils-2.41.patch", ] [build] diff --git a/recipes/wip/libs/media/ffmpeg9/recipe.toml b/recipes/wip/libs/media/ffmpeg9/recipe.toml new file mode 100644 index 000000000..d69198188 --- /dev/null +++ b/recipes/wip/libs/media/ffmpeg9/recipe.toml @@ -0,0 +1,44 @@ +# TODO: need j1 relibc function +[source] +tar = "https://ffmpeg.org/releases/ffmpeg-9.0.2.tar.xz" +patches = [ + "redox.patch" +] + +[build] +template = "custom" +dependencies = [ + "liborbital", + "mesa", + "sdl2", + "zlib", +] +dev-dependencies = [ + "libstdcxx" +] +compiler = "gcc-no-lto" +script = """ +DYNAMIC_INIT + +export LDFLAGS="$LDFLAGS -lSDL2 -lorbital -lOSMesa" +ARCH="${TARGET%%-*}" +COOKBOOK_CONFIGURE_FLAGS=( + --enable-cross-compile + --target-os=redox + --arch="${ARCH}" + --cross_prefix="${TARGET}-" + --prefix=/usr + --disable-doc + --enable-shared + --disable-static + --disable-network + --enable-sdl2 + --enable-zlib + --enable-pic + --enable-encoder=png + --enable-decoder=png +) +cookbook_configure +mkdir -pv "${COOKBOOK_STAGE}/usr/share/ui/apps" +cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/usr/share/ui/apps/ffplay" +""" diff --git a/recipes/wip/libs/media/ffmpeg9/redox.patch b/recipes/wip/libs/media/ffmpeg9/redox.patch new file mode 100644 index 000000000..a1b7d5226 --- /dev/null +++ b/recipes/wip/libs/media/ffmpeg9/redox.patch @@ -0,0 +1,13 @@ +diff -ruwN source/configure source-new/configure +--- source/configure 2026-08-03 22:14:47.000000000 +0000 ++++ source-new/configure 2026-11-02 10:38:23.591367435 +0000 +@@ -6377,6 +6377,9 @@ + ;; + minix) + ;; ++ redox) ++ enable section_data_rel_ro ++ ;; + none) + ;; + *)