Commit b72bcc3a authored by Benjamin Sparks's avatar Benjamin Sparks
Browse files

python3Packages.ffmpy: refactor

Prefer lib.getExe over hardcoding the ffmpeg binary path,
Move comments out of patches
parent e4036c96
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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",'

          '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