From 121abbc4b7f7ca8ea447794ffca3df55fe3f24af Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Tue, 18 May 2021 20:23:12 +0200 Subject: [PATCH 01/16] Backport Qt component support from qt6 recipe to qt5 recipe (resolves #4529). Needs more testing before PR. --- recipes/qt/5.x.x/conanfile.py | 195 +++++++++++++++++-- recipes/qt/5.x.x/test_package/CMakeLists.txt | 4 +- 2 files changed, 176 insertions(+), 23 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index ebc45603dcee2..b381ab69954f5 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -648,6 +648,9 @@ def _getenvpath(var): def _cmake_executables_file(self): return os.path.join("lib", "cmake", "Qt5Core", "conan_qt_executables_variables.cmake") + def _cmake_qt5_private_file(self, module): + return os.path.join("lib", "cmake", "Qt5{0}".format(module), "conan_qt_qt5_{0}private.cmake".format(module.lower())) + def package(self): with tools.chdir("build_folder"): self.run("%s install" % self._make_program()) @@ -730,37 +733,187 @@ def package_id(self): self.info.settings.compiler.runtime = "MT/MTd" def package_info(self): - # FIXME add components - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.names["cmake_find_package"] = "Qt5" + self.cpp_info.names["cmake_find_package_multi"] = "Qt5" - # Add top level include directory, so code compile if someone uses - # includes with prefixes (e.g. "#include ") - self.cpp_info.includedirs = ["include"] + libsuffix = "" + if self.settings.build_type == "Debug": + if self.settings.os == "Windows": + libsuffix = "d" + if tools.is_apple_os(self.settings.os): + libsuffix = "_debug" + + def _get_corrected_reqs(requires): + reqs = [] + for r in requires: + reqs.append(r if "::" in r else "qt%s" % r) + return reqs + + def _create_module(module, requires=[]): + componentname = "qt%s" % module + assert componentname not in self.cpp_info.components, "Module %s already present in self.cpp_info.components" % module + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + self.cpp_info.components[componentname].libs = ["Qt5%s%s" % (module, libsuffix)] + self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", "Qt%s" % module)] + self.cpp_info.components[componentname].defines = ["QT_%s_LIB" % module.upper()] + if module != "Core" and "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + def _create_plugin(pluginname, libname, type, requires): + componentname = "qt%s" % pluginname + assert componentname not in self.cpp_info.components, "Plugin %s already present in self.cpp_info.components" % pluginname + self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname + self.cpp_info.components[componentname].libs = [libname + libsuffix] + self.cpp_info.components[componentname].libdirs = [os.path.join("res", "archdatadir", "plugins", type)] + self.cpp_info.components[componentname].includedirs = [] + if "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + core_reqs = ["zlib::zlib"] + if self.options.with_pcre2: + core_reqs.append("pcre2::pcre2") + if self.options.with_doubleconversion: + core_reqs.append("double-conversion::double-conversion") + if self.options.get_safe("with_icu", False): + core_reqs.append("icu::icu") + if self.options.with_zstd: + core_reqs.append("zstd::zstd") + + _create_module("Core", core_reqs) + if self.options.gui: + gui_reqs = ["DBus"] + if self.options.with_freetype: + gui_reqs.append("freetype::freetype") + if self.options.with_libpng: + gui_reqs.append("libpng::libpng") + if self.options.get_safe("with_fontconfig", False): + gui_reqs.append("fontconfig::fontconfig") + if self.settings.os in ["Linux", "FreeBSD"]: + gui_reqs.append("xorg::xorg") + if not tools.cross_building(self, skip_x64_x86=True): + gui_reqs.append("xkbcommon::xkbcommon") + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + gui_reqs.append("opengl::opengl") + if self.options.with_harfbuzz: + gui_reqs.append("harfbuzz::harfbuzz") + if self.options.with_libjpeg == "libjpeg-turbo": + gui_reqs.append("libjpeg-turbo::libjpeg-turbo") + if self.options.with_libjpeg == "libjpeg": + gui_reqs.append("libjpeg::libjpeg") + _create_module("Gui", gui_reqs) + if self.options.with_sqlite3: + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) + if self.options.with_pq: + _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) + if self.options.with_mysql: + _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldriver", ["libmysqlclient::libmysqlclient"]) + if self.options.with_odbc: + if self.settings.os != "Windows": + _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) + networkReqs = [] + if self.options.openssl: + networkReqs.append("openssl::openssl") + _create_module("Network", networkReqs) + _create_module("Sql") + _create_module("Test") + if self.options.widgets: + _create_module("Widgets", ["Gui"]) + if self.options.gui and self.options.widgets: + _create_module("PrintSupport", ["Gui", "Widgets"]) + if self.options.get_safe("opengl", "no") != "no" and self.options.gui: + _create_module("OpenGL", ["Gui"]) + if self.options.widgets and self.options.get_safe("opengl", "no") != "no": + _create_module("OpenGLWidgets", ["OpenGL", "Widgets"]) + _create_module("DBus") + _create_module("Concurrent") + _create_module("Xml") + + if self.options.qtdeclarative: + _create_module("Qml", ["Network"]) + #self.cpp_info.components["qtQml"].build_modules["cmake_find_package"].append(self._cmake_qt5_private_file("Qml")) + #self.cpp_info.components["qtQml"].build_modules["cmake_find_package_multi"].append(self._cmake_qt5_private_file("Qml")) + _create_module("QmlModels", ["Qml"]) + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" + self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) + if self.options.gui: + _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + if self.options.widgets: + _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) + _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) + _create_module("QmlWorkerScript", ["Qml"]) + _create_module("QuickTest", ["Test"]) + + if self.options.qttools and self.options.gui and self.options.widgets: + _create_module("UiPlugin", ["Gui", "Widgets"]) + self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only + self.cpp_info.components["qtUiPlugin"].libdirs = [] + _create_module("UiTools", ["UiPlugin", "Gui", "Widgets"]) + _create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) + _create_module("Help", ["Gui", "Sql", "Widgets"]) + + if self.options.qtquick3d and self.options.gui: + _create_module("Quick3DUtils", ["Gui"]) + _create_module("Quick3DAssetImport", ["Gui", "Qml", "Quick3DUtils"]) + _create_module("Quick3DRuntimeRender", ["Gui", "Quick", "Quick3DAssetImport", "Quick3DUtils", "ShaderTools"]) + _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"]) + + if self.options.qtquickcontrols2 and self.options.gui: + _create_module("QuickControls2", ["Gui", "Quick"]) + _create_module("QuickTemplates2", ["Gui", "Quick"]) + + if self.options.qtsvg and self.options.gui: + _create_module("Svg", ["Gui"]) + if self.options.widgets: + _create_module("SvgWidgets", ["Gui", "Svg", "Widgets"]) + + if self.options.qtwayland and self.options.gui: + _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) + _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) - # Add all Qt module directories (QtCore, QtGui, QtWidgets and so on), so prefix - # can be omited in includes (e.g. "#include " => "#include ") - fu = ["include/" + f.name for f in os.scandir("include") if f.is_dir()] - self.cpp_info.includedirs.extend(fu) if not self.options.shared: if self.settings.os == "Windows": - self.cpp_info.system_libs.append("Version") # "Qt5Cored.lib" require "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library - self.cpp_info.system_libs.append("Winmm") # "Qt5Cored.lib" require "__imp_timeSetEvent" which is in "Winmm.lib" library - self.cpp_info.system_libs.append("Netapi32") # "Qt5Cored.lib" require "NetApiBufferFree" which is in "Netapi32.lib" library - self.cpp_info.system_libs.append("UserEnv") # "Qt5Cored.lib" require "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library + self.cpp_info.components["qtCore"].system_libs.append("version") # qtcore requires "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library + self.cpp_info.components["qtCore"].system_libs.append("winmm") # qtcore requires "__imp_timeSetEvent" which is in "Winmm.lib" library + self.cpp_info.components["qtCore"].system_libs.append("netapi32") # qtcore requires "NetApiBufferFree" which is in "Netapi32.lib" library + self.cpp_info.components["qtCore"].system_libs.append("userenv") # qtcore requires "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library + self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("DnsApi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library + if self.settings.os == "Macos": - self.cpp_info.frameworks.extend(["IOKit"]) # "libQt5Core.a" require "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework - self.cpp_info.frameworks.extend(["Cocoa"]) # "libQt5Core.a" require "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework - self.cpp_info.frameworks.extend(["Security"]) # "libQt5Core.a" require "_SecRequirementCreateWithString" and more, which are in "Security" framework + self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework + self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework + self.cpp_info.components["qtCore"].frameworks.append("Security") # qtcore requires "_SecRequirementCreateWithString" and more, which are in "Security" framework + + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("res","archdatadir","bin")) + self.cpp_info.components["qtCore"].build_modules["cmake_find_package"].append(self._cmake_executables_file) + self.cpp_info.components["qtCore"].build_modules["cmake_find_package_multi"].append(self._cmake_executables_file) + #self.cpp_info.components["qtCore"].build_modules["cmake_find_package"].append(self._cmake_qt5_private_file("Core")) + #self.cpp_info.components["qtCore"].build_modules["cmake_find_package_multi"].append(self._cmake_qt5_private_file("Core")) for m in os.listdir(os.path.join("lib", "cmake")): module = os.path.join("lib", "cmake", m, "%sMacros.cmake" % m) - self.cpp_info.build_modules["cmake_find_package"].append(module) - self.cpp_info.build_modules["cmake_find_package_multi"].append(module) - self.cpp_info.builddirs.append(os.path.join("lib", "cmake", m)) - self.cpp_info.build_modules["cmake_find_package"].append(self._cmake_executables_file) - self.cpp_info.build_modules["cmake_find_package_multi"].append(self._cmake_executables_file) + component_name = m.replace("Qt5", "qt") + self.cpp_info.components[component_name].build_modules["cmake_find_package"].append(module) + self.cpp_info.components[component_name].build_modules["cmake_find_package_multi"].append(module) + self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) + + objects_dirs = glob.glob(os.path.join(self.package_folder, "lib", "objects-*/")) + for object_dir in objects_dirs: + for m in os.listdir(object_dir): + submodules_dir = os.path.join(object_dir, m) + component = "qt" + m[:m.find("_")] + for sub_dir in os.listdir(submodules_dir): + submodule_dir = os.path.join(submodules_dir, sub_dir) + obj_files = [os.path.join(submodule_dir, file) for file in os.listdir(submodule_dir)] + self.cpp_info.components[component].exelinkflags.extend(obj_files) + self.cpp_info.components[component].sharedlinkflags.extend(obj_files) @staticmethod diff --git a/recipes/qt/5.x.x/test_package/CMakeLists.txt b/recipes/qt/5.x.x/test_package/CMakeLists.txt index 5e57ff2921781..2344121caf236 100644 --- a/recipes/qt/5.x.x/test_package/CMakeLists.txt +++ b/recipes/qt/5.x.x/test_package/CMakeLists.txt @@ -9,7 +9,7 @@ conan_set_vs_runtime() conan_set_libcxx() conan_output_dirs_setup() -find_package(qt REQUIRED CONFIG) +find_package(Qt5Core REQUIRED CONFIG) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -20,4 +20,4 @@ add_executable(${PROJECT_NAME} ${SOURCES}) # Must compile with "-fPIC" since Qt was built with -reduce-relocations. target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) -target_link_libraries(${PROJECT_NAME} qt::qt) +target_link_libraries(${PROJECT_NAME} Qt5::Core) From 87a293a10900d3e1a8987fc46e9257b439f1e5ae Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Thu, 20 May 2021 18:20:32 +0200 Subject: [PATCH 02/16] Backport Qt component support from qt6 recipe to qt5 recipe (resolves #4529). Changes for component support with VS2019. Add patch for QTBUG-88625. --- recipes/qt/5.x.x/conandata.yml | 2 + recipes/qt/5.x.x/conanfile.py | 14 ++++-- recipes/qt/5.x.x/patches/QTBUG-88625.diff | 58 +++++++++++++++++++++++ 3 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 recipes/qt/5.x.x/patches/QTBUG-88625.diff diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index a37360194178a..9dafbfd849c33 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -14,3 +14,5 @@ patches: base_path: "qt5/qtwebengine" - patch_file: "patches/fix-macdeployqt.diff" base_path: "qt5/qttools" + - patch_file: "patches/QTBUG-88625.diff" + base_path: "qt5/qtwebengine" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index b381ab69954f5..d19f22e98965d 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -81,7 +81,7 @@ class QtConan(ConanFile): "cross_compile": "ANY", "sysroot": "ANY", "config": "ANY", - "multiconfiguration": [True, False], + "multiconfiguration": [True, False] } options.update({module: [True, False] for module in _submodules}) @@ -117,7 +117,7 @@ class QtConan(ConanFile): "cross_compile": None, "sysroot": None, "config": None, - "multiconfiguration": False, + "multiconfiguration": False } default_options.update({module: False for module in _submodules}) @@ -148,10 +148,11 @@ def build_requirements(self): msg = ("Python2 must be available in PATH " "in order to build Qt WebEngine") raise ConanInvalidConfiguration(msg) + # In any case, check its actual version for compatibility from six import StringIO # Python 2 and 3 compatible mybuf = StringIO() - cmd_v = "{} --version".format(python_exe) + cmd_v = "\"{}\" --version".format(python_exe) self.run(cmd_v, output=mybuf) verstr = mybuf.getvalue().strip().split("Python ")[1] if verstr.endswith("+"): @@ -167,7 +168,7 @@ def build_requirements(self): else: msg = ("Found Python 2 in path, but with invalid version {}" " (QtWebEngine requires >= {} & < " - "{})".format(verstr, v_min, v_max)) + "{})\nIf you have both Python 2 and 3 installed, copy the python 2 executable to python2(.exe)".format(verstr, v_min, v_max)) raise ConanInvalidConfiguration(msg) def config_options(self): @@ -796,7 +797,7 @@ def _create_plugin(pluginname, libname, type, requires): gui_reqs.append("xorg::xorg") if not tools.cross_building(self, skip_x64_x86=True): gui_reqs.append("xkbcommon::xkbcommon") - if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + if self.options.get_safe("opengl", "no") != "no": gui_reqs.append("opengl::opengl") if self.options.with_harfbuzz: gui_reqs.append("harfbuzz::harfbuzz") @@ -874,6 +875,9 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.qtwayland and self.options.gui: _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) + + if self.options.qtwebengine and self.options.gui: + _create_module("WebEngine", ["Gui", "Quick"]) if not self.options.shared: diff --git a/recipes/qt/5.x.x/patches/QTBUG-88625.diff b/recipes/qt/5.x.x/patches/QTBUG-88625.diff new file mode 100644 index 0000000000000..ed0c1fd48d82c --- /dev/null +++ b/recipes/qt/5.x.x/patches/QTBUG-88625.diff @@ -0,0 +1,58 @@ +Fix compile errors in QtWebEngine when building with VS2019 >= 16.8.0 . +See https://bugreports.qt.io/browse/QTBUG-88625 and +https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/321741 . + +diff -u -r a/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp b/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp +--- a/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp 2021-05-20 13:38:32.243947800 +0200 ++++ b/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp 2021-05-20 12:25:30.392900700 +0200 +@@ -72,11 +72,11 @@ + const RGB9E5Data *inputData = reinterpret_cast(&input); + + *red = +- inputData->R * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); ++ inputData->R * (float)pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); + *green = +- inputData->G * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); ++ inputData->G * (float)pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); + *blue = +- inputData->B * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); ++ inputData->B * (float)pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); + } + + } // namespace gl +diff -u -r a/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h b/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h +--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h 2020-11-07 02:22:36.000000000 +0100 ++++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h 2021-05-20 13:39:42.890109500 +0200 +@@ -130,7 +130,7 @@ + // https://en.wikipedia.org/wiki/CIELAB_color_space#Forward_transformation. + FloatPoint3D toXYZ(const FloatPoint3D& lab) const { + auto invf = [](float x) { +- return x > kSigma ? pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); ++ return x > kSigma ? (float)pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); + }; + + FloatPoint3D v = {clamp(lab.X(), 0.0f, 100.0f), +diff -u -r a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h +--- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h 2020-11-07 02:22:36.000000000 +0100 ++++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h 2021-05-20 13:41:08.983902900 +0200 +@@ -197,6 +197,20 @@ + } + return *this; + } ++ ++ #if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC) ++ TimestampedTracePiece& operator=(TimestampedTracePiece&& ttp) const ++ { ++ if (this != &ttp) { ++ // First invoke the destructor and then invoke the move constructor ++ // inline via placement-new to implement move-assignment. ++ this->~TimestampedTracePiece(); ++ new (const_cast(this)) TimestampedTracePiece(std::move(ttp)); ++ } ++ ++ return const_cast(*this); ++ } ++#endif // PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC) + + ~TimestampedTracePiece() { + switch (type) { From 632e944c75e21c4f6792e0be7395813591ea3ff5 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Fri, 21 May 2021 10:47:28 +0200 Subject: [PATCH 03/16] Backport Qt component support from qt6 recipe to qt5 recipe (resolves #4529). Move invalid configuration checks to validate function. Mark building QtWebEngine on Linux as currently broken. --- recipes/qt/5.x.x/conanfile.py | 82 ++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index d19f22e98965d..46cd69d3eb743 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -148,7 +148,7 @@ def build_requirements(self): msg = ("Python2 must be available in PATH " "in order to build Qt WebEngine") raise ConanInvalidConfiguration(msg) - + # In any case, check its actual version for compatibility from six import StringIO # Python 2 and 3 compatible mybuf = StringIO() @@ -168,7 +168,8 @@ def build_requirements(self): else: msg = ("Found Python 2 in path, but with invalid version {}" " (QtWebEngine requires >= {} & < " - "{})\nIf you have both Python 2 and 3 installed, copy the python 2 executable to python2(.exe)".format(verstr, v_min, v_max)) + "{})\nIf you have both Python 2 and 3 installed, copy the python 2 executable to" + "python2(.exe)".format(verstr, v_min, v_max)) raise ConanInvalidConfiguration(msg) def config_options(self): @@ -192,9 +193,6 @@ def configure(self): #if self.settings.os != "Linux": # self.options.with_libiconv = False # QTBUG-84708 - if self.options.widgets and not self.options.gui: - raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " - "You can either disable qt:widgets or enable qt:gui") if not self.options.gui: del self.options.opengl del self.options.with_vulkan @@ -208,38 +206,12 @@ def configure(self): del self.options.with_libalsa del self.options.with_openal - if self.options.qtwebengine: - if not self.options.shared: - raise ConanInvalidConfiguration("Static builds of Qt Webengine are not supported") - - if tools.cross_building(self.settings, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") - - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported") - - if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": - raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") - - if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": - raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") - - if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): - raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") - - if self.options.multiconfiguration: - del self.settings.build_type - - if not self.options.with_doubleconversion and str(self.settings.compiler.libcxx) != "libc++": - raise ConanInvalidConfiguration("Qt without libc++ needs qt:with_doubleconversion. " - "Either enable qt:with_doubleconversion or switch to libc++") - if tools.os_info.is_linux: if self.options.qtwebengine: self.options.with_fontconfig = True - if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: - raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + if self.options.multiconfiguration: + del self.settings.build_type config = configparser.ConfigParser() config.read(os.path.join(self.recipe_folder, "qtmodules%s.conf" % self.version)) @@ -273,6 +245,48 @@ def _enablemodule(mod): if self.options.get_safe(module): _enablemodule(module) + def validate(self): + if self.options.widgets and not self.options.gui: + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") + + if self.options.qtwebengine: + if not self.options.shared: + raise ConanInvalidConfiguration("Static builds of Qt Webengine are not supported") + + if tools.cross_building(self.settings, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") + + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported") + + if self.settings.os == "Linux": + #Linking of QtWebEngine shared library fails with unresolved error to freetype. + raise ConanInvalidConfiguration("Building QtWebEngine on Linux will currently result in a build error.") + + if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") + + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if not self.options.with_doubleconversion and str(self.settings.compiler.libcxx) != "libc++": + raise ConanInvalidConfiguration("Qt without libc++ needs qt:with_doubleconversion. " + "Either enable qt:with_doubleconversion or switch to libc++") + + if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: + raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + + if self.settings.compiler == "apple-clang": + if tools.Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") + if self.settings.compiler in ["gcc", "clang"]: + if tools.Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0") + def requirements(self): self.requires("zlib/1.2.11") if self.options.openssl: @@ -875,7 +889,7 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.qtwayland and self.options.gui: _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) - + if self.options.qtwebengine and self.options.gui: _create_module("WebEngine", ["Gui", "Quick"]) From 1dcef67daec40519abbe1e00e28d76ea4a43b24d Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Sat, 22 May 2021 16:01:03 +0200 Subject: [PATCH 04/16] Backport Qt component support from qt6 recipe to qt5 recipe (resolves #4529). Fix test package build errors on MacOS --- recipes/qt/5.x.x/test_package/CMakeLists.txt | 2 +- recipes/qt/5.x.x/test_package/conanfile.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/test_package/CMakeLists.txt b/recipes/qt/5.x.x/test_package/CMakeLists.txt index 2344121caf236..5f0647c685c50 100644 --- a/recipes/qt/5.x.x/test_package/CMakeLists.txt +++ b/recipes/qt/5.x.x/test_package/CMakeLists.txt @@ -9,7 +9,7 @@ conan_set_vs_runtime() conan_set_libcxx() conan_output_dirs_setup() -find_package(Qt5Core REQUIRED CONFIG) +find_package(Qt5 COMPONENTS Core REQUIRED CONFIG) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py index 39b3ed2296ede..dd80e338f9652 100644 --- a/recipes/qt/5.x.x/test_package/conanfile.py +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -10,6 +10,7 @@ class TestPackageConan(ConanFile): generators = "qt", "cmake", "cmake_find_package_multi", "qmake" def build_requirements(self): + self.build_requires("cmake/3.20.2") if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self._meson_supported(): From d9dde78dd802b47df7fc9e2bfc4e25d494887a1b Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Wed, 26 May 2021 17:23:44 +0200 Subject: [PATCH 05/16] Backport Qt component support from qt6 recipe to qt5 recipe (resolves #4529). Not all Qt modules are added to package_info() yet. --- recipes/qt/5.x.x/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 46cd69d3eb743..8660a09bf20b3 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -893,6 +893,12 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.qtwebengine and self.options.gui: _create_module("WebEngine", ["Gui", "Quick"]) + if self.options.qtserialport: + _create_module("SerialPort") + + if self.options.qtserialbus: + _create_module("SerialBus") + if not self.options.shared: if self.settings.os == "Windows": From 1af601559625051a2504c1bda797115fca88d78e Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Thu, 27 May 2021 19:16:16 +0200 Subject: [PATCH 06/16] Qt5: Add most of the remaining components in package_info. (resolves #4529) --- recipes/qt/5.x.x/conanfile.py | 106 +++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 3 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 8660a09bf20b3..37d31a837f91f 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -33,7 +33,7 @@ def content(self): class QtConan(ConanFile): _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtscript", "qtmultimedia", "qttools", "qtxmlpatterns", - "qttranslations", "qtdoc", "qtlocation", "qtsensors", "qtconnectivity", "qtwayland", + "qttranslations", "qtdoc", "qtlocation", "qtsensors", "qtbluetooth", "qtwayland", "qt3d", "qtimageformats", "qtgraphicaleffects", "qtquickcontrols", "qtserialbus", "qtserialport", "qtx11extras", "qtmacextras", "qtwinextras", "qtandroidextras", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", "qtquickcontrols2", "qtpurchasing", "qtcharts", "qtdatavis3d", "qtvirtualkeyboard", "qtgamepad", "qtscxml", @@ -890,14 +890,114 @@ def _create_plugin(pluginname, libname, type, requires): _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) + if self.options.qtlocation: + _create_module("Positioning") + _create_module("Location", ["Gui", "Quick"]) + _create_plugin("QGeoServiceProviderFactoryMapbox", "qtgeoservices_mapbox", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryMapboxGL", "qtgeoservices_mapboxgl", "geoservices", []) + _create_plugin("GeoServiceProviderFactoryEsri", "qtgeoservices_esri", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryItemsOverlay", "qtgeoservices_itemsoverlay", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryNokia", "qtgeoservices_nokia", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryOsm", "qtgeoservices_osm", "geoservices", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue", "qtposition_geoclue", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue2", "qtposition_geoclue2", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryPoll", "qtposition_positionpoll", "position", []) + _create_plugin("QGeoPositionInfoSourceFactorySerialNmea", "qtposition_serialnmea", "position", []) + + if self.options.qtwebchannel: + _create_module("WebChannel", ["Qml"]) + if self.options.qtwebengine and self.options.gui: - _create_module("WebEngine", ["Gui", "Quick"]) + _create_module("WebEngineCore", ["Gui", "Quick", "WebChannel", "Positioning", "expat::expat"] + _create_module("WebEngine", ["WebEngineCore"]) + _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) if self.options.qtserialport: _create_module("SerialPort") if self.options.qtserialbus: - _create_module("SerialBus") + _create_module("SerialBus", ["SerialPort"]) + _create_plugin("PassThruCanBusPlugin", "qtpassthrucanbus", "canbus", []) + _create_plugin("PeakCanBusPlugin", "qtpeakcanbus", "canbus", []) + _create_plugin("SocketCanBusPlugin", "qtsocketcanbus", "canbus", []) + _create_plugin("TinyCanBusPlugin", "qttinycanbus", "canbus", []) + _create_plugin("VirtualCanBusPlugin", "qtvirtualcanbus", "canbus", []) + + if self.options.qtsensors: + _create_module("Sensors") + _create_plugin("genericSensorPlugin", "qtsensors_generic", "sensors", []) + _create_plugin("IIOSensorProxySensorPlugin", "qtsensors_iio-sensor-proxy", "sensors", []) + if self.settings.os == "Linux": + _create_plugin("LinuxSensorPlugin", "qtsensors_linuxsys", "sensors", []) + _create_plugin("QtSensorGesturePlugin", "qtsensorgestures_plugin", "sensorgestures", []) + _create_plugin("QShakeSensorGesturePlugin", "qtsensorgestures_shakeplugin", "sensorgestures", []) + + if self.options.qtscxml: + _create_module("Scxml", ["Qml"]) + + if self.options.qtpurchasing: + _create_module("Purchasing") + + if self.options.qtcharts: + _create_module("Charts", ["Gui", "Widgets"]) + + if self.options.qt3d: + _create_module("3DCore", ["Gui", "Network"]) + + _create_module("3DRender", ["3DCore"]) + _create_plugin("DefaultGeometryLoaderPlugin", "defaultgeometryloader", "geometryloaders", []) + _create_plugin("GLTFGeometryLoaderPlugin", "gltfgeometryloader", "geometryloaders", []) + _create_plugin("GLTFSceneExportPlugin", "gltfsceneexport", "sceneparsers", []) + _create_plugin("GLTFSceneImportPlugin", "gltfsceneimport", "sceneparsers", []) + _create_plugin("OpenGLRendererPlugin", "openglrenderer", "renderers", []) + _create_plugin("Scene2DPlugin", "scene2d", "renderplugins", []) + + _create_module("3DAnimation", ["3DRender", "3DCore", "Gui"]) + _create_module("3DInput", ["3DCore", "GamePad", "Gui"]) + _create_module("3DLogic", ["3DCore", "Gui"]) + _create_module("3DExtras", ["3DRender", "3DInput", "3DLogic", "3DCore", "Gui"]) + _create_module("3DQuick", ["3DCore", "Quick", "Gui", "Qml"]) + _create_module("3DQuickAnimation", ["3DAnimation", "3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickExtras", ["3DExtras", "3DInput", "3DQuick", "3DRender", "3DLogic", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickInput", ["3DInput", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickRender", ["3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickScene2D", ["3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + + if self.options.qtgamepad: + _create_module("Gamepad", ["Gui"]) + if self.settings.os == "Linux": + _create_plugin("QEvdevGamepadBackendPlugin", "evdevgamepad", "gamepads", []) + if self.settings.os == "Macos": + #TODO + pass + if self.settings.os =="Windows": + _create_plugin("QXInputGamepadBackendPlugin", "xinputgamepad", "gamepads", []) + + if self.options.qtmultimedia: + _create_module("Multimedia", ["Network", "Gui"]) + _create_module("MultimediaWidgets", ["Multimedia", "Widgets", "Gui"]) + _create_module("MultimediaQuick", ["Multimedia", "Quick"]) + _create_plugin("QM3uPlaylistPlugin", "qtmultimedia_m3u", "playlistformats", []) + if self.settings.os == "Linux": + _create_module("MultimediaGstTools", ["Multimedia", "MultimediaWidgets", "Gui"]) + _create_plugin("CameraBinServicePlugin", "gstcamerabin", "mediaservice", []) + _create_plugin("QAlsaPlugin", "qtaudio_alsa", "audio", []) + _create_plugin("QGstreamerAudioDecoderServicePlugin", "gstaudiodecoder", "mediaservice", []) + _create_plugin("QGstreamerCaptureServicePlugin", "gstmediacapture", "mediaservice", []) + _create_plugin("QGstreamerPlayerServicePlugin", "gstmediaplayer", "mediaservice", []) + if self.settings.os == "Windows": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) + _create_plugin("QWindowsAudioPlugin", "qtaudio_windows", "audio", []) + if self.settings.os == "Macos": + #TODO + pass + + if self.options.qtwebsockets: + _create_module("WebSockets", ["Network"]) + + if self.options.qtbluetooth: + _create_module("Bluetooth", []) if not self.options.shared: From 4e5a70dc24725d9d1532494e5c85fa1275819167 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Thu, 27 May 2021 20:34:48 +0200 Subject: [PATCH 07/16] Change qtbluetooth module to qtconnectivity again, rebase to master --- recipes/qt/5.x.x/conanfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 37d31a837f91f..552f1d040f6ee 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -33,7 +33,7 @@ def content(self): class QtConan(ConanFile): _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtscript", "qtmultimedia", "qttools", "qtxmlpatterns", - "qttranslations", "qtdoc", "qtlocation", "qtsensors", "qtbluetooth", "qtwayland", + "qttranslations", "qtdoc", "qtlocation", "qtsensors", "qtconnectivity", "qtwayland", "qt3d", "qtimageformats", "qtgraphicaleffects", "qtquickcontrols", "qtserialbus", "qtserialport", "qtx11extras", "qtmacextras", "qtwinextras", "qtandroidextras", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", "qtquickcontrols2", "qtpurchasing", "qtcharts", "qtdatavis3d", "qtvirtualkeyboard", "qtgamepad", "qtscxml", @@ -908,7 +908,7 @@ def _create_plugin(pluginname, libname, type, requires): _create_module("WebChannel", ["Qml"]) if self.options.qtwebengine and self.options.gui: - _create_module("WebEngineCore", ["Gui", "Quick", "WebChannel", "Positioning", "expat::expat"] + _create_module("WebEngineCore", ["Gui", "Quick", "WebChannel", "Positioning", "expat::expat"]) _create_module("WebEngine", ["WebEngineCore"]) _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) @@ -996,8 +996,9 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.qtwebsockets: _create_module("WebSockets", ["Network"]) - if self.options.qtbluetooth: - _create_module("Bluetooth", []) + if self.options.qtconnectivity: + _create_module("Bluetooth", ["Network"]) + _create_module("Nfc", []) if not self.options.shared: From 74ca0b379c194174fe281a965c01bc96d2908011 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Fri, 28 May 2021 19:24:32 +0200 Subject: [PATCH 08/16] Qt5: Add modules datavisualization and networkauth. (resolves #4529) --- recipes/qt/5.x.x/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 552f1d040f6ee..9744f1ba73eb7 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1000,6 +1000,11 @@ def _create_plugin(pluginname, libname, type, requires): _create_module("Bluetooth", ["Network"]) _create_module("Nfc", []) + if self.options.qtdatavis3d: + _create_module("DataVisualization", ["Gui"]) + + if self.options.qtnetworkauth: + _create_module("NetworkAuth", ["Network"]) if not self.options.shared: if self.settings.os == "Windows": From 567f403fdef26a0db10ef838fb8648d872e2afab Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Fri, 28 May 2021 20:26:50 +0200 Subject: [PATCH 09/16] Qt5: Add MacOs plugins. (resolves #4529) --- recipes/qt/5.x.x/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9744f1ba73eb7..7deaa70cc466a 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -968,8 +968,7 @@ def _create_plugin(pluginname, libname, type, requires): if self.settings.os == "Linux": _create_plugin("QEvdevGamepadBackendPlugin", "evdevgamepad", "gamepads", []) if self.settings.os == "Macos": - #TODO - pass + _create_plugin("QDarwinGamepadBackendPlugin", "darwingamepad", "gamepads", []) if self.settings.os =="Windows": _create_plugin("QXInputGamepadBackendPlugin", "xinputgamepad", "gamepads", []) @@ -990,8 +989,10 @@ def _create_plugin(pluginname, libname, type, requires): _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) _create_plugin("QWindowsAudioPlugin", "qtaudio_windows", "audio", []) if self.settings.os == "Macos": - #TODO - pass + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("AVFMediaPlayerServicePlugin", "qavfmediaplayer", "mediaservice", []) + _create_plugin("AVFServicePlugin", "qavfcamera", "mediaservice", []) + _create_plugin("CoreAudioPlugin", "qtaudio_coreaudio", "audio", []) if self.options.qtwebsockets: _create_module("WebSockets", ["Network"]) @@ -1015,7 +1016,6 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library self.cpp_info.components["qtNetwork"].system_libs.append("DnsApi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library - if self.settings.os == "Macos": self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework From f55dcfd2b32e4f92dd2a2b45e5e314c2299f8f03 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Sat, 29 May 2021 16:00:37 +0200 Subject: [PATCH 10/16] Qt5 components: with_mysql option is deleted for old compilers --- recipes/qt/5.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 7deaa70cc466a..423864c9be9c7 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -824,7 +824,7 @@ def _create_plugin(pluginname, libname, type, requires): _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) - if self.options.with_mysql: + if self.options.get_safe("with_mysql", False): _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldriver", ["libmysqlclient::libmysqlclient"]) if self.options.with_odbc: if self.settings.os != "Windows": From 8de7dab56cd1cae35e29d632a1a8255fd00d1305 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Tue, 1 Jun 2021 13:14:29 +0200 Subject: [PATCH 11/16] Implement feedback on PR #5691, remove not needed requirement and function --- recipes/qt/5.x.x/conanfile.py | 7 ------- recipes/qt/5.x.x/test_package/conanfile.py | 1 - 2 files changed, 8 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 423864c9be9c7..9fc04605f7809 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -663,9 +663,6 @@ def _getenvpath(var): def _cmake_executables_file(self): return os.path.join("lib", "cmake", "Qt5Core", "conan_qt_executables_variables.cmake") - def _cmake_qt5_private_file(self, module): - return os.path.join("lib", "cmake", "Qt5{0}".format(module), "conan_qt_qt5_{0}private.cmake".format(module.lower())) - def package(self): with tools.chdir("build_folder"): self.run("%s install" % self._make_program()) @@ -849,8 +846,6 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.qtdeclarative: _create_module("Qml", ["Network"]) - #self.cpp_info.components["qtQml"].build_modules["cmake_find_package"].append(self._cmake_qt5_private_file("Qml")) - #self.cpp_info.components["qtQml"].build_modules["cmake_find_package_multi"].append(self._cmake_qt5_private_file("Qml")) _create_module("QmlModels", ["Qml"]) self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" @@ -1024,8 +1019,6 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components["qtCore"].builddirs.append(os.path.join("res","archdatadir","bin")) self.cpp_info.components["qtCore"].build_modules["cmake_find_package"].append(self._cmake_executables_file) self.cpp_info.components["qtCore"].build_modules["cmake_find_package_multi"].append(self._cmake_executables_file) - #self.cpp_info.components["qtCore"].build_modules["cmake_find_package"].append(self._cmake_qt5_private_file("Core")) - #self.cpp_info.components["qtCore"].build_modules["cmake_find_package_multi"].append(self._cmake_qt5_private_file("Core")) for m in os.listdir(os.path.join("lib", "cmake")): module = os.path.join("lib", "cmake", m, "%sMacros.cmake" % m) diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py index dd80e338f9652..39b3ed2296ede 100644 --- a/recipes/qt/5.x.x/test_package/conanfile.py +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -10,7 +10,6 @@ class TestPackageConan(ConanFile): generators = "qt", "cmake", "cmake_find_package_multi", "qmake" def build_requirements(self): - self.build_requires("cmake/3.20.2") if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self._meson_supported(): From 2debdacd14ef21f84277d2ce61224eb5537aa6bd Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Thu, 10 Jun 2021 23:28:00 +0200 Subject: [PATCH 12/16] Qt5: add fixes that were lost with last rebase, re-enable QtWebEngine on Linux --- recipes/qt/5.x.x/conanfile.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9fc04605f7809..9719e5cf6fb46 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -247,12 +247,15 @@ def _enablemodule(mod): def validate(self): if self.options.widgets and not self.options.gui: - raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " - "You can either disable qt:widgets or enable qt:gui") + raise ConanInvalidConfiguration("using option qt5:widgets without option qt5:gui is not possible. " + "You can either disable qt5:widgets or enable qt5:gui") if self.options.qtwebengine: if not self.options.shared: - raise ConanInvalidConfiguration("Static builds of Qt Webengine are not supported") + raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") + + if not self.options.gui and self.options.qtdeclarative and self.options.qtlocation and self.options.qtwebchannel: + raise ConanInvalidConfiguration("option qt5:qtwebengine requires also qt5:gui, qt5:qtdeclarative, qt5:qtlocation and qt5:qtwebchannel") if tools.cross_building(self.settings, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") @@ -260,10 +263,6 @@ def validate(self): if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported") - if self.settings.os == "Linux": - #Linking of QtWebEngine shared library fails with unresolved error to freetype. - raise ConanInvalidConfiguration("Building QtWebEngine on Linux will currently result in a build error.") - if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") @@ -779,7 +778,7 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname self.cpp_info.components[componentname].libs = [libname + libsuffix] - self.cpp_info.components[componentname].libdirs = [os.path.join("res", "archdatadir", "plugins", type)] + self.cpp_info.components[componentname].libdirs = [os.path.join("bin", "archdatadir", "plugins", type)] self.cpp_info.components[componentname].includedirs = [] if "Core" not in requires: requires.append("Core") @@ -839,7 +838,7 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.get_safe("opengl", "no") != "no" and self.options.gui: _create_module("OpenGL", ["Gui"]) if self.options.widgets and self.options.get_safe("opengl", "no") != "no": - _create_module("OpenGLWidgets", ["OpenGL", "Widgets"]) + _create_module("OpenGLExtensions", ["Gui"]) _create_module("DBus") _create_module("Concurrent") _create_module("Xml") @@ -902,8 +901,8 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.qtwebchannel: _create_module("WebChannel", ["Qml"]) - if self.options.qtwebengine and self.options.gui: - _create_module("WebEngineCore", ["Gui", "Quick", "WebChannel", "Positioning", "expat::expat"]) + if self.options.qtwebengine: + _create_module("WebEngineCore", ["Gui", "Quick", "WebChannel", "Positioning", "expat::expat", "opus::libopus"]) _create_module("WebEngine", ["WebEngineCore"]) _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) @@ -1016,7 +1015,7 @@ def _create_plugin(pluginname, libname, type, requires): self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework self.cpp_info.components["qtCore"].frameworks.append("Security") # qtcore requires "_SecRequirementCreateWithString" and more, which are in "Security" framework - self.cpp_info.components["qtCore"].builddirs.append(os.path.join("res","archdatadir","bin")) + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin","archdatadir","bin")) self.cpp_info.components["qtCore"].build_modules["cmake_find_package"].append(self._cmake_executables_file) self.cpp_info.components["qtCore"].build_modules["cmake_find_package_multi"].append(self._cmake_executables_file) From 5c9e92d0f4c0fddaa21b40ead587233f3cc8ff37 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Thu, 10 Jun 2021 23:33:48 +0200 Subject: [PATCH 13/16] Re-add typo fix for sqldrivers plugin type, was lost in last rebase --- recipes/qt/5.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9719e5cf6fb46..84985856e7d94 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -821,7 +821,7 @@ def _create_plugin(pluginname, libname, type, requires): if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) if self.options.get_safe("with_mysql", False): - _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldriver", ["libmysqlclient::libmysqlclient"]) + _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["libmysqlclient::libmysqlclient"]) if self.options.with_odbc: if self.settings.os != "Windows": _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) From c357dadee8f46746e7ac65ad5ea636f8fbb9212b Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Fri, 11 Jun 2021 14:14:18 +0200 Subject: [PATCH 14/16] Don't link to qt plugins when qt:shared=True. Implement PR feedback. --- recipes/qt/5.x.x/conanfile.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 84985856e7d94..184fc8317b8a0 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -247,15 +247,15 @@ def _enablemodule(mod): def validate(self): if self.options.widgets and not self.options.gui: - raise ConanInvalidConfiguration("using option qt5:widgets without option qt5:gui is not possible. " - "You can either disable qt5:widgets or enable qt5:gui") + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") if self.options.qtwebengine: if not self.options.shared: raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") - if not self.options.gui and self.options.qtdeclarative and self.options.qtlocation and self.options.qtwebchannel: - raise ConanInvalidConfiguration("option qt5:qtwebengine requires also qt5:gui, qt5:qtdeclarative, qt5:qtlocation and qt5:qtwebchannel") + if not (self.options.gui and self.options.qtdeclarative and self.options.qtlocation and self.options.qtwebchannel): + raise ConanInvalidConfiguration("option qt:qtwebengine requires also qt:gui, qt:qtdeclarative, qt:qtlocation and qt:qtwebchannel") if tools.cross_building(self.settings, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") @@ -777,7 +777,8 @@ def _create_plugin(pluginname, libname, type, requires): assert componentname not in self.cpp_info.components, "Plugin %s already present in self.cpp_info.components" % pluginname self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname - self.cpp_info.components[componentname].libs = [libname + libsuffix] + if not self.options.shared: + self.cpp_info.components[componentname].libs = [libname + libsuffix] self.cpp_info.components[componentname].libdirs = [os.path.join("bin", "archdatadir", "plugins", type)] self.cpp_info.components[componentname].includedirs = [] if "Core" not in requires: From 118b92df0df091e119ed2eaa9b46758875cf36d6 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Tue, 15 Jun 2021 12:44:16 +0200 Subject: [PATCH 15/16] PR feedback. Upgrade dependencies to latest version. --- recipes/qt/5.x.x/conanfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 184fc8317b8a0..6f17ac727f6a0 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -291,10 +291,10 @@ def requirements(self): if self.options.openssl: self.requires("openssl/1.1.1k") if self.options.with_pcre2: - self.requires("pcre2/10.36") + self.requires("pcre2/10.37") if self.options.with_glib: - self.requires("glib/2.68.1") + self.requires("glib/2.68.3") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -304,7 +304,7 @@ def requirements(self): if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.93") if self.options.get_safe("with_icu", False): - self.requires("icu/68.2") + self.requires("icu/69.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: self.requires("harfbuzz/2.8.1") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: @@ -318,7 +318,7 @@ def requirements(self): self.requires("sqlite3/3.35.5") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): - self.requires("libmysqlclient/8.0.17") + self.requires("libmysqlclient/8.0.25") if self.options.with_pq: self.requires("libpq/13.2") if self.options.with_odbc: @@ -331,7 +331,7 @@ def requirements(self): if self.options.gui and self.settings.os == "Linux": self.requires("xorg/system") if not tools.cross_building(self, skip_x64_x86=True): - self.requires("xkbcommon/1.2.1") + self.requires("xkbcommon/1.3.0") if self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: @@ -751,7 +751,7 @@ def package_info(self): if self.settings.build_type == "Debug": if self.settings.os == "Windows": libsuffix = "d" - if tools.is_apple_os(self.settings.os): + elif tools.is_apple_os(self.settings.os): libsuffix = "_debug" def _get_corrected_reqs(requires): From 3e539a709bdfbb19b2c10b90a82fd25426cd9580 Mon Sep 17 00:00:00 2001 From: Winfried Dobbe Date: Tue, 15 Jun 2021 13:24:15 +0200 Subject: [PATCH 16/16] Increase expat dependency version to 2.4.1. --- recipes/qt/5.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 6f17ac727f6a0..e378b6fbb1439 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -337,7 +337,7 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.0") if self.options.qtwebengine and self.settings.os == "Linux": - self.requires("expat/2.3.0") + self.requires("expat/2.4.1") self.requires("opus/1.3.1") def source(self):