From b72bcc3aa55a2945028fbf0b8108e931cc6ac328 Mon Sep 17 00:00:00 2001 From: Benjamin Sparks Date: Tue, 22 Jul 2025 12:10:59 +0200 Subject: [PATCH] python3Packages.ffmpy: refactor Prefer lib.getExe over hardcoding the ffmpeg binary path, Move comments out of patches --- pkgs/development/python-modules/ffmpy/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/ffmpy/default.nix b/pkgs/development/python-modules/ffmpy/default.nix index c5c0a27be5be..884899fc994e 100644 --- a/pkgs/development/python-modules/ffmpy/default.nix +++ b/pkgs/development/python-modules/ffmpy/default.nix @@ -25,14 +25,15 @@ buildPythonPackage rec { }; postPatch = + # Default to store ffmpeg. '' - # default to store ffmpeg substituteInPlace ffmpy/ffmpy.py \ --replace-fail \ 'executable: str = "ffmpeg",' \ - 'executable: str = "${ffmpeg-headless}/bin/ffmpeg",' - - # The tests test a mock that does not behave like ffmpeg. If we default to the nix-store ffmpeg they fail. + 'executable: str = "${lib.getExe ffmpeg-headless}",' + '' + # The tests test a mock that does not behave like ffmpeg. If we default to the nix-store ffmpeg they fail. + + '' for fname in tests/*.py; do echo >>"$fname" 'FFmpeg.__init__.__defaults__ = ("ffmpeg", *FFmpeg.__init__.__defaults__[1:])' done