opencv: support building with ffmpeg 8 (#456828)

This commit is contained in:
Atemu
2025-11-08 15:23:12 +00:00
committed by GitHub
2 changed files with 17 additions and 6 deletions
+4 -4
View File
@@ -6,7 +6,7 @@
cmake,
pkg-config,
which,
ffmpeg_7,
ffmpeg,
fftw,
frei0r,
libdv,
@@ -71,8 +71,8 @@ stdenv.mkDerivation rec {
];
buildInputs = [
(opencv4.override { inherit ffmpeg_7; })
ffmpeg_7
(opencv4.override { inherit ffmpeg; })
ffmpeg
fftw
frei0r
libdv
@@ -137,7 +137,7 @@ stdenv.mkDerivation rec {
'';
passthru = {
ffmpeg = ffmpeg_7;
inherit ffmpeg;
};
passthru.updateScript = gitUpdater {
+13 -2
View File
@@ -3,6 +3,7 @@
stdenv,
fetchurl,
fetchFromGitHub,
fetchpatch,
cmake,
pkg-config,
unzip,
@@ -58,7 +59,7 @@
enableVtk ? false,
vtk,
enableFfmpeg ? true,
ffmpeg_7,
ffmpeg,
enableGStreamer ? true,
elfutils,
gst_all_1,
@@ -299,6 +300,16 @@ effectiveStdenv.mkDerivation {
patches = [
./cmake-don-t-use-OpenCVFindOpenEXR.patch
./0001-cmake-OpenCVUtils.cmake-invalidate-Nix-store-paths-b.patch
(fetchpatch {
name = "ffmpeg-8-support.patch";
url = "https://github.com/opencv/opencv/commit/90c444abd387ffa70b2e72a34922903a2f0f4f5a.patch";
hash = "sha256-iRRparDJoNhrvELH6cAagWcVzpiE2lfivHVxvZyi3ik=";
})
(fetchpatch {
name = "fix-ffmpeg-8-support.patch";
url = "https://github.com/opencv/opencv/commit/dbb622b7f59c3f0e5bd3487252ef37cf72dcdcdb.patch";
hash = "sha256-MS9WizZQu0Gxw/daDDFmETxcDJYRTyhSq/xK0X5lAZM=";
})
]
++ optionals enableCuda [
./cuda_opt_flow.patch
@@ -365,7 +376,7 @@ effectiveStdenv.mkDerivation {
openjpeg
]
++ optionals enableFfmpeg [
ffmpeg_7
ffmpeg
]
++ optionals (enableGStreamer && effectiveStdenv.hostPlatform.isLinux) [
elfutils