Skip to content

Commit

Permalink
Added Wayland plugin to Qt backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorkalov committed Jan 31, 2023
1 parent 736b905 commit d28fbf5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels_linux.yml
Expand Up @@ -41,7 +41,7 @@ jobs:
MB_ML_VER: 2014
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230117
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230124
USE_CCACHE: 0
UNICODE_WIDTH: 32
PLAT: x86_64
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
NP_TEST_DEP: numpy==1.19.4
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230117
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230124
USE_CCACHE: 1
UNICODE_WIDTH: 32
SDIST: ${{ matrix.build_sdist || 0 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels_linux_arm.yml
Expand Up @@ -42,7 +42,7 @@ jobs:
MB_ML_VER: 2014
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20230117
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20230124
USE_CCACHE: 0
UNICODE_WIDTH: 32
SDIST: ${{ matrix.build_sdist || 0 }}
Expand Down
16 changes: 8 additions & 8 deletions docker/manylinux2014/Dockerfile_aarch64
@@ -1,4 +1,4 @@
# Version: 20230117
# Version: 20230124
# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64

FROM quay.io/pypa/manylinux2014_aarch64:latest
Expand All @@ -9,13 +9,13 @@ ARG FREETYPE_VERSION=2.12.1
ARG LIBPNG_VERSION=1.6.37
ARG NASM_VERSION=2.15.04
ARG OPENSSL_VERSION=1_1_1s
ARG QT_VERSION=5.15.0
ARG QT_VERSION=5.15.8
ARG YASM_VERSION=1.3.0

ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

# epel-release need for aarch64 to get openblas packages
RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \
RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release wayland-devel libwayland-egl -y && \
yum install openblas-devel dejavu-sans-fonts -y && \
cp /usr/include/lapacke/lapacke*.h /usr/include/ && \
curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \
Expand Down Expand Up @@ -44,13 +44,12 @@ RUN mkdir ~/freetype_sources && \
cd .. && \
rm -rf ~/freetype_sources

RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \
tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \
RUN curl -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
cd qt-everywhere-src-${QT_VERSION} && \
export MAKEFLAGS=-j$(nproc) && \
./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
make && \
make install && \
./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
make && make install && \
cd .. && \
rm -rf qt-everywhere*

Expand Down Expand Up @@ -139,3 +138,4 @@ RUN git config --global --add safe.directory /io
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig
ENV LDFLAGS -L/ffmpeg_build/lib
ENV PATH "$HOME/bin:$PATH"
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt${QT_VERSION}/lib
14 changes: 7 additions & 7 deletions docker/manylinux2014/Dockerfile_x86_64
@@ -1,4 +1,4 @@
# Version: 20230117
# Version: 20230124
# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64

FROM quay.io/pypa/manylinux2014_x86_64:latest
Expand All @@ -15,7 +15,7 @@ ARG YASM_VERSION=1.3.0
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

# epel-release need for aarch64 to get openblas packages
RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \
RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release wayland-devel libwayland-egl -y && \
yum install openblas-devel dejavu-sans-fonts -y && \
cp /usr/include/lapacke/lapacke*.h /usr/include/ && \
curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \
Expand Down Expand Up @@ -44,13 +44,12 @@ RUN mkdir ~/freetype_sources && \
cd .. && \
rm -rf ~/freetype_sources

RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \
tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \
RUN curl -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
cd qt-everywhere-src-${QT_VERSION} && \
export MAKEFLAGS=-j$(nproc) && \
./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
make && \
make install && \
./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
make && make install && \
cd .. && \
rm -rf qt-everywhere*

Expand Down Expand Up @@ -139,3 +138,4 @@ RUN git config --global --add safe.directory /io
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig
ENV LDFLAGS -L/ffmpeg_build/lib
ENV PATH "$HOME/bin:$PATH"
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt${QT_VERSION}/lib
2 changes: 1 addition & 1 deletion patches/patchQtPlugins
Expand Up @@ -9,7 +9,7 @@ index 4c0b3880fc..dffa0a4caa 100644
+ install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt)
+ endif()
+ if(UNIX AND NOT APPLE)
+ install(DIRECTORY /opt/Qt5.15.0/plugins DESTINATION lib/qt)
+ install(DIRECTORY /opt/Qt5.15.8/plugins DESTINATION lib/qt)
+ install(DIRECTORY /usr/share/fonts DESTINATION lib/qt)
+ endif()
if(HAVE_QT_OPENGL)
Expand Down
13 changes: 12 additions & 1 deletion setup.py
Expand Up @@ -223,7 +223,18 @@ def main():

if sys.platform.startswith("linux"):
rearrange_cmake_output_data["cv2.qt.plugins.platforms"] = [
(r"lib/qt/plugins/platforms/libqxcb\.so")
(r"lib/qt/plugins/platforms/libqxcb\.so"),

# wayland plugin parts
(r"lib/qt/plugins/platforms/libqwayland-generic\.so"),
(r"lib/qt/plugins/platforms/wayland-decoration-client/libbradient.so"),
(r"lib/qt/plugins/platforms/wayland-graphics-integration-client/libshm-emulation-server.so"),
(r"lib/qt/plugins/platforms/wayland-shell-integration/libfullscreen-shell-v1\.so"),
(r"lib/qt/plugins/platforms/wayland-shell-integration/libivi-shell\.so"),
(r"lib/qt/plugins/platforms/wayland-shell-integration/libwl-shell\.so"),
(r"lib/qt/plugins/platforms/wayland-shell-integration/libxdg-shell\.so"),
(r"lib/qt/plugins/platforms/wayland-shell-integration/libxdg-shell-v5\.so"),
(r"lib/qt/plugins/platforms/wayland-shell-integration/libxdg-shell-v6\.so")
]

# add fonts for Qt5
Expand Down
1 change: 0 additions & 1 deletion travis_config.sh
Expand Up @@ -34,7 +34,6 @@ if [ -n "$IS_OSX" ]; then
export MAKEFLAGS="-j$(sysctl -n hw.ncpu)"
else
echo " > Linux environment "
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.0/lib
export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)"
CURRENT_ARCH=$(uname -m)
if [[ $CURRENT_ARCH == 'aarch64' ]]; then
Expand Down

0 comments on commit d28fbf5

Please sign in to comment.