ffmpeg: refactor mapped fetchpatch2 application

this prevents us from easily including non-fetchpatch'ed
patches
This commit is contained in:
Robert Scott
2024-06-10 22:18:07 +01:00
parent 407d11d76b
commit 53ca42587f
+31 -31
View File
@@ -395,22 +395,22 @@ stdenv.mkDerivation (finalAttrs: {
--replace /usr/local/lib/frei0r-1 ${frei0r}/lib/frei0r-1
'';
patches = map (patch: fetchpatch2 patch) ([ ]
patches = []
++ optionals (versionOlder version "5") [
{
(fetchpatch2 {
name = "libsvtav1-1.5.0-compat-compressed_ten_bit_format.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/031f1561cd286596cdb374da32f8aa816ce3b135";
hash = "sha256-agJgzIzrBTQBAypuCmGXXFo7vw6Iodw5Ny5O5QCKCn8=";
}
{
})
(fetchpatch2 {
# Backport fix for binutils-2.41.
name = "binutils-2.41.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/effadce6c756247ea8bae32dc13bb3e6f464f0eb";
hash = "sha256-vLSltvZVMcQ0CnkU0A29x6fJSywE8/aU+Mp9os8DZYY=";
}
})
# The upstream patch isnt for ffmpeg 4, but it will apply with a few tweaks.
# Fixes a crash when built with clang 16 due to UB in ff_seek_frame_binary.
{
(fetchpatch2 {
name = "utils-fix_crash_in_ff_seek_frame_binary.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/ab792634197e364ca1bb194f9abe36836e42f12d";
hash = "sha256-vqqVACjbCcGL9Qvmg1QArSKqVmOqr8BEr+OxTBDt6mA=";
@@ -419,60 +419,60 @@ stdenv.mkDerivation (finalAttrs: {
--replace libavformat/seek.c libavformat/utils.c \
--replace 'const AVInputFormat *const ' 'const AVInputFormat *'
'';
}
})
]
++ (lib.optionals (lib.versionAtLeast version "5" && lib.versionOlder version "6") [
{
++ optionals (lib.versionAtLeast version "5" && lib.versionOlder version "6") [
(fetchpatch2 {
name = "fix_build_failure_due_to_libjxl_version_to_new";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/75b1a555a70c178a9166629e43ec2f6250219eb2";
hash = "sha256-+2kzfPJf5piim+DqEgDuVEEX5HLwRsxq0dWONJ4ACrU=";
}
{
})
(fetchpatch2 {
name = "5.x-CVE-2024-31585.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/8711cea3841fc385cccb1e7255176479e865cd4d";
hash = "sha256-WT+ly/l04yM/tRVbhkESA3sDDjwvtd/Cg2y8tQo4ApI=";
}
{
})
(fetchpatch2 {
name = "CVE-2024-31582.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/99debe5f823f45a482e1dc08de35879aa9c74bd2";
hash = "sha256-+CQ9FXR6Vr/AmsbXFiCUXZcxKj1s8nInEdke/Oc/kUA=";
}
{
})
(fetchpatch2 {
name = "CVE-2024-31578.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/3bb00c0a420c3ce83c6fafee30270d69622ccad7";
hash = "sha256-oZMZysBA+/gwaGEM1yvI+8wCadXWE7qLRL6Emap3b8Q=";
}
])
++ (lib.optionals (lib.versionAtLeast version "6.1" && lib.versionOlder version "6.2") [
{ # this can be removed post 6.1
})
]
++ optionals (lib.versionAtLeast version "6.1" && lib.versionOlder version "6.2") [
(fetchpatch2 { # this can be removed post 6.1
name = "fix_build_failure_due_to_PropertyKey_EncoderID";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/cb049d377f54f6b747667a93e4b719380c3e9475";
hash = "sha256-sxRXKKgUak5vsQTiV7ge8vp+N22CdTIvuczNgVRP72c=";
}
{
})
(fetchpatch2 {
name = "fix_vulkan_av1";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/e06ce6d2b45edac4a2df04f304e18d4727417d24";
hash = "sha256-73mlX1rdJrguw7OXaSItfHtI7gflDrFj+7SepVvvUIg=";
}
{
})
(fetchpatch2 {
name = "CVE-2024-31582.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/99debe5f823f45a482e1dc08de35879aa9c74bd2";
hash = "sha256-+CQ9FXR6Vr/AmsbXFiCUXZcxKj1s8nInEdke/Oc/kUA=";
}
{
})
(fetchpatch2 {
name = "CVE-2024-31578.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/3bb00c0a420c3ce83c6fafee30270d69622ccad7";
hash = "sha256-oZMZysBA+/gwaGEM1yvI+8wCadXWE7qLRL6Emap3b8Q=";
}
])
++ (lib.optionals (lib.versionAtLeast version "7.0" && lib.versionOlder version "7.0.1") [
{
})
]
++ optionals (lib.versionAtLeast version "7.0" && lib.versionOlder version "7.0.1") [
(fetchpatch2 {
# Will likely be obsolete in >7.0
name = "fate_avoid_dependency_on_samples";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/7b7b7819bd21cc92ac07f6696b0e7f26fa8f9834";
hash = "sha256-TKI289XqtG86Sj9s7mVYvmkjAuRXeK+2cYYEDkg6u6I=";
}
]));
})
];
configurePlatforms = [];
setOutputFlags = false; # Only accepts some of them