From 0feb6c4cdcf8e8d8715b243c5326745bc0818945 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Thu, 16 Apr 2026 17:11:36 +0530 Subject: [PATCH] `pyav`: update to `17.0.0` --- pythonforandroid/recipes/av/__init__.py | 21 ++++++--------- .../patches/compilation_syntax_errors.patch | 27 ------------------- 2 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 pythonforandroid/recipes/av/patches/compilation_syntax_errors.patch diff --git a/pythonforandroid/recipes/av/__init__.py b/pythonforandroid/recipes/av/__init__.py index f189467add..c765eafe98 100644 --- a/pythonforandroid/recipes/av/__init__.py +++ b/pythonforandroid/recipes/av/__init__.py @@ -1,25 +1,20 @@ from pythonforandroid.toolchain import Recipe -from pythonforandroid.recipe import CythonRecipe +from pythonforandroid.recipe import PyProjectRecipe -class PyAVRecipe(CythonRecipe): +class PyAVRecipe(PyProjectRecipe): name = "av" - version = "13.1.0" + version = "17.0.0" url = "https://github.com/PyAV-Org/PyAV/archive/v{version}.zip" - - depends = ["python3", "cython", "ffmpeg", "av_codecs"] - opt_depends = ["openssl"] - patches = ['patches/compilation_syntax_errors.patch'] + depends = ["python3", "ffmpeg", "av_codecs", "openssl"] + hostpython_prerequisites = ["cython>=3.1.0"] def get_recipe_env(self, arch, with_flags_in_cc=True): env = super().get_recipe_env(arch) - - build_dir = Recipe.get_recipe("ffmpeg", self.ctx).get_build_dir( - arch.arch - ) - self.setup_extra_args = ["--ffmpeg-dir={}".format(build_dir)] - + build_dir = Recipe.get_recipe("ffmpeg", self.ctx).get_build_dir(arch.arch) + env["CFLAGS"] += f" -I{build_dir}" + self.extra_build_args += ["--config-setting=--ffmpeg-dir={}".format(build_dir)] return env diff --git a/pythonforandroid/recipes/av/patches/compilation_syntax_errors.patch b/pythonforandroid/recipes/av/patches/compilation_syntax_errors.patch deleted file mode 100644 index c9a7e9adb3..0000000000 --- a/pythonforandroid/recipes/av/patches/compilation_syntax_errors.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/av/container/streams.pyx b/av/container/streams.pyx -index 17e4992..502ac5a 100644 ---- a/av/container/streams.pyx -+++ b/av/container/streams.pyx -@@ -144,7 +144,7 @@ cdef class StreamContainer: - - return stream_index - -- def best(self, str type, /, Stream related = None): -+ def best(self, str type, Stream related=None): - """best(type: Literal["video", "audio", "subtitle", "attachment", "data"], /, related: Stream | None) - Finds the "best" stream in the file. Wraps :ffmpeg:`av_find_best_stream`. Example:: - -diff --git a/av/filter/context.pyx b/av/filter/context.pyx -index b820d3d..8908b56 100644 ---- a/av/filter/context.pyx -+++ b/av/filter/context.pyx -@@ -77,7 +77,8 @@ cdef class FilterContext: - - @property - def graph(self): -- if (graph := self._graph()): -+ graph = self._graph() -+ if graph: - return graph - else: - raise RuntimeError("graph is unallocated")