kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 238 forks source link

PyAV recipe #782

Open DexerBR opened 1 year ago

DexerBR commented 1 year ago

Is your feature request related to a problem? Please describe

I'm trying to compile PyAV for iOS. Up to a certain point the compilation seems to be successful, but when build_ext is executed, the compilation fails.

Note: I'm using the kivy-ios project workflow to test recipe creation

Describe the solution you'd like

I'd like some guidance on the possible reason for the error, or that at least this code/error would help someone implement the PyAV recipe

Additional context

PyAV setup.py: https://github.com/PyAV-Org/PyAV/blob/main/setup.py

PyAV recipe (WIP):

from kivy_ios.toolchain import CythonRecipe, shprint
import sh

class PyAVRecipe(CythonRecipe):

    name = "av"
    library = "av.a"
    version = "10.0.0"
    url = "https://github.com/PyAV-Org/PyAV/archive/v{version}.zip"

    depends = ["python3", "ffmpeg", "hostpython3"]
    opt_depends = ["openssl"]
    hostpython_prerequisites = ["Cython"]

    cythonize = False
    pre_build_ext = False

    def get_recipe_env(self, arch, with_flags_in_cc=True):
        env = super().get_recipe_env(arch)
        return env

    def build_arch(self, arch):
        hostpython3 = sh.Command(self.ctx.hostpython)
        ffmpeg_dir = self.get_recipe("ffmpeg", self.ctx).get_build_dir(
            arch.arch
        )
        shprint(
            hostpython3,
            "setup.py",
            "build",
            "--ffmpeg-dir={}".format(ffmpeg_dir),
        )
        self.biglink()

recipe = PyAVRecipe()

Error logs: https://pastebin.com/raw/b8AW6emG