From 4567be8aa5a29e4489e601326820d0ae4b1a16cb Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 25 Jan 2024 14:01:53 +0300 Subject: [PATCH] ffmpeg: always use version from finalAttrs In case of overrides and such --- pkgs/development/libraries/ffmpeg/generic.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 12347318696c..0f5d88984566 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -350,14 +350,14 @@ stdenv.mkDerivation (finalAttrs: { ''; patches = map (patch: fetchpatch patch) (extraPatches - ++ (lib.optional (lib.versionAtLeast version "6" && lib.versionOlder version "6.1") + ++ (lib.optional (lib.versionAtLeast finalAttrs.version "6" && lib.versionOlder finalAttrs.version "6.1") { # this can be removed post 6.1 name = "fix_aacps_tablegen"; url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/814178f92647be2411516bbb82f48532373d2554"; hash = "sha256-FQV9/PiarPXCm45ldtCsxGHjlrriL8DKpn1LaKJ8owI="; } ) - ++ (lib.optional (lib.versionAtLeast version "6.1" && lib.versionOlder version "6.2") + ++ (lib.optional (lib.versionAtLeast finalAttrs.version "6.1" && lib.versionOlder finalAttrs.version "6.2") { # 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"; @@ -417,7 +417,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature buildAvdevice "avdevice") (enableFeature buildAvfilter "avfilter") (enableFeature buildAvformat "avformat") - ] ++ optionals (lib.versionOlder version "5") [ + ] ++ optionals (lib.versionOlder finalAttrs.version "5") [ # Ffmpeg > 4 doesn't know about the flag anymore (enableFeature buildAvresample "avresample") ] ++ [ @@ -477,7 +477,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withModplug "libmodplug") (enableFeature withMysofa "libmysofa") (enableFeature withOpus "libopus") - (optionalString (versionAtLeast version "5.0" && withLibplacebo) "--enable-libplacebo") + (optionalString (versionAtLeast finalAttrs.version "5.0" && withLibplacebo) "--enable-libplacebo") (enableFeature withSvg "librsvg") (enableFeature withSrt "libsrt") (enableFeature withSsh "libssh") @@ -525,7 +525,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withZimg "libzimg") (enableFeature withZlib "zlib") (enableFeature withVulkan "vulkan") - (optionalString (lib.versionAtLeast version "5") (enableFeature withShaderc "libshaderc")) + (optionalString (lib.versionAtLeast finalAttrs.version "5") (enableFeature withShaderc "libshaderc")) (enableFeature withSamba "libsmbclient") /* * Developer flags @@ -561,7 +561,7 @@ stdenv.mkDerivation (finalAttrs: { # TODO This was always in buildInputs before, why? buildInputs = optionals withFullDeps [ libdc1394 ] ++ optionals (withFullDeps && !stdenv.isDarwin) [ libraw1394 ] # TODO where does this belong to - ++ optionals (withNvdec || withNvenc) [ (if (lib.versionAtLeast version "6") then nv-codec-headers-12 else nv-codec-headers) ] + ++ optionals (withNvdec || withNvenc) [ (if (lib.versionAtLeast finalAttrs.version "6") then nv-codec-headers-12 else nv-codec-headers) ] ++ optionals withAlsa [ alsa-lib ] ++ optionals withAom [ libaom ] ++ optionals withAribcaption [ libaribcaption ] @@ -584,7 +584,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withIconv [ libiconv ] # On Linux this should be in libc, do we really need it? ++ optionals withJack [ libjack2 ] ++ optionals withLadspa [ ladspaH ] - ++ optionals withLibplacebo [ (if (lib.versionAtLeast version "6.1") then libplacebo else libplacebo_5) vulkan-headers ] + ++ optionals withLibplacebo [ (if (lib.versionAtLeast finalAttrs.version "6.1") then libplacebo else libplacebo_5) vulkan-headers ] ++ optionals withLzma [ xz ] ++ optionals withMfx [ intel-media-sdk ] ++ optionals withModplug [ libmodplug ] @@ -693,7 +693,7 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "A complete, cross-platform solution to record, convert and stream audio and video"; homepage = "https://www.ffmpeg.org/"; - changelog = "https://github.com/FFmpeg/FFmpeg/blob/n${version}/Changelog"; + changelog = "https://github.com/FFmpeg/FFmpeg/blob/n${finalAttrs.version}/Changelog"; longDescription = '' FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines