From 6126dc086254536bf6487dca3c47422eebcfe37f Mon Sep 17 00:00:00 2001 From: Greisberger Christophe Date: Tue, 2 Jun 2026 10:50:12 +0200 Subject: [PATCH] [ffmpeg] add twolame feature option (#52125) --- ports/ffmpeg/0049-fix-twolame-pkgconfig.patch | 15 +++++++++++++++ ports/ffmpeg/portfile.cmake | 9 +++++++++ ports/ffmpeg/vcpkg.json | 9 ++++++++- versions/baseline.json | 2 +- versions/f-/ffmpeg.json | 5 +++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 ports/ffmpeg/0049-fix-twolame-pkgconfig.patch diff --git a/ports/ffmpeg/0049-fix-twolame-pkgconfig.patch b/ports/ffmpeg/0049-fix-twolame-pkgconfig.patch new file mode 100644 index 0000000000..20e0098ed4 --- /dev/null +++ b/ports/ffmpeg/0049-fix-twolame-pkgconfig.patch @@ -0,0 +1,15 @@ +diff --git a/configure b/configure +index 6d66d1e..3a54b6c 100644 +--- a/configure ++++ b/configure +@@ -7384,8 +7384,8 @@ enabled libtheora && require libtheora theora/theoraenc.h th_info_init - + enabled libtls && require_pkg_config libtls libtls tls.h tls_configure && + { enabled gpl && ! enabled nonfree && die "ERROR: LibreSSL is incompatible with the gpl"; } + enabled libtorch && check_cxxflags -std=c++17 && require_cxx libtorch torch/torch.h "torch::Tensor" -ltorch -lc10 -ltorch_cpu -lstdc++ -lpthread +-enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && +- { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || ++enabled libtwolame && require_pkg_config libtwolame twolame twolame.h twolame_init && ++ { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved $libtwolame_extralibs || + die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } + enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode + enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 6835d95c0c..c8773ca214 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_from_github( 0046-fix-msvc-detection.patch 0047-fix-msvc-utf8.patch 0048-backport-23039.patch + 0049-fix-twolame-pkgconfig.patch ) if(SOURCE_PATH MATCHES " ") @@ -499,6 +500,14 @@ else() set(WITH_THEORA OFF) endif() +if("twolame" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libtwolame") + set(WITH_TWOLAME ON) +else() + set(OPTIONS "${OPTIONS} --disable-libtwolame") + set(WITH_TWOLAME OFF) +endif() + if("vorbis" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libvorbis") set(WITH_VORBIS ON) diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json index caebcf4e78..0c05347cd8 100644 --- a/ports/ffmpeg/vcpkg.json +++ b/ports/ffmpeg/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ffmpeg", "version": "8.1.1", - "port-version": 1, + "port-version": 2, "description": [ "A library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.", "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations." @@ -64,6 +64,7 @@ "swresample", "swscale", "theora", + "twolame", "vorbis", "vpx", "vulkan", @@ -652,6 +653,12 @@ "libtheora" ] }, + "twolame": { + "description": "MP2 encoding via libtwolame", + "dependencies": [ + "libtwolame" + ] + }, "vaapi": { "description": "VAAPI video decoding/encoding acceleration", "supports": "linux", diff --git a/versions/baseline.json b/versions/baseline.json index 64eba459ce..ca4e813acf 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3030,7 +3030,7 @@ }, "ffmpeg": { "baseline": "8.1.1", - "port-version": 1 + "port-version": 2 }, "ffmpeg-bin2c": { "baseline": "8.1.1", diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json index 8cf0aa9638..811d615b6e 100644 --- a/versions/f-/ffmpeg.json +++ b/versions/f-/ffmpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3eec7480c1d2f5b777715b974c2935e5a57b06df", + "version": "8.1.1", + "port-version": 2 + }, { "git-tree": "87b34997b862634271df57cd4657ed0c6dcf4985", "version": "8.1.1",