From 451fee8fd76a9d02c16e7224cca5fffd4f8cc2b0 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Tue, 1 Mar 2022 19:50:19 +1100 Subject: [PATCH] Ports: Upgrade to FFmpeg 5.0 release; enable SDL and networking --- Ports/AvailablePorts.md | 2 +- Ports/ffmpeg/package.sh | 14 ++++++++------ Ports/ffmpeg/patches/ReadMe.md | 9 +++++++++ .../patches/errno-is-not-valid-during-cpp.patch | 13 +++++++++++++ 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 Ports/ffmpeg/patches/ReadMe.md create mode 100644 Ports/ffmpeg/patches/errno-is-not-valid-during-cpp.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index c1f31c486be..dc8ee59b51f 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -44,7 +44,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`flex`](flex/) | flex | 2.6.4 | https://github.com/westes/flex | | [`fotaq`](fotaq/) | Flight of the Amazon Queen | 1.0 | https://www.scummvm.org/games/#games-queen | | [`fontconfig`](fontconfig/) | Fontconfig | 2.13.94 | https://www.freedesktop.org/wiki/Software/fontconfig/ | -| [`ffmpeg`](ffmpeg/) | ffmpeg | 4.4 | https://ffmpeg.org | +| [`ffmpeg`](ffmpeg/) | ffmpeg | 5.0 | https://ffmpeg.org | | [`freeciv`](freeciv/) | Freeciv | 3.0.0-beta2 | http://freeciv.org/ | | [`freedink`](freedink/) | FreeDink | 109.6 | https://www.gnu.org/software/freedink/ | | [`freetype`](freetype/) | FreeType | 2.10.4 | https://www.freetype.org/ | diff --git a/Ports/ffmpeg/package.sh b/Ports/ffmpeg/package.sh index 11b5d612309..d7db997bc14 100755 --- a/Ports/ffmpeg/package.sh +++ b/Ports/ffmpeg/package.sh @@ -1,20 +1,22 @@ #!/usr/bin/env -S bash ../.port_include.sh port=ffmpeg -version=4.4 +version=5.0 useconfigure=true -depends=("libiconv" "libtiff" "xz" "bzip2") -files="https://ffmpeg.org/releases/ffmpeg-${version}.tar.gz ffmpeg-${version}.tar.gz a4abede145de22eaf233baa1726e38e137f5698d9edd61b5763cd02b883f3c7c" +depends=("libiconv" "libtiff" "xz" "bzip2" "SDL2") +files="https://ffmpeg.org/releases/ffmpeg-${version}.tar.gz ffmpeg-${version}.tar.gz 7bf52bc242b5db8df67c62cb826df134d917dedcf6abf1289e15e4057bcc1750" auth_type="sha256" installopts=("INSTALL_TOP=${SERENITY_INSTALL_ROOT}/usr/local") configopts=("SRC_PATH=.") configure() { run ./configure \ - --arch="x86_32" \ + --target-os=none \ + --arch="${SERENITY_ARCH}" \ --cc="${CC} -std=gnu99" \ --cxx="${CXX} -std=gnu99" \ - --disable-network \ - --enable-cross-compile + --enable-cross-compile \ + --disable-stripping \ + --disable-avx } install() { diff --git a/Ports/ffmpeg/patches/ReadMe.md b/Ports/ffmpeg/patches/ReadMe.md new file mode 100644 index 00000000000..986ba7920ae --- /dev/null +++ b/Ports/ffmpeg/patches/ReadMe.md @@ -0,0 +1,9 @@ +# Patches for FFmpeg on SerenityOS + +## `errno-is-not-valid-during-cpp.patch` + +FFmpeg performs a preprocessor-time test on errno values. This test does +not work on SerenityOS because our errno values are described by an +enum, and therefore are only available at compile time. + +The patch removes the preprocessor-time test. diff --git a/Ports/ffmpeg/patches/errno-is-not-valid-during-cpp.patch b/Ports/ffmpeg/patches/errno-is-not-valid-during-cpp.patch new file mode 100644 index 00000000000..b66b2735b15 --- /dev/null +++ b/Ports/ffmpeg/patches/errno-is-not-valid-during-cpp.patch @@ -0,0 +1,13 @@ +diff --git a/libavutil/error.h b/libavutil/error.h +index 0d3269a..a54d80d 100644 +--- a/libavutil/error.h ++++ b/libavutil/error.h +@@ -37,7 +37,7 @@ + + + /* error handling */ +-#if EDOM > 0 ++#if 1 + #define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions. + #define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value. + #else