diff --git a/games/fs2open/Makefile b/games/fs2open/Makefile index 42b562c71f42..723f6532d838 100644 --- a/games/fs2open/Makefile +++ b/games/fs2open/Makefile @@ -1,36 +1,39 @@ PORTNAME= fs2open DISTVERSIONPREFIX= release_ DISTVERSION= 24_2_0 CATEGORIES= games MAINTAINER= pkubaj@FreeBSD.org COMMENT= Open source video engine of FreeSpace 2 WWW= http://scp.indiegames.us +# fix build with recent ffmpeg +EXTRA_PATCHES= ${FILESDIR}/af833f059cc0cfc925792e019f6c2b754c6d53c1.patch:-p1 + LICENSE= VOLITION LICENSE_NAME= Volition Copyright LICENSE_FILE= ${WRKSRC}/Copying.md LICENSE_PERMS= dist-mirror auto-accept LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \ libjansson.so:devel/jansson \ libpng.so:graphics/png \ libfreetype.so:print/freetype2 USES= cmake compiler:c++11-lib lua:51 jpeg openal pkgconfig sdl USE_GITHUB= yes GH_ACCOUNT= scp-fs2open GH_PROJECT= fs2open.github.com GH_TUPLE= asarium:cmake-modules:7cef957:cmakemodules/cmake/external/rpavlik-cmake-modules \ asarium:libRocket:ae8a8d9:libRocket/lib/libRocket USE_SDL= sdl2 LDFLAGS_i386= -Wl,-znotext PLIST_FILES= bin/fs2_open do-install: ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/bin/fs2_open \ ${STAGEDIR}${PREFIX}/bin .include diff --git a/games/fs2open/files/af833f059cc0cfc925792e019f6c2b754c6d53c1.patch b/games/fs2open/files/af833f059cc0cfc925792e019f6c2b754c6d53c1.patch new file mode 100644 index 000000000000..2c456bb22a5f --- /dev/null +++ b/games/fs2open/files/af833f059cc0cfc925792e019f6c2b754c6d53c1.patch @@ -0,0 +1,66 @@ +From af833f059cc0cfc925792e019f6c2b754c6d53c1 Mon Sep 17 00:00:00 2001 +From: Taylor Richards +Date: Sun, 17 Aug 2025 17:09:41 -0400 +Subject: [PATCH] fix avcodec deprecation warnings + +--- + code/cutscene/ffmpeg/internal.cpp | 9 ++++++--- + code/sound/ffmpeg/FFmpegWaveFile.cpp | 3 ++- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/code/cutscene/ffmpeg/internal.cpp b/code/cutscene/ffmpeg/internal.cpp +index be0920a5068..4f087d10191 100644 +--- a/code/cutscene/ffmpeg/internal.cpp ++++ b/code/cutscene/ffmpeg/internal.cpp +@@ -12,9 +12,10 @@ DecoderStatus::~DecoderStatus() { + videoCodec = nullptr; + + if (videoCodecCtx != nullptr) { +- avcodec_close(videoCodecCtx); + #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255) + avcodec_free_context(&videoCodecCtx); ++#else ++ avcodec_close(videoCodecCtx); + #endif + videoCodecCtx = nullptr; + } +@@ -24,9 +25,10 @@ DecoderStatus::~DecoderStatus() { + audioCodec = nullptr; + + if (audioCodecCtx != nullptr) { +- avcodec_close(audioCodecCtx); + #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255) + avcodec_free_context(&audioCodecCtx); ++#else ++ avcodec_close(audioCodecCtx); + #endif + audioCodecCtx = nullptr; + } +@@ -36,9 +38,10 @@ DecoderStatus::~DecoderStatus() { + subtitleCodec = nullptr; + + if (subtitleCodecCtx != nullptr) { +- avcodec_close(subtitleCodecCtx); + #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255) + avcodec_free_context(&subtitleCodecCtx); ++#else ++ avcodec_close(subtitleCodecCtx); + #endif + subtitleCodecCtx = nullptr; + } +diff --git a/code/sound/ffmpeg/FFmpegWaveFile.cpp b/code/sound/ffmpeg/FFmpegWaveFile.cpp +index ab1e0ddc520..77541d7b826 100644 +--- a/code/sound/ffmpeg/FFmpegWaveFile.cpp ++++ b/code/sound/ffmpeg/FFmpegWaveFile.cpp +@@ -151,9 +151,10 @@ FFmpegWaveFile::~FFmpegWaveFile() + av_frame_free(&m_decodeFrame); + + if (m_audioCodecCtx) { +- avcodec_close(m_audioCodecCtx); + #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255) + avcodec_free_context(&m_audioCodecCtx); ++#else ++ avcodec_close(m_audioCodecCtx); + #endif + m_audioCodecCtx = nullptr; + }