19 lines
609 B
Python
19 lines
609 B
Python
#!/usr/bin/env python3
|
|
"""Adapt FFmpeg's Darwin driver flags to the pinned Zig compiler."""
|
|
import os
|
|
import sys
|
|
|
|
|
|
def main():
|
|
arch = os.environ["FFPROBE_ARCH"]
|
|
if arch not in ("aarch64", "x86_64"):
|
|
raise ValueError("Unsupported FFprobe architecture")
|
|
# Zig's Mach-O linker selects dynamic/system-library lookup itself.
|
|
arguments = [arg for arg in sys.argv[1:] if arg != "-Wl,-dynamic,-search_paths_first"]
|
|
os.execvp("zig", ["zig", "cc", "-target", f"{arch}-macos.13.0",
|
|
"-isysroot", "/opt/MacOSX11.3.sdk", *arguments])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|