diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 64172a9f1b..5b3ff11e27 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -70,7 +70,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`emu2`](emu2/) | emu2 DOS emulator | 2021.01 | https://github.com/dmsc/emu2 | | [`epsilon`](epsilon/) | graphical calculator simulator | 15.5.0 | https://github.com/numworks/epsilon | | [`expat`](expat/) | Expat XML parser | 2.5.0 | https://libexpat.github.io/ | -| [`ffmpeg`](ffmpeg/) | ffmpeg | 5.0 | https://ffmpeg.org | +| [`ffmpeg`](ffmpeg/) | ffmpeg | 6.0 | https://ffmpeg.org | | [`figlet`](figlet/) | FIGlet | 2.2.5 | http://www.figlet.org/ | | [`file`](file/) | file (determine file type) | 5.44 | https://www.darwinsys.com/file/ | | [`findutils`](findutils/) | GNU findutils | 4.9.0 | https://www.gnu.org/software/findutils/ | diff --git a/Ports/ffmpeg/package.sh b/Ports/ffmpeg/package.sh index 21e58bb624..15f2140209 100755 --- a/Ports/ffmpeg/package.sh +++ b/Ports/ffmpeg/package.sh @@ -1,13 +1,22 @@ #!/usr/bin/env -S bash ../.port_include.sh -port=ffmpeg -version=5.0 -useconfigure=true -depends=("libiconv" "libtiff" "xz" "bzip2" "SDL2" "x264" "x265") -files=( - "https://ffmpeg.org/releases/ffmpeg-${version}.tar.gz#7bf52bc242b5db8df67c62cb826df134d917dedcf6abf1289e15e4057bcc1750" +port='ffmpeg' +version='6.0' +useconfigure='true' +depends=( + 'bzip2' + 'libiconv' + 'libtiff' + 'SDL2' + 'x264' + 'x265' + 'xz' +) +files=( + "https://ffmpeg.org/releases/ffmpeg-${version}.tar.gz#f4ccf961403752c93961927715f524576d1f4dd02cd76d8c76aed3bbe6686656" +) +installopts=( + "INSTALL_TOP=${SERENITY_INSTALL_ROOT}/usr/local" ) -installopts=("INSTALL_TOP=${SERENITY_INSTALL_ROOT}/usr/local") -configopts=("SRC_PATH=.") configure() { run ./configure \ diff --git a/Ports/ffmpeg/patches/0001-Assume-that-EDOM-exists.patch b/Ports/ffmpeg/patches/0001-Assume-that-EDOM-exists.patch index cd2df80471..4deef61721 100644 --- a/Ports/ffmpeg/patches/0001-Assume-that-EDOM-exists.patch +++ b/Ports/ffmpeg/patches/0001-Assume-that-EDOM-exists.patch @@ -10,7 +10,7 @@ work in cpp, assume that it exists. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/error.h b/libavutil/error.h -index 0d3269a..a54d80d 100644 +index 0d3269aa6da136e849faa7f810ae36748659a2e0..a54d80d0f2d7be91e617cb0ed0640568bffdd693 100644 --- a/libavutil/error.h +++ b/libavutil/error.h @@ -37,7 +37,7 @@ diff --git a/Ports/ffmpeg/patches/0002-Adapt-to-the-Serenity-thread-name-interface.patch b/Ports/ffmpeg/patches/0002-Adapt-to-the-Serenity-thread-name-interface.patch new file mode 100644 index 0000000000..3114c4de46 --- /dev/null +++ b/Ports/ffmpeg/patches/0002-Adapt-to-the-Serenity-thread-name-interface.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tim Schumacher +Date: Mon, 2 Oct 2023 01:17:46 +0200 +Subject: [PATCH] Adapt to the Serenity thread name interface + +--- + libavutil/thread.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/libavutil/thread.h b/libavutil/thread.h +index 2f5e7e1cb552fd12f954334e80960cbfb6ac7108..264d6ae646dc78e0f21b58445a412487e055ebc5 100644 +--- a/libavutil/thread.h ++++ b/libavutil/thread.h +@@ -26,6 +26,8 @@ + + #if HAVE_PRCTL + #include ++#include ++#include + #endif + + #include "error.h" +@@ -195,7 +197,7 @@ static inline int ff_thread_once(char *control, void (*routine)(void)) + static inline int ff_thread_setname(const char *name) + { + #if HAVE_PRCTL +- return AVERROR(prctl(PR_SET_NAME, name)); ++ return AVERROR(prctl(PR_SET_THREAD_NAME, gettid(), name, strlen(name))); + #endif + + return AVERROR(ENOSYS); diff --git a/Ports/ffmpeg/patches/0003-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch b/Ports/ffmpeg/patches/0003-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch new file mode 100644 index 0000000000..bf1674dc49 --- /dev/null +++ b/Ports/ffmpeg/patches/0003-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?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 6298f5ed1983b84205479d1a714bd657435789f9..ca7e2dffc1076f82d2cabf55eae0681adbdcfb96 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; + } + diff --git a/Ports/ffmpeg/patches/ReadMe.md b/Ports/ffmpeg/patches/ReadMe.md index 235a7251f2..3ca8c27900 100644 --- a/Ports/ffmpeg/patches/ReadMe.md +++ b/Ports/ffmpeg/patches/ReadMe.md @@ -7,3 +7,16 @@ Assume that EDOM exists Since errno values are not numeric constants on serenity, this won't work in cpp, assume that it exists. +## `0002-Adapt-to-the-Serenity-thread-name-interface.patch` + +Adapt to the Serenity thread name interface + + +## `0003-avcodec-x86-mathops-clip-constants-used-with-shift-i.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 +