Merge branch 'staging-21.05' into release-21.05

ffmpeg isn't such a huge rebuild, so let's do this directly.
This commit is contained in:
Vladimír Čunát 2021-08-21 09:38:25 +02:00
commit 219a77ea26
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
4 changed files with 44 additions and 6 deletions

View File

@ -243,7 +243,7 @@ assert opensslExtlib -> gnutls == null && openssl != null && nonfreeLicensing;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ffmpeg-full"; pname = "ffmpeg-full";
inherit (ffmpeg) src version; inherit (ffmpeg) src version patches;
prePatch = '' prePatch = ''
patchShebangs . patchShebangs .
@ -443,6 +443,14 @@ stdenv.mkDerivation rec {
buildFlags = [ "all" ] buildFlags = [ "all" ]
++ optional qtFaststartProgram "tools/qt-faststart"; # Build qt-faststart executable ++ optional qtFaststartProgram "tools/qt-faststart"; # Build qt-faststart executable
doCheck = true;
checkPhase = let
ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in ''
${ldLibraryPathEnv}="libavcodec:libavdevice:libavfilter:libavformat:libavresample:libavutil:libpostproc:libswresample:libswscale:''${${ldLibraryPathEnv}}" \
make check -j$NIX_BUILD_CORES
'';
# Hacky framework patching technique borrowed from the phantomjs2 package # Hacky framework patching technique borrowed from the phantomjs2 package
postInstall = optionalString qtFaststartProgram '' postInstall = optionalString qtFaststartProgram ''
cp -a tools/qt-faststart $out/bin/ cp -a tools/qt-faststart $out/bin/

View File

@ -7,4 +7,5 @@ callPackage ./generic.nix (rec {
knownVulnerabilities = [ knownVulnerabilities = [
"CVE-2021-30123" "CVE-2021-30123"
]; ];
doCheck = false;
} // args) } // args)

View File

@ -2,6 +2,7 @@
# Darwin frameworks # Darwin frameworks
, Cocoa, CoreMedia, VideoToolbox , Cocoa, CoreMedia, VideoToolbox
, stdenv, lib , stdenv, lib
, fetchpatch
, ... , ...
}@args: }@args:
@ -11,7 +12,28 @@ callPackage ./generic.nix (rec {
sha256 = "03kxc29y8190k4y8s8qdpsghlbpmchv1m8iqygq2qn0vfm4ka2a2"; sha256 = "03kxc29y8190k4y8s8qdpsghlbpmchv1m8iqygq2qn0vfm4ka2a2";
darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ]; darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ];
/* Work around https://trac.ffmpeg.org/ticket/9242 */ patches = [
patches = lib.optional stdenv.isDarwin (fetchpatch {
./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch; name = "CVE-2021-33815.patch";
url = "https://github.com/FFmpeg/FFmpeg/commit/26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777.patch";
sha256 = "0l8dqga5845f7d3wdbvd05i23saldq4pm2cyfdgszbr0c18sxagf";
})
(fetchpatch {
name = "CVE-2021-38114.patch";
url = "https://github.com/FFmpeg/FFmpeg/commit/7150f9575671f898382c370acae35f9087a30ba1.patch";
sha256 = "0gwkc7v1wsh4j0am2nnskhsca1b5aqzhcfd41sd9mh2swsdyf27i";
})
# Fix incorrect segment length in HLS child playlist with fmp4 segment format
# FIXME remove in version 4.5
# https://trac.ffmpeg.org/ticket/9193
# https://trac.ffmpeg.org/ticket/9205
(fetchpatch {
name = "ffmpeg_fix_incorrect_segment_length_in_hls.patch";
url = "https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=59032494e81a1a65c0b960aaae7ec4c2cc9db35a";
sha256 = "03zz1lw51kkc3g3vh47xa5hfiz3g3g1rbrll3kcnslvwylmrqmy3";
})
] ++ lib.optionals stdenv.isDarwin [
# Work around https://trac.ffmpeg.org/ticket/9242
./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch
];
} // args) } // args)

View File

@ -17,7 +17,8 @@
# Darwin frameworks # Darwin frameworks
, Cocoa, darwinFrameworks ? [ Cocoa ] , Cocoa, darwinFrameworks ? [ Cocoa ]
# Inherit generics # Inherit generics
, branch, sha256, version, patches ? [], knownVulnerabilities ? [], ... , branch, sha256, version, patches ? [], knownVulnerabilities ? []
, doCheck ? true, ...
}: }:
/* Maintainer notes: /* Maintainer notes:
@ -187,7 +188,13 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = false; # fails inherit doCheck;
checkPhase = let
ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in ''
${ldLibraryPathEnv}="libavcodec:libavdevice:libavfilter:libavformat:libavresample:libavutil:libpostproc:libswresample:libswscale:''${${ldLibraryPathEnv}}" \
make check -j$NIX_BUILD_CORES
'';
# ffmpeg 3+ generates pkg-config (.pc) files that don't have the # ffmpeg 3+ generates pkg-config (.pc) files that don't have the
# form automatically handled by the multiple-outputs hooks. # form automatically handled by the multiple-outputs hooks.