nixpkgs/pkgs/by-name/r1/r128gain/ffmpeg-location.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

32 lines
1.3 KiB
Diff

diff --git a/r128gain/__init__.py b/r128gain/__init__.py
index 79a5cbd..d8f13ba 100755
--- a/r128gain/__init__.py
+++ b/r128gain/__init__.py
@@ -86,7 +86,7 @@ def get_ffmpeg_lib_versions(ffmpeg_path: Optional[str] = None) -> Dict[str, int]
Example: 0x3040100 for FFmpeg 3.4.1
"""
r = collections.OrderedDict()
- cmd = (ffmpeg_path or "ffmpeg", "-version")
+ cmd = (ffmpeg_path or "@ffmpeg@/bin/ffmpeg", "-version")
output_str = subprocess.run(cmd, check=True, stdout=subprocess.PIPE, universal_newlines=True).stdout
output_lines = output_str.splitlines()
lib_version_regex = re.compile(r"^\s*(lib[a-z]+)\s+([0-9]+).\s*([0-9]+).\s*([0-9]+)\s+")
@@ -194,7 +194,7 @@ def get_r128_loudness( # noqa: C901
ffmpeg.output(*output_streams, os.devnull, **additional_ffmpeg_args, f="null").global_args(
"-hide_banner", "-nostats"
),
- cmd=ffmpeg_path or "ffmpeg",
+ cmd=ffmpeg_path or "@ffmpeg@/bin/ffmpeg",
)
# run
@@ -885,7 +885,7 @@ def cl_main() -> None:
arg_parser.add_argument(
"-f",
"--ffmpeg-path",
- default=shutil.which("ffmpeg"),
+ default="@ffmpeg@/bin/ffmpeg",
help="""Full file path of ffmpeg executable (only needed if not in PATH).
If not specified, autodetect""",
)