diff --git a/pkgs/applications/audio/r128gain/default.nix b/pkgs/applications/audio/r128gain/default.nix index 5444ffb4a178..7ff5a13b775e 100644 --- a/pkgs/applications/audio/r128gain/default.nix +++ b/pkgs/applications/audio/r128gain/default.nix @@ -9,13 +9,13 @@ python3Packages.buildPythonApplication rec { pname = "r128gain"; - version = "1.0.3"; + version = "1.0.7"; src = fetchFromGitHub { owner = "desbma"; repo = "r128gain"; rev = version; - sha256 = "0w2i2szajv1vcmc96w0fczdr8xc28ijcf1gdg180f21gi6yh96sc"; + sha256 = "sha256-JyKacDqjIKTNl2GjbJPkgbakF8HR4Jd4czAtOaemDH8="; }; patches = [ diff --git a/pkgs/applications/audio/r128gain/ffmpeg-location.patch b/pkgs/applications/audio/r128gain/ffmpeg-location.patch index c01f115c1d6d..53d755cdae41 100644 --- a/pkgs/applications/audio/r128gain/ffmpeg-location.patch +++ b/pkgs/applications/audio/r128gain/ffmpeg-location.patch @@ -1,29 +1,31 @@ ---- i/r128gain/__init__.py -+++ w/r128gain/__init__.py -@@ -78,7 +78,7 @@ def get_ffmpeg_lib_versions(ffmpeg_path=None): - 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 = subprocess.run(cmd, - check=True, - stdout=subprocess.PIPE, -@@ -156,7 +156,7 @@ def get_r128_loudness(audio_filepaths, *, calc_peak=True, enable_ffmpeg_threadin - os.devnull, - **additional_ffmpeg_args, - f="null").global_args("-hide_banner", "-nostats"), -- cmd=ffmpeg_path or "ffmpeg") -+ cmd=ffmpeg_path or "@ffmpeg@/bin/ffmpeg") +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 - logger().debug(cmd_to_string(cmd)) -@@ -740,7 +740,7 @@ def cl_main(): - help="Maximum number of tracks to scan in parallel. If not specified, autodetect CPU count") - 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""") - arg_parser.add_argument("-d", + # 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""", + )