lol

ffmpeg: Add `meta.pkgConfigModules` and test

+11 -4
+11 -4
pkgs/development/libraries/ffmpeg/generic.nix
··· 266 266 , MediaToolbox 267 267 , VideoDecodeAcceleration 268 268 , VideoToolbox 269 + /* 270 + * Testing 271 + */ 272 + , testers 269 273 }: 270 274 271 275 /* Maintainer notes: ··· 321 325 assert buildPostproc -> buildAvutil; 322 326 assert buildSwscale -> buildAvutil; 323 327 324 - stdenv.mkDerivation rec { 328 + stdenv.mkDerivation (finalAttrs: { 325 329 pname = "ffmpeg" + (if ffmpegVariant == "small" then "" else "-${ffmpegVariant}"); 326 330 inherit version; 327 331 328 332 src = fetchgit { 329 333 url = "https://git.ffmpeg.org/ffmpeg.git"; 330 - rev = "n${version}"; 334 + rev = "n${finalAttrs.version}"; 331 335 inherit sha256; 332 336 }; 333 337 ··· 522 526 # outputs where we don't want them. Patch the generated config.h to remove all 523 527 # such references except for data. 524 528 postConfigure = let 525 - toStrip = lib.remove "data" outputs; # We want to keep references to the data dir. 529 + toStrip = lib.remove "data" finalAttrs.outputs; # We want to keep references to the data dir. 526 530 in 527 531 "remove-references-to ${lib.concatStringsSep " " (map (o: "-t ${placeholder o}") toStrip)} config.h"; 528 532 ··· 656 660 657 661 enableParallelBuilding = true; 658 662 663 + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 664 + 659 665 meta = with lib; { 660 666 description = "A complete, cross-platform solution to record, convert and stream audio and video"; 661 667 homepage = "https://www.ffmpeg.org/"; ··· 671 677 ++ optional withGPL gpl2Plus 672 678 ++ optional withGPLv3 gpl3Plus 673 679 ++ optional withUnfree unfreeRedistributable; 680 + pkgConfigModules = [ "libavutil" ]; 674 681 platforms = platforms.all; 675 682 maintainers = with maintainers; [ atemu ]; 676 683 }; 677 - } 684 + })