From ff201af778a01c98b3356b0d6bcedf216882fdbe Mon Sep 17 00:00:00 2001 From: xiphon Date: Wed, 11 Nov 2020 00:42:54 +0000 Subject: [PATCH] docker: Linux - use Qt 5.15.2 --- CMakeLists.txt | 19 +++++-- Dockerfile.linux | 128 ++++++++++++++++++++++++++++++++++++---------- src/main/main.cpp | 3 ++ 3 files changed, 119 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9edb9c6b..850cf5a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.12) project(monero-gui) message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}") @@ -76,7 +76,7 @@ if(STATIC) message(STATUS "Initiating static build") set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ${CMAKE_FIND_LIBRARY_SUFFIXES}) add_definitions(-DMONERO_GUI_STATIC) endif() @@ -178,7 +178,10 @@ find_package(Boost 1.58 REQUIRED COMPONENTS if(UNIX AND NOT APPLE AND NOT ANDROID) set(CMAKE_SKIP_RPATH ON) + set(CMAKE_FIND_LIBRARY_SUFFIXES_PREV ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".so") find_package(X11 REQUIRED) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_PREV}) message(STATUS "X11_FOUND = ${X11_FOUND}") message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}") message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}") @@ -300,6 +303,7 @@ if(STATIC) list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtGraphicalEffects) list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtGraphicalEffects/private) list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtMultimedia) + list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQml) list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick.2) list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Controls) list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Controls.2) @@ -340,6 +344,10 @@ if(STATIC) windowplugin ) + if(NOT ${Qt5Core_VERSION} VERSION_LESS 5.14) + list(APPEND QT5_EXTRA_LIBRARIES_LIST qmlplugin) + endif() + set(QT5_EXTRA_LIBRARIES) foreach(LIBRARY ${QT5_EXTRA_LIBRARIES_LIST}) find_library(${LIBRARY}_LIBRARY ${LIBRARY} PATHS ${QT5_EXTRA_PATHS} REQUIRED) @@ -367,7 +375,6 @@ if(STATIC) if(UNIX AND NOT APPLE) list(APPEND QT5_INTEGRATION_LIBRARIES_LIST Qt5XcbQpa - xcb-static Qt5ServiceSupport Qt5GlxSupport ) @@ -381,8 +388,10 @@ if(STATIC) endforeach() if(UNIX AND NOT APPLE) - pkg_check_modules(X11XCB_XCBGLX_FONTCONFIG REQUIRED x11-xcb xcb-glx fontconfig) - list(APPEND QT5_LIBRARIES ${X11XCB_XCBGLX_FONTCONFIG_STATIC_LIBRARIES}) + pkg_check_modules(X11XCB_XCBGLX REQUIRED x11-xcb xcb-glx) + list(APPEND QT5_LIBRARIES ${X11XCB_XCBGLX_LIBRARIES}) + pkg_check_modules(FONTCONFIG REQUIRED fontconfig) + list(APPEND QT5_LIBRARIES ${FONTCONFIG_STATIC_LIBRARIES}) endif() endif() diff --git a/Dockerfile.linux b/Dockerfile.linux index 116966a7..f2b8e81e 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,8 +1,10 @@ FROM ubuntu:16.04 ARG THREADS=1 +ARG QT_VERSION=5.15.2 ENV CFLAGS="-fPIC" +ENV CPPFLAGS="-fPIC" ENV CXXFLAGS="-fPIC" ENV SOURCE_DATE_EPOCH=1397818193 @@ -29,7 +31,7 @@ RUN apt install -y libtool-bin && \ git clone -b libXau-1.0.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxau && \ cd libxau && \ git reset --hard d9443b2c57b512cfb250b35707378654d86c7dea && \ - ./autogen.sh --disable-shared --enable-static && \ + ./autogen.sh --enable-shared --disable-static && \ make -j$THREADS && \ make -j$THREADS install && \ rm -rf $(pwd) @@ -38,8 +40,77 @@ RUN apt install -y libpthread-stubs0-dev && \ git clone -b 1.12 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb && \ cd libxcb && \ git reset --hard d34785a34f28fa6a00f8ce00d87e3132ff0f6467 && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + make -j$THREADS clean && \ + rm /usr/local/lib/libxcb-xinerama.so && \ ./autogen.sh --disable-shared --enable-static && \ make -j$THREADS && \ + cp src/.libs/libxcb-xinerama.a /usr/local/lib/ && \ + rm -rf $(pwd) + +RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-util && \ + cd libxcb-util && \ + git reset --hard acf790d7752f36e450d476ad79807d4012ec863b && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-image && \ + cd libxcb-image && \ + git reset --hard d882052fb2ce439c6483fce944ba8f16f7294639 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms && \ + cd libxcb-keysyms && \ + git reset --hard 0e51ee5570a6a80bdf98770b975dfe8a57f4eeb1 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +RUN git clone -b 0.3.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util && \ + cd libxcb-render-util && \ + git reset --hard 0317caf63de532fd7a0493ed6afa871a67253747 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +RUN git clone -b 0.4.1 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-wm && \ + cd libxcb-wm && \ + git reset --hard 24eb17df2e1245885e72c9d4bbb0a0f69f0700f2 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +RUN apt install -y bison && \ + git clone -b xkbcommon-0.5.0 --depth 1 https://github.com/xkbcommon/libxkbcommon && \ + cd libxkbcommon && \ + git reset --hard c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 && \ + ./autogen.sh --prefix=/usr --enable-shared --disable-static --enable-x11 --disable-docs && \ + make -j$THREADS && \ make -j$THREADS install && \ rm -rf $(pwd) @@ -106,18 +177,31 @@ RUN wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz && \ make -j$THREADS install && \ rm -rf $(pwd) -RUN apt install -y libgl1-mesa-dev libglib2.0-dev libxkbcommon-dev && \ - wget https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz && \ - echo "5ce285209290a157d7f42ec8eb22bf3f1d76f2e03a95fc0b99b553391be01642 qt-everywhere-opensource-src-5.9.9.tar.xz" | sha256sum -c && \ - tar -xf qt-everywhere-opensource-src-5.9.9.tar.xz && \ - rm qt-everywhere-opensource-src-5.9.9.tar.xz && \ - cd qt-everywhere-opensource-src-5.9.9 && \ +RUN apt install -y libgl1-mesa-dev libglib2.0-dev mesa-common-dev && \ + rm /usr/lib/x86_64-linux-gnu/libX11.a && \ + rm /usr/lib/x86_64-linux-gnu/libXext.a && \ + rm /usr/lib/x86_64-linux-gnu/libX11-xcb.a && \ + git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \ + cd qt5 && \ + git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtdeclarative.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtgraphicaleffects.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtimageformats.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtmultimedia.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtquickcontrols.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtquickcontrols2.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtsvg.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qttools.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qttranslations.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtx11extras.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtxmlpatterns.git -b ${QT_VERSION} --depth 1 && \ sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \ sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \ sed -ri s/\(Libs:.*\)/\\1\ -lXau/ /usr/local/lib/pkgconfig/xcb.pc && \ + sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \ ./configure --prefix=/usr -platform linux-g++-64 -opensource -confirm-license -release -static -no-avx \ - -opengl desktop -qpa xcb -system-freetype -fontconfig -glib \ - -no-dbus -no-openssl -no-sql-sqlite -no-use-gold-linker \ + -opengl desktop -qpa xcb -xcb -xcb-xlib -feature-xlib -system-freetype -fontconfig -glib \ + -no-dbus -no-feature-qml-worker-script -no-linuxfb -no-openssl -no-sql-sqlite -no-kms -no-use-gold-linker \ -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \ -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \ -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing \ @@ -152,22 +236,6 @@ RUN git clone -b hidapi-0.9.0 --depth 1 https://github.com/libusb/hidapi && \ make -j$THREADS install && \ rm -rf $(pwd) -RUN git clone -b libX11-1.6.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libx11 && \ - cd libx11 && \ - git reset --hard db7cca17ad7807e92a928da9d4c68a00f4836da2 && \ - ./autogen.sh --disable-shared --enable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b libXext-1.3.4 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxext && \ - cd libxext && \ - git reset --hard ebb167f34a3514783966775fb12573c4ed209625 && \ - ./autogen.sh --disable-shared --enable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - RUN apt install -y libsodium-dev && \ git clone -b v4.3.2 --depth 1 https://github.com/zeromq/libzmq && \ cd libzmq && \ @@ -205,4 +273,12 @@ RUN git clone -b v3.10.0 --depth 1 https://github.com/protocolbuffers/protobuf & make -j$THREADS install && \ rm -rf $(pwd) -RUN apt install -y cmake libusb-1.0-0-dev +RUN git clone -b v3.18.4 --depth 1 https://github.com/Kitware/CMake && \ + cd CMake && \ + git reset --hard 3cc3d42aba879fff5e85b363ae8f21386a3f9f9b && \ + ./bootstrap && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +RUN apt install -y libusb-1.0-0-dev diff --git a/src/main/main.cpp b/src/main/main.cpp index bc8f00a9..4035e194 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -120,6 +120,9 @@ Q_IMPORT_PLUGIN(QQmlDebugServerFactory) Q_IMPORT_PLUGIN(QTcpServerConnectionFactory) Q_IMPORT_PLUGIN(QGenericEnginePlugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) +Q_IMPORT_PLUGIN(QtQmlPlugin) +#endif Q_IMPORT_PLUGIN(QtQuick2Plugin) Q_IMPORT_PLUGIN(QtQuickLayoutsPlugin) Q_IMPORT_PLUGIN(QtGraphicalEffectsPlugin)