python3Packages.ffmpy: init at 0.3.1
Co-authored-by: Yt <happysalada@tuta.io>
This commit is contained in:
committed by
Yt
co-authored by
Yt
parent
35dad375a1
commit
e6990d6cc4
@@ -0,0 +1,55 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pythonOlder
|
||||
, pytestCheckHook
|
||||
, go
|
||||
, ffmpeg-headless
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ffmpy";
|
||||
version = "0.3.1";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Ch00k";
|
||||
repo = "ffmpy";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-kuLhmCG80BmXdqpW67UanBnuYiL2Oh1jKt7IgmVNEAM=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# default to store ffmpeg
|
||||
substituteInPlace ffmpy.py \
|
||||
--replace 'executable="ffmpeg",' 'executable="${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.
|
||||
for fname in tests/*.py; do
|
||||
echo 'FFmpeg.__init__.__defaults__ = ("ffmpeg", *FFmpeg.__init__.__defaults__[1:])' >>"$fname"
|
||||
done
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "ffmpy" ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
go
|
||||
];
|
||||
|
||||
# the vendored ffmpeg mock binary assumes FHS
|
||||
preCheck = ''
|
||||
rm -v tests/ffmpeg/ffmpeg
|
||||
HOME=$(mktemp -d) go build -o ffmpeg tests/ffmpeg/ffmpeg.go
|
||||
export PATH=".:$PATH"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple python interface for FFmpeg/FFprobe";
|
||||
homepage = "https://github.com/Ch00k/ffmpy";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ pbsds ];
|
||||
};
|
||||
}
|
||||
@@ -3673,6 +3673,8 @@ self: super: with self; {
|
||||
|
||||
ffmpeg-progress-yield = callPackage ../development/python-modules/ffmpeg-progress-yield { };
|
||||
|
||||
ffmpy = callPackage ../development/python-modules/ffmpy { };
|
||||
|
||||
fiblary3-fork = callPackage ../development/python-modules/fiblary3-fork { };
|
||||
|
||||
fido2 = callPackage ../development/python-modules/fido2 { };
|
||||
|
||||
Reference in New Issue
Block a user