2024-06-05 15:53:02 +00:00
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
stdenv,
|
|
|
|
|
buildPythonPackage,
|
|
|
|
|
cython,
|
|
|
|
|
fetchFromGitHub,
|
2024-07-31 10:19:44 +00:00
|
|
|
|
fetchurl,
|
|
|
|
|
linkFarm,
|
|
|
|
|
ffmpeg_6-headless,
|
2024-06-05 15:53:02 +00:00
|
|
|
|
numpy,
|
|
|
|
|
pillow,
|
|
|
|
|
pkg-config,
|
|
|
|
|
pytestCheckHook,
|
|
|
|
|
pythonOlder,
|
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "av";
|
2024-09-19 14:19:46 +00:00
|
|
|
|
version = "12.3.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
pyproject = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
|
src = fetchFromGitHub {
|
2024-09-19 14:19:46 +00:00
|
|
|
|
owner = "PyAV-Org";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
repo = "PyAV";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
|
hash = "sha256-ezeYv55UzNnnYDjrMz5YS5g2pV6U/Fxx3e2bCoPP3eI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
|
build-system = [
|
2022-04-15 01:41:22 +00:00
|
|
|
|
cython
|
2022-09-30 11:47:45 +00:00
|
|
|
|
setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
|
];
|
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
|
buildInputs = [ ffmpeg_6-headless ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
|
preCheck =
|
|
|
|
|
let
|
|
|
|
|
# Update with `./update-test-samples.bash` if necessary.
|
|
|
|
|
testSamples = linkFarm "pyav-test-samples" (
|
|
|
|
|
lib.mapAttrs (_: fetchurl) (lib.importTOML ./test-samples.toml)
|
|
|
|
|
);
|
|
|
|
|
in
|
|
|
|
|
''
|
|
|
|
|
# ensure we import the built version
|
|
|
|
|
rm -r av
|
|
|
|
|
ln -s ${testSamples} tests/assets
|
|
|
|
|
'';
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
|
nativeCheckInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
|
numpy
|
|
|
|
|
pillow
|
|
|
|
|
pytestCheckHook
|
|
|
|
|
];
|
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
|
disabledTests = [
|
|
|
|
|
# av.error.InvalidDataError: [Errno 1094995529] Invalid data found when processing input: 'custom_io_output.mpd'
|
|
|
|
|
"test_writing_to_custom_io_dash"
|
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
|
# `__darwinAllowLocalNetworking` doesn’t work for these; not sure why.
|
|
|
|
|
disabledTestPaths = lib.optionals stdenv.isDarwin [
|
2022-04-15 01:41:22 +00:00
|
|
|
|
"tests/test_timeout.py"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
|
pythonImportsCheck = [
|
|
|
|
|
"av"
|
|
|
|
|
"av.audio"
|
|
|
|
|
"av.buffer"
|
|
|
|
|
"av.bytesource"
|
|
|
|
|
"av.codec"
|
|
|
|
|
"av.container"
|
|
|
|
|
"av._core"
|
|
|
|
|
"av.datasets"
|
|
|
|
|
"av.descriptor"
|
|
|
|
|
"av.dictionary"
|
|
|
|
|
"av.enum"
|
|
|
|
|
"av.error"
|
|
|
|
|
"av.filter"
|
|
|
|
|
"av.format"
|
|
|
|
|
"av.frame"
|
|
|
|
|
"av.logging"
|
|
|
|
|
"av.option"
|
|
|
|
|
"av.packet"
|
|
|
|
|
"av.plane"
|
|
|
|
|
"av.stream"
|
|
|
|
|
"av.subtitles"
|
|
|
|
|
"av.utils"
|
|
|
|
|
"av.video"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
|
meta = with lib; {
|
2024-09-19 14:19:46 +00:00
|
|
|
|
description = "Pythonic bindings for FFmpeg";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
mainProgram = "pyav";
|
2024-09-19 14:19:46 +00:00
|
|
|
|
homepage = "https://github.com/PyAV-Org/PyAV";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
changelog = "https://github.com/PyAV-Org/PyAV/blob/v${version}/CHANGELOG.rst";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
license = licenses.bsd2;
|
2024-07-31 10:19:44 +00:00
|
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|