From e42eb55649e98e2cd885b00db5fb83b8ce683216 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 23 Jan 2026 11:55:51 +0300 Subject: [PATCH] Disable libavdevice for headless builds on Linux to get rid of X libs dependency. --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index e25e51b2..d0c57b48 100755 --- a/setup.py +++ b/setup.py @@ -216,6 +216,10 @@ def main(): # see: https://github.com/opencv/opencv-python/issues/771 cmake_args.append("-DWITH_MSMF=OFF") cmake_args.append("-DWITH_OBSENSOR=OFF") # Orbbec cameras backend uses MSMF API + # see: https://github.com/opencv/opencv/issues/28438 + # libavdevice is enabled by default, but brings libxcb dependency + if sys.platform.startswith("linux"): + cmake_args.append("-DOPENCV_FFMPEG_ENABLE_LIBAVDEVICE=OFF") if sys.platform.startswith("linux") and not is64 and "bdist_wheel" in sys.argv: subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True)