you-get: hardcode ffmpeg path

This commit is contained in:
Robert Schütz 2022-06-01 01:05:35 +00:00 committed by Robert Schütz
parent 99d0d5f1db
commit 575b761b39
3 changed files with 31 additions and 5 deletions

View file

@ -1,6 +1,11 @@
{ lib, buildPythonApplication, fetchPypi, installShellFiles }:
{ lib
, python3
, substituteAll
, ffmpeg
, installShellFiles
}:
buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "you-get";
version = "0.4.1612";
@ -8,11 +13,20 @@ buildPythonApplication rec {
# probably aren't suitable for a build environment anyway.
doCheck = false;
src = fetchPypi {
src = python3.pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-lKEztwwn1pnALuwDiA1Ik9+XCVyO+UMobv+hXu0mn5w=";
};
patches = [
(substituteAll {
src = ./ffmpeg-path.patch;
ffmpeg = "${lib.getBin ffmpeg}/bin/ffmpeg";
ffprobe = "${lib.getBin ffmpeg}/bin/ffmpeg";
version = lib.getVersion ffmpeg;
})
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
@ -25,7 +39,6 @@ buildPythonApplication rec {
meta = with lib; {
description = "A tiny command line utility to download media contents from the web";
homepage = "https://you-get.org";
changelog = "https://github.com/soimort/you-get/raw/v${version}/CHANGELOG.rst";
license = licenses.mit;
maintainers = with maintainers; [ ryneeverett ];
};

View file

@ -0,0 +1,13 @@
diff --git a/src/you_get/processor/ffmpeg.py b/src/you_get/processor/ffmpeg.py
index 50e2c9f..46e7f61 100755
--- a/src/you_get/processor/ffmpeg.py
+++ b/src/you_get/processor/ffmpeg.py
@@ -31,7 +31,7 @@ def get_usable_ffmpeg(cmd):
except:
return None
-FFMPEG, FFPROBE, FFMPEG_VERSION = get_usable_ffmpeg('ffmpeg') or get_usable_ffmpeg('avconv') or (None, None, None)
+FFMPEG, FFPROBE, FFMPEG_VERSION = ('@ffmpeg@', '@ffprobe@', '@version@')
if logging.getLogger().isEnabledFor(logging.DEBUG):
LOGLEVEL = ['-loglevel', 'info']
STDIN = None

View file

@ -11944,7 +11944,7 @@ with pkgs;
yle-dl = callPackage ../tools/misc/yle-dl {};
you-get = python3Packages.callPackage ../tools/misc/you-get { };
you-get = callPackage ../tools/misc/you-get { };
zasm = callPackage ../development/compilers/zasm {};