Skip to content

Commit a8dfcf2

Browse files
committed
Qt5 requires platform plugins also on Linux, update i686 Dockerfile
1 parent 49ed880 commit a8dfcf2

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

cv2/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# this makes them available
1010
globals().update(importlib.import_module('cv2.cv2').__dict__)
1111

12-
if sys.platform == 'darwin':
12+
if sys.platform == 'darwin' or sys.platform.startswith("linux"):
1313
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join(
1414
os.path.dirname(os.path.abspath(__file__)), 'qt', 'plugins'
1515
)

docker/manylinux2014/Dockerfile_i686

+6
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,10 @@ RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-
6868

6969
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
7070
ENV LDFLAGS -L/root/ffmpeg_build/lib
71+
72+
# in i686, yum metadata ends up with slightly wrong timestamps
73+
# which inhibits its update
74+
# https://github.com/skvark/opencv-python/issues/148
75+
RUN yum clean all
76+
7177
ENV PATH "$HOME/bin:$PATH"

setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ def main():
154154
(r"lib/qt/plugins/platforms/libqcocoa\.dylib")
155155
]
156156

157+
if sys.platform.startswith("linux") and not build_headless:
158+
rearrange_cmake_output_data["cv2.qt.plugins.platforms"] = [
159+
(r"lib/qt/plugins/platforms/libqxcb\.so")
160+
]
161+
157162
if build_headless:
158163
# it seems that cocoa cannot be disabled so on macOS the package is not truly headless
159164
cmake_args.append("-DWITH_WIN32UI=OFF")

0 commit comments

Comments
 (0)