From bd4cd89c551fa02c369201be21d273b90f0af639 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 28 May 2020 00:01:11 +0200 Subject: [PATCH 01/61] qt/5.15.0 --- recipes/qt/all/conandata.yml | 14 + recipes/qt/all/conanfile.py | 662 +++++++++++++++++++ recipes/qt/all/patches/aa2a39dea5.diff | 29 + recipes/qt/all/patches/c72097e.diff | 42 ++ recipes/qt/all/patches/c994a33.diff | 27 + recipes/qt/all/patches/e2eb6e9.diff | 27 + recipes/qt/all/qtmodules.conf | 284 ++++++++ recipes/qt/all/test_package/CMakeLists.txt | 22 + recipes/qt/all/test_package/conanfile.py | 120 ++++ recipes/qt/all/test_package/greeter.h | 26 + recipes/qt/all/test_package/meson.build | 6 + recipes/qt/all/test_package/test_package.cpp | 22 + recipes/qt/all/test_package/test_package.pro | 7 + recipes/qt/config.yml | 3 + 14 files changed, 1291 insertions(+) create mode 100644 recipes/qt/all/conandata.yml create mode 100644 recipes/qt/all/conanfile.py create mode 100644 recipes/qt/all/patches/aa2a39dea5.diff create mode 100644 recipes/qt/all/patches/c72097e.diff create mode 100644 recipes/qt/all/patches/c994a33.diff create mode 100644 recipes/qt/all/patches/e2eb6e9.diff create mode 100644 recipes/qt/all/qtmodules.conf create mode 100644 recipes/qt/all/test_package/CMakeLists.txt create mode 100644 recipes/qt/all/test_package/conanfile.py create mode 100644 recipes/qt/all/test_package/greeter.h create mode 100644 recipes/qt/all/test_package/meson.build create mode 100644 recipes/qt/all/test_package/test_package.cpp create mode 100644 recipes/qt/all/test_package/test_package.pro create mode 100644 recipes/qt/config.yml diff --git a/recipes/qt/all/conandata.yml b/recipes/qt/all/conandata.yml new file mode 100644 index 0000000000000..15323311b7ba2 --- /dev/null +++ b/recipes/qt/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "5.15.0": + url: "https://download.qt.io/archive/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz" + sha256: "22b63d7a7a45183865cc4141124f12b673e7a17b1fe2b91e433f6547c5d548c3" +patches: + "5.15.0": + - patch_file: "patches/aa2a39dea5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c72097e.diff" + base_path: "qt5/qtwebengine" + - patch_file: "patches/e2eb6e9.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c994a33.diff" + base_path: "qt5/qtbase" diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py new file mode 100644 index 0000000000000..3db000591b18c --- /dev/null +++ b/recipes/qt/all/conanfile.py @@ -0,0 +1,662 @@ +import os +import shutil +import itertools +import glob + +import configparser +from conans import ConanFile, tools, __version__ as conan_version, RunEnvironment +from conans.errors import ConanInvalidConfiguration +from conans.model import Generator +from conans.tools import Version + + +class qt(Generator): + @property + def filename(self): + return "qt.conf" + + @property + def content(self): + return "[Paths]\nPrefix = %s\n" % self.conanfile.deps_cpp_info["qt"].rootpath.replace("\\", "/") + + +def _getsubmodules(): + config = configparser.ConfigParser() + config.read('qtmodules.conf') + res = {} + assert config.sections() + for s in config.sections(): + section = str(s) + assert section.startswith("submodule ") + assert section.count('"') == 2 + modulename = section[section.find('"') + 1: section.rfind('"')] + status = str(config.get(section, "status")) + if status != "obsolete" and status != "ignore": + res[modulename] = {"status": status, + "path": str(config.get(section, "path")), "depends": []} + if config.has_option(section, "depends"): + res[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] + return res + + +class QtConan(ConanFile): + + _submodules = _getsubmodules() + + generators = "pkg_config" + name = "qt" + description = "Qt is a cross-platform framework for graphical user interfaces." + topics = ("conan", "qt", "ui") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.qt.io" + license = "LGPL-3.0" + exports = ["qtmodules.conf", "patches/*.diff"] + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "commercial": [True, False], + + "opengl": ["no", "es2", "desktop", "dynamic"], + "with_vulkan": [True, False], + "openssl": [True, False], + "with_pcre2": [True, False], + "with_glib": [True, False], + # "with_libiconv": [True, False], # Qt tests failure "invalid conversion from const char** to char**" + "with_doubleconversion": [True, False], + "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_icu": [True, False], + "with_harfbuzz": [True, False], + "with_libjpeg": [True, False], + "with_libpng": [True, False], + "with_sqlite3": [True, False], + "with_mysql": [True, False], + "with_pq": [True, False], + "with_odbc": [True, False], + "with_libalsa": [True, False], + "with_openal": [True, False], + "with_zstd": [True, False], + + "GUI": [True, False], + "widgets": [True, False], + + "device": "ANY", + "cross_compile": "ANY", + "sysroot": "ANY", + "config": "ANY", + "multiconfiguration": [True, False], + } + options.update({module: [True, False] for module in _submodules if module != 'qtbase'}) + + no_copy_source = True + default_options = { + "shared": True, + "commercial": False, + "opengl": "desktop", + "with_vulkan": False, + "openssl": True, + "with_pcre2": True, + "with_glib": True, + # "with_libiconv": True, + "with_doubleconversion": True, + "with_freetype": True, + "with_fontconfig": True, + "with_icu": True, + "with_harfbuzz": True, + "with_libjpeg": True, + "with_libpng": True, + "with_sqlite3": True, + "with_mysql": True, + "with_pq": True, + "with_odbc": True, + "with_libalsa": False, + "with_openal": True, + "with_zstd": True, + + "GUI": True, + "widgets": True, + + "device": None, + "cross_compile": None, + "sysroot": None, + "config": None, + "multiconfiguration": False, + } + default_options.update({module: False for module in _submodules if module != 'qtbase'}) + + requires = "zlib/1.2.11" + short_paths = True + + def build_requirements(self): + if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": + self.build_requires("jom/1.1.3") + if self.options.qtwebengine: + self.build_requires("ninja/1.9.0") + # gperf, bison, flex, python >= 2.7.5 & < 3 + if self.settings.os != "Windows": + if not tools.which("bison"): + self.build_requires("bison/3.5.3") + if not tools.which("gperf"): + self.build_requires("gperf/3.1") + if not tools.which("flex"): + self.build_requires("flex/2.6.4") + + # Check if a valid python2 is available in PATH or it will failflex + # Start by checking if python2 can be found + python_exe = tools.which("python2") + if not python_exe: + # Fall back on regular python + python_exe = tools.which("python") + + if not python_exe: + 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) + self.run(cmd_v, output=mybuf) + verstr = mybuf.getvalue().strip().split('Python ')[1] + if verstr.endswith('+'): + verstr = verstr[:-1] + version = tools.Version(verstr) + # >= 2.7.5 & < 3 + v_min = "2.7.5" + v_max = "3.0.0" + if (version >= v_min) and (version < v_max): + msg = ("Found valid Python 2 required for QtWebengine:" + " version={}, path={}".format(mybuf.getvalue(), python_exe)) + self.output.success(msg) + else: + msg = ("Found Python 2 in path, but with invalid version {}" + " (QtWebEngine requires >= {} & < " + "{})".format(verstr, v_min, v_max)) + raise ConanInvalidConfiguration(msg) + + def config_options(self): + if self.settings.os != "Linux": + self.options.with_icu = False + + def configure(self): + if conan_version < Version("1.20.0"): + raise ConanInvalidConfiguration("This recipe needs at least conan 1.20.0, please upgrade.") + if self.settings.os != 'Linux': + # self.options.with_libiconv = False + self.options.with_fontconfig = False + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version.value) < "5.3": + self.options.with_mysql = False + if self.settings.os == "Windows": + self.options.with_mysql = False + if not self.options.shared and self.options.with_icu: + raise ConanInvalidConfiguration("icu option is not supported on windows in static build. see QTBUG-77120.") + + 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: + self.options.opengl = "no" + self.options.with_vulkan = False + self.options.with_freetype = False + self.options.with_fontconfig = False + self.options.with_harfbuzz = False + self.options.with_libjpeg = False + self.options.with_libpng = False + + if not self.options.qtmultimedia: + self.options.with_libalsa = False + self.options.with_openal = False + + if self.settings.os != "Linux": + self.options.with_libalsa = False + + 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.opengl == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") + + if self.settings.os != "Windows" and self.options.opengl == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.with_fontconfig and not self.options.with_freetype: + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if self.settings.os == "Macos": + del self.settings.os.version + + 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 + + def _enablemodule(mod): + if mod != 'qtbase': + setattr(self.options, mod, True) + for req in self._submodules[mod]["depends"]: + _enablemodule(req) + + for module in self._submodules: + if module != 'qtbase' and getattr(self.options, module): + _enablemodule(module) + + def requirements(self): + if self.options.openssl: + self.requires("openssl/1.1.1g") + if self.options.with_pcre2: + self.requires("pcre2/10.33") + + if self.options.with_glib: + self.requires("glib/2.64.0@bincrafters/stable") + # if self.options.with_libiconv: + # self.requires("libiconv/1.16") + if self.options.with_doubleconversion and not self.options.multiconfiguration: + self.requires("double-conversion/3.1.5") + if self.options.with_freetype and not self.options.multiconfiguration: + self.requires("freetype/2.10.1") + if self.options.with_fontconfig: + self.requires("fontconfig/2.13.91@conan/stable") + if self.options.with_icu: + self.requires("icu/64.2") + if self.options.with_harfbuzz and not self.options.multiconfiguration: + self.requires("harfbuzz/2.6.4@bincrafters/stable") + if self.options.with_libjpeg and not self.options.multiconfiguration: + self.requires("libjpeg/9d") + if self.options.with_libpng and not self.options.multiconfiguration: + self.requires("libpng/1.6.37") + if self.options.with_sqlite3 and not self.options.multiconfiguration: + self.requires("sqlite3/3.31.0") + self.options["sqlite3"].enable_column_metadata = True + if self.options.with_mysql: + self.requires("libmysqlclient/8.0.17") + if self.options.with_pq: + self.requires("libpq/11.5") + if self.options.with_odbc: + if self.settings.os != "Windows": + self.requires("odbc/2.3.7") + if self.options.with_openal: + self.requires("openal/1.19.1") + if self.options.with_libalsa: + self.requires("libalsa/1.1.9") + if self.options.GUI and self.settings.os == "Linux": + self.requires("xorg/system") + if self.options.with_zstd: + self.requires("zstd/1.4.4") + if self.options.qtwebengine and self.settings.os == "Linux": + self.requires("expat/2.2.9") + self.requires("opus/1.3.1") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + shutil.move("qt-everywhere-src-%s" % self.version, "qt5") + + for p in self.conan_data["patches"][self.version]: + tools.patch(**p) + for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: + tools.replace_in_file(os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + " if (enable_precompiled_headers) {\n if (is_win) {", + " if (enable_precompiled_headers) {\n if (false) {" + ) + + def _make_program(self): + if self.settings.compiler == "Visual Studio": + return "jom" + elif tools.os_info.is_windows: + return "mingw32-make" + else: + return "make" + + def _xplatform(self): + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + return {"x86": "linux-g++-32", + "armv6": "linux-arm-gnueabi-g++", + "armv7": "linux-arm-gnueabi-g++", + "armv7hf": "linux-arm-gnueabi-g++", + "armv8": "linux-aarch64-gnu-g++"}.get(str(self.settings.arch), "linux-g++") + elif self.settings.compiler == "clang": + if self.settings.arch == "x86": + return "linux-clang-libc++-32" if self.settings.compiler.libcxx == "libc++" else "linux-clang-32" + elif self.settings.arch == "x86_64": + return "linux-clang-libc++" if self.settings.compiler.libcxx == "libc++" else "linux-clang" + + elif self.settings.os == "Macos": + return {"clang": "macx-clang", + "apple-clang": "macx-clang", + "gcc": "macx-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "iOS": + if self.settings.compiler == "apple-clang": + return "macx-ios-clang" + + elif self.settings.os == "watchOS": + if self.settings.compiler == "apple-clang": + return "macx-watchos-clang" + + elif self.settings.os == "tvOS": + if self.settings.compiler == "apple-clang": + return "macx-tvos-clang" + + elif self.settings.os == "Android": + return {"clang": "android-clang", + "gcc": "android-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "Windows": + return {"Visual Studio": "win32-msvc", + "gcc": "win32-g++", + "clang": "win32-clang-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "WindowsStore": + if self.settings.compiler == "Visual Studio": + return {"14": {"armv7": "winrt-arm-msvc2015", + "x86": "winrt-x86-msvc2015", + "x86_64": "winrt-x64-msvc2015"}, + "15": {"armv7": "winrt-arm-msvc2017", + "x86": "winrt-x86-msvc2017", + "x86_64": "winrt-x64-msvc2017"} + }.get(str(self.settings.compiler.version)).get(str(self.settings.arch)) + + elif self.settings.os == "FreeBSD": + return {"clang": "freebsd-clang", + "gcc": "freebsd-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "SunOS": + if self.settings.compiler == "sun-cc": + if self.settings.arch == "sparc": + return "solaris-cc-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc" + elif self.settings.arch == "sparcv9": + return "solaris-cc64-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc64" + elif self.settings.compiler == "gcc": + return {"sparc": "solaris-g++", + "sparcv9": "solaris-g++-64"}.get(str(self.settings.arch)) + elif self.settings.os == "Neutrino" and self.settings.compiler == "qcc": + return {"armv8": "qnx-aarch64le-qcc", + "armv8.3": "qnx-aarch64le-qcc", + "armv7": "qnx-armle-v7-qcc", + "armv7hf": "qnx-armle-v7-qcc", + "armv7s": "qnx-armle-v7-qcc", + "armv7k": "qnx-armle-v7-qcc", + "x86": "qnx-x86-qcc", + "x86_64": "qnx-x86-64-qcc"}.get(str(self.settings.arch)) + elif self.settings.os == "Emscripten" and self.settings.arch == "wasm": + return "wasm-emscripten" + + return None + + def build(self): + args = ["-confirm-license", "-silent", "-nomake examples", "-nomake tests", + "-prefix %s" % self.package_folder] + args.append("-v") + if self.options.commercial: + args.append("-commercial") + else: + args.append("-opensource") + if not self.options.GUI: + args.append("-no-gui") + if not self.options.widgets: + args.append("-no-widgets") + if not self.options.shared: + args.insert(0, "-static") + if self.settings.compiler == "Visual Studio": + if self.settings.compiler.runtime == "MT" or self.settings.compiler.runtime == "MTd": + args.append("-static-runtime") + else: + args.insert(0, "-shared") + if self.options.multiconfiguration: + args.append("-debug-and-release") + elif self.settings.build_type == "Debug": + args.append("-debug") + elif self.settings.build_type == "Release": + args.append("-release") + elif self.settings.build_type == "RelWithDebInfo": + args.append("-release") + args.append("-force-debug-info") + elif self.settings.build_type == "MinSizeRel": + args.append("-release") + args.append("-optimize-size") + + for module in self._submodules: + if module != 'qtbase' and not getattr(self.options, module) \ + and os.path.isdir(os.path.join(self.source_folder, 'qt5', self._submodules[module]['path'])): + args.append("-skip " + module) + + args.append("--zlib=system") + + # openGL + if self.options.opengl == "no": + args += ["-no-opengl"] + elif self.options.opengl == "es2": + args += ["-opengl es2"] + elif self.options.opengl == "desktop": + args += ["-opengl desktop"] + elif self.options.opengl == "dynamic": + args += ["-opengl dynamic"] + + if self.options.with_vulkan: + args.append("-vulkan") + else: + args.append("-no-vulkan") + + # openSSL + if not self.options.openssl: + args += ["-no-openssl"] + else: + if self.options["openssl"].shared: + args += ["-openssl-runtime"] + else: + args += ["-openssl-linked"] + + # args.append("--iconv=" + ("gnu" if self.options.with_libiconv else "no")) + + args.append("--glib=" + ("yes" if self.options.with_glib else "no")) + args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) + args.append("--fontconfig=" + ("yes" if self.options.with_fontconfig else "no")) + args.append("--icu=" + ("yes" if self.options.with_icu else "no")) + args.append("--sql-mysql=" + ("yes" if self.options.with_mysql else "no")) + args.append("--sql-psql=" + ("yes" if self.options.with_pq else "no")) + args.append("--sql-odbc=" + ("yes" if self.options.with_odbc else "no")) + args.append("--zstd=" + ("yes" if self.options.with_zstd else "no")) + + if self.options.qtmultimedia: + args.append("--alsa=" + ("yes" if self.options.with_libalsa else "no")) + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_sqlite3", "sqlite")]: + if getattr(self.options, opt): + if self.options.multiconfiguration: + args += ["-qt-" + conf_arg] + else: + args += ["-system-" + conf_arg] + else: + args += ["-no-" + conf_arg] + + libmap = [("zlib", "ZLIB"), + ("openssl", "OPENSSL"), + ("pcre2", "PCRE2"), + ("glib", "GLIB"), + # ("libiconv", "ICONV"), + ("double-conversion", "DOUBLECONVERSION"), + ("freetype", "FREETYPE"), + ("fontconfig", "FONTCONFIG"), + ("icu", "ICU"), + ("harfbuzz", "HARFBUZZ"), + ("libjpeg", "LIBJPEG"), + ("libpng", "LIBPNG"), + ("sqlite3", "SQLITE"), + ("libmysqlclient", "MYSQL"), + ("libpq", "PSQL"), + ("odbc", "ODBC"), + ("sdl2", "SDL2"), + ("openal", "OPENAL"), + ("zstd", "ZSTD"), + ("libalsa", "ALSA"), + ("xkbcommon", "XKBCOMMON")] + for package, var in libmap: + if package in self.deps_cpp_info.deps: + if package == 'freetype': + args.append("\"%s_INCDIR=%s\"" % (var, self.deps_cpp_info[package].include_paths[-1])) + + args.append("\"%s_LIBS=%s\"" % (var, " ".join(self._gather_libs(package)))) + + for package in self.deps_cpp_info.deps: + args += ["-I " + s for s in self.deps_cpp_info[package].include_paths] + args += ["-D " + s for s in self.deps_cpp_info[package].defines] + args += ["-L " + s for s in self.deps_cpp_info[package].lib_paths] + + if 'libmysqlclient' in self.deps_cpp_info.deps: + args.append("-mysql_config " + os.path.join(self.deps_cpp_info['libmysqlclient'].rootpath, "bin", "mysql_config")) + if 'libpq' in self.deps_cpp_info.deps: + args.append("-psql_config " + os.path.join(self.deps_cpp_info['libpq'].rootpath, "bin", "pg_config")) + if self.settings.os == "Macos": + args += ["-no-framework"] + elif self.settings.os == "Android": + args += ["-android-ndk-platform android-%s" % self.settings.os.api_level] + args += ["-android-abis %s" % {"armv7": "armeabi-v7a", + "armv8": "arm64-v8a", + "x86": "x86", + "x86_64": "x86_64"}.get(str(self.settings.arch))] + + if self.settings.get_safe("compiler.libcxx") == "libstdc++": + args += ["-D_GLIBCXX_USE_CXX11_ABI=0"] + elif self.settings.get_safe("compiler.libcxx") == "libstdc++11": + args += ["-D_GLIBCXX_USE_CXX11_ABI=1"] + + if self.options.sysroot: + args += ["-sysroot %s" % self.options.sysroot] + + if self.options.device: + args += ["-device %s" % self.options.device] + else: + xplatform_val = self._xplatform() + if xplatform_val: + if not tools.cross_building(self.settings, skip_x64_x86=True): + args += ["-platform %s" % xplatform_val] + else: + args += ["-xplatform %s" % xplatform_val] + else: + self.output.warn("host not supported: %s %s %s %s" % + (self.settings.os, self.settings.compiler, + self.settings.compiler.version, self.settings.arch)) + if self.options.cross_compile: + args += ["-device-option CROSS_COMPILE=%s" % self.options.cross_compile] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath('CC') + if value: + args += ['QMAKE_CC="' + value + '"', + 'QMAKE_LINK_C="' + value + '"', + 'QMAKE_LINK_C_SHLIB="' + value + '"'] + + value = _getenvpath('CXX') + if value: + args += ['QMAKE_CXX="' + value + '"', + 'QMAKE_LINK="' + value + '"', + 'QMAKE_LINK_SHLIB="' + value + '"'] + + if tools.os_info.is_linux and self.settings.compiler == "clang": + args += ['QMAKE_CXXFLAGS+="-ftemplate-depth=1024"'] + + if self.options.qtwebengine and self.settings.os == "Linux": + args += ['-qt-webengine-ffmpeg', + '-system-webengine-opus'] + + if self.options.config: + args.append(str(self.options.config)) + + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [os.getcwd()]} + if self.options.qtwebengine: + if self.settings.compiler in ['gcc', 'clang']: + i_path = [] + l_path = [] + for p in ['fontconfig', 'libxcursor', 'libxi', 'libxtst', 'libxrandr', 'libxscrnsaver', 'libxcomposite', 'zlib', 'libxdamage']: + if p in self.deps_cpp_info.deps: + i_path.extend(self._gather_include_paths(p)) + l_path.extend(self._gather_lib_paths(p)) + build_env['C_INCLUDE_PATH'] = os.pathsep.join(i_path) + build_env['CPLUS_INCLUDE_PATH'] = os.pathsep.join(i_path) + build_env['LIBRARY_PATH'] = os.pathsep.join(l_path) + if self.settings.os == "Windows": + build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")] + with tools.environment_append(build_env): + self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True) + if tools.os_info.is_macos: + with open("bash_env", "w") as f: + f.write('export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"])) + with tools.environment_append({ + "BASH_ENV": os.path.abspath("bash_env") + }) if tools.os_info.is_macos else tools.no_op(): + self.run(self._make_program(), run_environment=True) + + with open('qtbase/bin/qt.conf', 'w') as f: + f.write('[Paths]\nPrefix = ..') + + def package(self): + self.run("%s install" % self._make_program()) + self.copy("bin/qt.conf", src="qtbase") + self.copy("*LICENSE*", src="qt5/", dst="licenses") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + for file_to_remove in glob.glob(os.path.join(self.package_folder, "lib", "*.la*")): + os.remove(file_to_remove) + + def package_id(self): + del self.info.options.cross_compile + del self.info.options.sysroot + + def package_info(self): + self.env_info.CMAKE_PREFIX_PATH.append(self.package_folder) + + @staticmethod + def _remove_duplicate(l): + seen = set() + seen_add = seen.add + for element in itertools.filterfalse(seen.__contains__, l): + seen_add(element) + yield element + + def _gather_libs(self, p): + libs = ["-l" + i for i in self.deps_cpp_info[p].libs + self.deps_cpp_info[p].system_libs] + if tools.is_apple_os(self.settings.os): + libs += ["-framework " + i for i in self.deps_cpp_info[p].frameworks] + libs += self.deps_cpp_info[p].sharedlinkflags + for dep in self.deps_cpp_info[p].public_deps: + libs += self._gather_libs(dep) + return self._remove_duplicate(libs) + + def _gather_lib_paths(self, p): + lib_paths = self.deps_cpp_info[p].lib_paths + for dep in self.deps_cpp_info[p].public_deps: + lib_paths += self._gather_lib_paths(dep) + return self._remove_duplicate(lib_paths) + + def _gather_include_paths(self, p): + include_paths = self.deps_cpp_info[p].include_paths + for dep in self.deps_cpp_info[p].public_deps: + include_paths += self._gather_include_paths(dep) + return self._remove_duplicate(include_paths) diff --git a/recipes/qt/all/patches/aa2a39dea5.diff b/recipes/qt/all/patches/aa2a39dea5.diff new file mode 100644 index 0000000000000..3fe3827463641 --- /dev/null +++ b/recipes/qt/all/patches/aa2a39dea5.diff @@ -0,0 +1,29 @@ +From aa2a39dea5918c63045310b0d2a7e34ce9934e0c Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 26 Nov 2019 12:47:47 +0100 +Subject: [PATCH] add inline source detection to glib + +this allows to use static version of glib (pkg-config only works with shared libraries) + +Change-Id: If9b0054985b87b8da43269425b32c2e4ffb65f5a +--- + src/corelib/configure.json | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/corelib/configure.json b/src/corelib/configure.json +index ae360239c6..998687dc4e 100644 +--- a/src/corelib/configure.json ++++ b/src/corelib/configure.json +@@ -45,7 +45,8 @@ + }, + "headers": "glib.h", + "sources": [ +- { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ++ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }, ++ "-lgthread-2.0 -lglib-2.0" + ] + }, + "posix_iconv": { +-- +2.23.0.windows.1 + diff --git a/recipes/qt/all/patches/c72097e.diff b/recipes/qt/all/patches/c72097e.diff new file mode 100644 index 0000000000000..56b2679d626fb --- /dev/null +++ b/recipes/qt/all/patches/c72097e.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +@@ -119,9 +119,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/all/patches/c994a33.diff b/recipes/qt/all/patches/c994a33.diff new file mode 100644 index 0000000000000..0829b02a69b79 --- /dev/null +++ b/recipes/qt/all/patches/c994a33.diff @@ -0,0 +1,27 @@ +From c994a334701ab80fcc154f5330492c751d1e2490 Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 26 May 2020 16:51:08 +0000 +Subject: [PATCH] QMimeDatabase/xml: use xmlstarlet instead of xml + +some distributions (eg Ubuntu) don't provide xml executable, but only xmlstarlet executable + +Change-Id: Icc801ded8d4ec1ec4d1dab93289a2365f8cd9cbd +Pick-to: 5.15 +--- + +diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl +index 0f87d61..4c1cb5b 100644 +--- a/src/corelib/mimetypes/mime/generate.pl ++++ b/src/corelib/mimetypes/mime/generate.pl +@@ -67,9 +67,9 @@ + + # Check if xml (from xmlstarlet) is in $PATH + my $cmd; +-if (checkCommand("xml")) { ++if (checkCommand("xmlstarlet")) { + # Minify the data before compressing +- $cmd = "xml sel -D -B -t -c / $fname"; ++ $cmd = "xmlstarlet sel -D -B -t -c / $fname"; + $cmd .= "| $compress" if $compress; + } elsif ($compress) { + $cmd = "$compress < $fname" diff --git a/recipes/qt/all/patches/e2eb6e9.diff b/recipes/qt/all/patches/e2eb6e9.diff new file mode 100644 index 0000000000000..588d9d38e8b5c --- /dev/null +++ b/recipes/qt/all/patches/e2eb6e9.diff @@ -0,0 +1,27 @@ +From e2eb6e9bf75957b3139aefc4827d6256458d8836 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Tue, 26 May 2020 09:10:39 -0700 +Subject: [PATCH] QMimeDatabase/zstd: use -T1 instead of --single-thread + +Some older versions of the command-line tool don't have --single-thread +but do have -T1. They're slightly different according to the +documentation, but it's not important to us. What we want is to make +sure we consume a single CPU during build. + +Pick-To: 5.15 +Change-Id: Ied637aece2a7427b8a2dfffd16129fe88a0466ee +--- + +diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl +index 0f87d61..8ac4b50 100644 +--- a/src/corelib/mimetypes/mime/generate.pl ++++ b/src/corelib/mimetypes/mime/generate.pl +@@ -60,7 +60,7 @@ + if ($fname eq "--zstd") { + $fname = shift @ARGV; + if (checkCommand("zstd")) { +- $compress = "zstd -cq19 --single-thread"; ++ $compress = "zstd -cq19 -T1"; + $macro = "MIME_DATABASE_IS_ZSTD"; + } + } diff --git a/recipes/qt/all/qtmodules.conf b/recipes/qt/all/qtmodules.conf new file mode 100644 index 0000000000000..788b31c881415 --- /dev/null +++ b/recipes/qt/all/qtmodules.conf @@ -0,0 +1,284 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + status = addon diff --git a/recipes/qt/all/test_package/CMakeLists.txt b/recipes/qt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cce87d0b43a81 --- /dev/null +++ b/recipes/qt/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.1.0) +project(test_package) + +include(${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Instruct CMake to run moc automatically when needed +set(CMAKE_AUTOMOC ON) +# Create code from a list of Qt designer ui files +set(CMAKE_AUTOUIC ON) + +# Find the QtCore library +find_package(Qt5Core CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp greeter.h) +target_link_libraries(${PROJECT_NAME} Qt5::Core) + +# configure_file(${CMAKE_CURRENT_BINARY_DIR}/qt.conf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf COPYONLY) diff --git a/recipes/qt/all/test_package/conanfile.py b/recipes/qt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cf2666751106d --- /dev/null +++ b/recipes/qt/all/test_package/conanfile.py @@ -0,0 +1,120 @@ +import os +import shutil + +from conans import ConanFile, CMake, tools, Meson, RunEnvironment +from conans.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "qt", "cmake" + + def build_requirements(self): + if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": + self.build_requires("jom/1.1.3") + if self._meson_supported(): + self.build_requires("meson/0.54.2") + + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def _meson_supported(self): + return self.options["qt"].shared and\ + not tools.cross_building(self.settings) and\ + not tools.os_info.is_macos and\ + not self._is_mingw() + + def _cmake_supported(self): + return self.options["qt"].shared or\ + not self._is_mingw() + + def _build_with_qmake(self): + tools.mkdir("qmake_folder") + with tools.chdir("qmake_folder"): + self.output.info("Building with qmake") + + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + args = [self.source_folder, "DESTDIR=bin"] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath('CC') + if value: + args += ['QMAKE_CC=' + value, + 'QMAKE_LINK_C=' + value, + 'QMAKE_LINK_C_SHLIB=' + value] + + value = _getenvpath('CXX') + if value: + args += ['QMAKE_CXX=' + value, + 'QMAKE_LINK=' + value, + 'QMAKE_LINK_SHLIB=' + value] + + self.run("qmake %s" % " ".join(args), run_environment=True) + if tools.os_info.is_windows: + if self.settings.compiler == "Visual Studio": + self.run("jom", run_environment=True) + else: + self.run("mingw32-make", run_environment=True) + else: + self.run("make", run_environment=True) + + def _build_with_meson(self): + if self._meson_supported(): + self.output.info("Building with Meson") + tools.mkdir("meson_folder") + with tools.environment_append(RunEnvironment(self).vars): + meson = Meson(self) + try: + meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) + except ConanException: + self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) + raise + meson.build() + + def _build_with_cmake(self): + if self._cmake_supported(): + self.output.info("Building with CMake") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.14' + cmake.configure(build_folder="cmake_folder") + cmake.build() + + def build(self): + self._build_with_qmake() + self._build_with_meson() + self._build_with_cmake() + + def _test_with_qmake(self): + self.output.info("Testing qmake") + bin_path = os.path.join("qmake_folder", "bin") + if tools.os_info.is_macos: + bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") + shutil.copy("qt.conf", bin_path) + self.run(os.path.join(bin_path, "test_package"), run_environment=True) + + def _test_with_meson(self): + if self._meson_supported(): + self.output.info("Testing Meson") + shutil.copy("qt.conf", "meson_folder") + self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake(self): + if self._cmake_supported(): + self.output.info("Testing CMake") + shutil.copy("qt.conf", os.path.join("cmake_folder", "bin")) + self.run(os.path.join("cmake_folder", "bin", "test_package"), run_environment=True) + + def test(self): + if not tools.cross_building(self.settings, skip_x64_x86=True): + self._test_with_qmake() + self._test_with_meson() + self._test_with_cmake() diff --git a/recipes/qt/all/test_package/greeter.h b/recipes/qt/all/test_package/greeter.h new file mode 100644 index 0000000000000..85052e081d4fb --- /dev/null +++ b/recipes/qt/all/test_package/greeter.h @@ -0,0 +1,26 @@ +#include +#include +#include + +class Greeter : public QObject +{ + Q_OBJECT +public: + Greeter(const QString& name, QObject *parent = 0) + : QObject(parent) + , mName(name) {} + +public slots: + void run() + { + qDebug() << QString("Hello %1!").arg(mName); + + emit finished(); + } + +signals: + void finished(); + +private: + const QString& mName; +}; diff --git a/recipes/qt/all/test_package/meson.build b/recipes/qt/all/test_package/meson.build new file mode 100644 index 0000000000000..fac1eb87e2e4b --- /dev/null +++ b/recipes/qt/all/test_package/meson.build @@ -0,0 +1,6 @@ +project('test_package', 'cpp') +qt5 = import('qt5') +qt5_dep = dependency('qt5', modules: ['Core']) +moc_files = qt5.preprocess(moc_headers : 'greeter.h') +executable('test_package', 'test_package.cpp', moc_files, + dependencies : qt5_dep) diff --git a/recipes/qt/all/test_package/test_package.cpp b/recipes/qt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..30381b074590c --- /dev/null +++ b/recipes/qt/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include +#include +#include +#include "greeter.h" + +int main(int argc, char *argv[]){ + QCoreApplication app(argc, argv); + QCoreApplication::setApplicationName("Application Example"); + QCoreApplication::setApplicationVersion("1.0.0"); + + QString name = argc > 0 ? argv[1] : ""; + if (name.isEmpty()) { + name = "World"; + } + + Greeter* greeter = new Greeter(name, &app); + QObject::connect(greeter, SIGNAL(finished()), &app, SLOT(quit())); + QTimer::singleShot(0, greeter, SLOT(run())); + + return app.exec(); +} diff --git a/recipes/qt/all/test_package/test_package.pro b/recipes/qt/all/test_package/test_package.pro new file mode 100644 index 0000000000000..1dadb5931082e --- /dev/null +++ b/recipes/qt/all/test_package/test_package.pro @@ -0,0 +1,7 @@ +SOURCES += test_package.cpp + +HEADERS += greeter.h + +QT -= GUI + +CONFIG += console diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml new file mode 100644 index 0000000000000..22a6711a6a396 --- /dev/null +++ b/recipes/qt/config.yml @@ -0,0 +1,3 @@ +versions: + "5.15.0": + folder: all From a20703a5fd2695390df5dfc7b723f2e0f4402e95 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 28 May 2020 00:37:25 +0200 Subject: [PATCH 02/61] disable glib harfbuzz gui and widgets(on linux) --- recipes/qt/all/conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 3db000591b18c..f91ab6e2dfea3 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -97,13 +97,13 @@ class QtConan(ConanFile): "with_vulkan": False, "openssl": True, "with_pcre2": True, - "with_glib": True, + "with_glib": False, # "with_libiconv": True, "with_doubleconversion": True, "with_freetype": True, "with_fontconfig": True, "with_icu": True, - "with_harfbuzz": True, + "with_harfbuzz": False, "with_libjpeg": True, "with_libpng": True, "with_sqlite3": True, @@ -178,6 +178,9 @@ def build_requirements(self): def config_options(self): if self.settings.os != "Linux": self.options.with_icu = False + if self.settings.os == "Linux": + self.options.GUI = False + self.options.widgets = False def configure(self): if conan_version < Version("1.20.0"): From 6e78c115b89b17bf7b9eaeb07e64d18f3dda9da4 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 28 May 2020 07:07:22 +0200 Subject: [PATCH 03/61] fixup references of packages (not yet on CCI) --- recipes/qt/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index f91ab6e2dfea3..d6ac2eff91aad 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -264,7 +264,7 @@ def requirements(self): self.requires("pcre2/10.33") if self.options.with_glib: - self.requires("glib/2.64.0@bincrafters/stable") + self.requires("glib/2.64.0") # if self.options.with_libiconv: # self.requires("libiconv/1.16") if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -272,11 +272,11 @@ def requirements(self): if self.options.with_freetype and not self.options.multiconfiguration: self.requires("freetype/2.10.1") if self.options.with_fontconfig: - self.requires("fontconfig/2.13.91@conan/stable") + self.requires("fontconfig/2.13.91") if self.options.with_icu: self.requires("icu/64.2") if self.options.with_harfbuzz and not self.options.multiconfiguration: - self.requires("harfbuzz/2.6.4@bincrafters/stable") + self.requires("harfbuzz/2.6.4") if self.options.with_libjpeg and not self.options.multiconfiguration: self.requires("libjpeg/9d") if self.options.with_libpng and not self.options.multiconfiguration: @@ -597,7 +597,7 @@ def _getenvpath(var): if self.settings.compiler in ['gcc', 'clang']: i_path = [] l_path = [] - for p in ['fontconfig', 'libxcursor', 'libxi', 'libxtst', 'libxrandr', 'libxscrnsaver', 'libxcomposite', 'zlib', 'libxdamage']: + for p in ['fontconfig', 'zlib']: if p in self.deps_cpp_info.deps: i_path.extend(self._gather_include_paths(p)) l_path.extend(self._gather_lib_paths(p)) From fa16fd056a933bd43ffe51664075fa62b2a9812e Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 28 May 2020 12:43:14 +0200 Subject: [PATCH 04/61] move stuff to bin subfolder --- recipes/qt/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index d6ac2eff91aad..480f574321da5 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -404,6 +404,9 @@ def build(self): args = ["-confirm-license", "-silent", "-nomake examples", "-nomake tests", "-prefix %s" % self.package_folder] args.append("-v") + args.append("-archdatadir %s" % os.path.join(self.package_folder, "bin", "archdatadir")) + args.append("-datadir %s" % os.path.join(self.package_folder, "bin", "datadir")) + args.append("-sysconfdir %s" % os.path.join(self.package_folder, "bin", "sysconfdir")) if self.options.commercial: args.append("-commercial") else: From 773e22e721d234f47d7e67b2200727c3fe7997cc Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 28 May 2020 15:56:01 +0200 Subject: [PATCH 05/61] remove useless cmake code --- recipes/qt/all/conanfile.py | 62 +++++++++++----------- recipes/qt/all/test_package/CMakeLists.txt | 22 -------- recipes/qt/all/test_package/conanfile.py | 27 +--------- 3 files changed, 33 insertions(+), 78 deletions(-) delete mode 100644 recipes/qt/all/test_package/CMakeLists.txt diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 480f574321da5..1d38fd38a7b40 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -594,36 +594,39 @@ def _getenvpath(var): if self.options.config: args.append(str(self.options.config)) - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [os.getcwd()]} - if self.options.qtwebengine: - if self.settings.compiler in ['gcc', 'clang']: - i_path = [] - l_path = [] - for p in ['fontconfig', 'zlib']: - if p in self.deps_cpp_info.deps: - i_path.extend(self._gather_include_paths(p)) - l_path.extend(self._gather_lib_paths(p)) - build_env['C_INCLUDE_PATH'] = os.pathsep.join(i_path) - build_env['CPLUS_INCLUDE_PATH'] = os.pathsep.join(i_path) - build_env['LIBRARY_PATH'] = os.pathsep.join(l_path) - if self.settings.os == "Windows": - build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")] - with tools.environment_append(build_env): - self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True) - if tools.os_info.is_macos: - with open("bash_env", "w") as f: - f.write('export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"])) - with tools.environment_append({ - "BASH_ENV": os.path.abspath("bash_env") - }) if tools.os_info.is_macos else tools.no_op(): - self.run(self._make_program(), run_environment=True) - - with open('qtbase/bin/qt.conf', 'w') as f: - f.write('[Paths]\nPrefix = ..') + os.mkdir('build_folder') + with tools.chdir('build_folder'): + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [os.getcwd()]} + if self.options.qtwebengine: + if self.settings.compiler in ['gcc', 'clang']: + i_path = [] + l_path = [] + for p in ['fontconfig', 'zlib']: + if p in self.deps_cpp_info.deps: + i_path.extend(self._gather_include_paths(p)) + l_path.extend(self._gather_lib_paths(p)) + build_env['C_INCLUDE_PATH'] = os.pathsep.join(i_path) + build_env['CPLUS_INCLUDE_PATH'] = os.pathsep.join(i_path) + build_env['LIBRARY_PATH'] = os.pathsep.join(l_path) + if self.settings.os == "Windows": + build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")] + with tools.environment_append(build_env): + self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True) + if tools.os_info.is_macos: + with open("bash_env", "w") as f: + f.write('export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"])) + with tools.environment_append({ + "BASH_ENV": os.path.abspath("bash_env") + }) if tools.os_info.is_macos else tools.no_op(): + self.run(self._make_program(), run_environment=True) + + with open('qtbase/bin/qt.conf', 'w') as f: + f.write('[Paths]\nPrefix = ..') def package(self): - self.run("%s install" % self._make_program()) + with tools.chdir('build_folder'): + self.run("%s install" % self._make_program()) self.copy("bin/qt.conf", src="qtbase") self.copy("*LICENSE*", src="qt5/", dst="licenses") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -635,9 +638,6 @@ def package_id(self): del self.info.options.cross_compile del self.info.options.sysroot - def package_info(self): - self.env_info.CMAKE_PREFIX_PATH.append(self.package_folder) - @staticmethod def _remove_duplicate(l): seen = set() diff --git a/recipes/qt/all/test_package/CMakeLists.txt b/recipes/qt/all/test_package/CMakeLists.txt deleted file mode 100644 index cce87d0b43a81..0000000000000 --- a/recipes/qt/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.1.0) -project(test_package) - -include(${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake) -conan_set_vs_runtime() -conan_set_libcxx() -conan_output_dirs_setup() - -# Find includes in corresponding build directories -set(CMAKE_INCLUDE_CURRENT_DIR ON) -# Instruct CMake to run moc automatically when needed -set(CMAKE_AUTOMOC ON) -# Create code from a list of Qt designer ui files -set(CMAKE_AUTOUIC ON) - -# Find the QtCore library -find_package(Qt5Core CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp greeter.h) -target_link_libraries(${PROJECT_NAME} Qt5::Core) - -# configure_file(${CMAKE_CURRENT_BINARY_DIR}/qt.conf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf COPYONLY) diff --git a/recipes/qt/all/test_package/conanfile.py b/recipes/qt/all/test_package/conanfile.py index cf2666751106d..92cdfc2c9e928 100644 --- a/recipes/qt/all/test_package/conanfile.py +++ b/recipes/qt/all/test_package/conanfile.py @@ -1,13 +1,13 @@ import os import shutil -from conans import ConanFile, CMake, tools, Meson, RunEnvironment +from conans import ConanFile, tools, Meson, RunEnvironment from conans.errors import ConanException class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "qt", "cmake" + generators = "qt" def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": @@ -24,10 +24,6 @@ def _meson_supported(self): not tools.os_info.is_macos and\ not self._is_mingw() - def _cmake_supported(self): - return self.options["qt"].shared or\ - not self._is_mingw() - def _build_with_qmake(self): tools.mkdir("qmake_folder") with tools.chdir("qmake_folder"): @@ -77,21 +73,9 @@ def _build_with_meson(self): raise meson.build() - def _build_with_cmake(self): - if self._cmake_supported(): - self.output.info("Building with CMake") - env_build = RunEnvironment(self) - with tools.environment_append(env_build.vars): - cmake = CMake(self, set_cmake_flags=True) - if self.settings.os == "Macos": - cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.14' - cmake.configure(build_folder="cmake_folder") - cmake.build() - def build(self): self._build_with_qmake() self._build_with_meson() - self._build_with_cmake() def _test_with_qmake(self): self.output.info("Testing qmake") @@ -107,14 +91,7 @@ def _test_with_meson(self): shutil.copy("qt.conf", "meson_folder") self.run(os.path.join("meson_folder", "test_package"), run_environment=True) - def _test_with_cmake(self): - if self._cmake_supported(): - self.output.info("Testing CMake") - shutil.copy("qt.conf", os.path.join("cmake_folder", "bin")) - self.run(os.path.join("cmake_folder", "bin", "test_package"), run_environment=True) - def test(self): if not tools.cross_building(self.settings, skip_x64_x86=True): self._test_with_qmake() self._test_with_meson() - self._test_with_cmake() From 756e0d1a975fbe1658b19b1cad9c31706ff3c16f Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 4 Jun 2020 18:41:50 +0200 Subject: [PATCH 06/61] disable linux until required packages are on CCI --- recipes/qt/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 1d38fd38a7b40..8d823d36de36e 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -179,8 +179,7 @@ def config_options(self): if self.settings.os != "Linux": self.options.with_icu = False if self.settings.os == "Linux": - self.options.GUI = False - self.options.widgets = False + raise ConanInvalidConfiguration('Linux is not yet supported') def configure(self): if conan_version < Version("1.20.0"): From 9aeaec5f6ea5bec59aa90348406660f183907cbf Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 4 Jun 2020 21:38:12 +0200 Subject: [PATCH 07/61] remove pdb files --- recipes/qt/all/conanfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 8d823d36de36e..3d06c533330f1 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -632,6 +632,13 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) for file_to_remove in glob.glob(os.path.join(self.package_folder, "lib", "*.la*")): os.remove(file_to_remove) + for file_to_remove in glob.glob(os.path.join(self.package_folder, "lib", "*.pdb*")): + os.remove(file_to_remove) + for root, dirs, files in os.walk(os.path.join(self.package_folder, "bin")): + for name in files: + if name.endswith('.pdb'): + os.remove(os.path.join(root, name)) + def package_id(self): del self.info.options.cross_compile From 7fb2b46478248648ee396a7f0172a42c997e33d4 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 5 Jun 2020 07:34:02 +0200 Subject: [PATCH 08/61] disable old apple compilers see QTBUG-76777 --- recipes/qt/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 3d06c533330f1..bb71ecbb92854 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -180,6 +180,10 @@ def config_options(self): self.options.with_icu = False if self.settings.os == "Linux": raise ConanInvalidConfiguration('Linux is not yet supported') + 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)") + def configure(self): if conan_version < Version("1.20.0"): From a2883b215e3aa43fdf4adb14c6f973b9557c0348 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 9 Jun 2020 22:55:17 +0200 Subject: [PATCH 09/61] create qt.conf after make install --- recipes/qt/all/conanfile.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index bb71ecbb92854..079d85af0f345 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -624,13 +624,23 @@ def _getenvpath(var): }) if tools.os_info.is_macos else tools.no_op(): self.run(self._make_program(), run_environment=True) - with open('qtbase/bin/qt.conf', 'w') as f: - f.write('[Paths]\nPrefix = ..') - def package(self): with tools.chdir('build_folder'): self.run("%s install" % self._make_program()) - self.copy("bin/qt.conf", src="qtbase") + with open(os.path.join(self.package_folder, "bin", "qt.conf"), 'w') as f: + f.write("""[Paths] +Prefix = .. +ArchData = bin/archdatadir +HostData = bin/archdatadir +Data = bin/datadir +Sysconf = bin/sysconfdir +LibraryExecutables = bin/archdatadir/bin +Plugins = bin/archdatadir/plugins +Imports = bin/archdatadir/imports +Qml2Imports = bin/archdatadir/qml +Translations = bin/datadir/translations +Documentation = bin/datadir/doc +Examples = bin/datadir/examples""") self.copy("*LICENSE*", src="qt5/", dst="licenses") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) From 2401bd11c014381742534dd031cc44d5e086e993 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 11 Jun 2020 13:12:55 +0200 Subject: [PATCH 10/61] require opengl/system if necessary --- recipes/qt/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 079d85af0f345..00a70a6ce1b47 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -300,6 +300,8 @@ def requirements(self): self.requires("libalsa/1.1.9") if self.options.GUI and self.settings.os == "Linux": self.requires("xorg/system") + if self.options.opengl != "no": + self.requires("opengl/system") if self.options.with_zstd: self.requires("zstd/1.4.4") if self.options.qtwebengine and self.settings.os == "Linux": From 94c9fe9261d1fa48cd329cfb6d95a9d54ddf9773 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 11 Jun 2020 13:24:25 +0200 Subject: [PATCH 11/61] enable linux --- recipes/qt/all/conanfile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 00a70a6ce1b47..6c6a46844c3be 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -178,8 +178,6 @@ def build_requirements(self): def config_options(self): if self.settings.os != "Linux": self.options.with_icu = False - if self.settings.os == "Linux": - raise ConanInvalidConfiguration('Linux is not yet supported') 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)") @@ -298,8 +296,8 @@ def requirements(self): self.requires("openal/1.19.1") if self.options.with_libalsa: self.requires("libalsa/1.1.9") - if self.options.GUI and self.settings.os == "Linux": - self.requires("xorg/system") + #if self.options.GUI and self.settings.os == "Linux": + # self.requires("xorg/system") if self.options.opengl != "no": self.requires("opengl/system") if self.options.with_zstd: From e6b28ebfb944371d41444eddc7df861578d40e94 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 11 Jun 2020 16:54:42 +0200 Subject: [PATCH 12/61] disable gcc and clang < 5.0 --- recipes/qt/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 6c6a46844c3be..2d0f28c1292b5 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -404,6 +404,9 @@ def _xplatform(self): return None def build(self): + if self.settings.compiler in ["gcc", "clang"]: + if tools.Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("qt 5.15.0 is not support on GCC or clang before 5.0") args = ["-confirm-license", "-silent", "-nomake examples", "-nomake tests", "-prefix %s" % self.package_folder] args.append("-v") From 02651993275a8ce750197365dbefe33884d8d3ab Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Thu, 11 Jun 2020 14:59:38 +0000 Subject: [PATCH 13/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.24.4 --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 2d0f28c1292b5..c1d6bb99b3cbd 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -132,7 +132,7 @@ def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self.options.qtwebengine: - self.build_requires("ninja/1.9.0") + self.build_requires("ninja/1.10.0") # gperf, bison, flex, python >= 2.7.5 & < 3 if self.settings.os != "Windows": if not tools.which("bison"): From 72895cf71e90c5140a4f62f987c3e1a9cde8a6b6 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 15 Jun 2020 10:18:58 +0200 Subject: [PATCH 14/61] enable xorg requirement on linux --- recipes/qt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index c1d6bb99b3cbd..63a123181f03d 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -296,8 +296,8 @@ def requirements(self): self.requires("openal/1.19.1") if self.options.with_libalsa: self.requires("libalsa/1.1.9") - #if self.options.GUI and self.settings.os == "Linux": - # self.requires("xorg/system") + if self.options.GUI and self.settings.os == "Linux": + self.requires("xorg/system") if self.options.opengl != "no": self.requires("opengl/system") if self.options.with_zstd: From 5200fdbac437f537d343335e164f8ab730001ab9 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 15 Jun 2020 11:53:28 +0200 Subject: [PATCH 15/61] fix pkg_config search path --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 63a123181f03d..82d6fb99f424f 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -603,7 +603,7 @@ def _getenvpath(var): os.mkdir('build_folder') with tools.chdir('build_folder'): with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [os.getcwd()]} + build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [self.build_folder]} if self.options.qtwebengine: if self.settings.compiler in ['gcc', 'clang']: i_path = [] From 1779afb88cdc54d9a9d3db9e2cafb0e7dad00764 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 19 Jun 2020 10:01:35 +0200 Subject: [PATCH 16/61] Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/qt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 82d6fb99f424f..5dbad108c3e7a 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -283,7 +283,7 @@ def requirements(self): if self.options.with_libpng and not self.options.multiconfiguration: self.requires("libpng/1.6.37") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.31.0") + self.requires("sqlite3/3.32.2") self.options["sqlite3"].enable_column_metadata = True if self.options.with_mysql: self.requires("libmysqlclient/8.0.17") @@ -301,7 +301,7 @@ def requirements(self): if self.options.opengl != "no": self.requires("opengl/system") if self.options.with_zstd: - self.requires("zstd/1.4.4") + self.requires("zstd/1.4.5") if self.options.qtwebengine and self.settings.os == "Linux": self.requires("expat/2.2.9") self.requires("opus/1.3.1") From fcb818d2e8ad393f7cc041291c5b907f8ae4a82a Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 19 Jun 2020 10:02:21 +0200 Subject: [PATCH 17/61] Update recipes/qt/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 5dbad108c3e7a..9cbe02a6dfa69 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -288,7 +288,7 @@ def requirements(self): if self.options.with_mysql: self.requires("libmysqlclient/8.0.17") if self.options.with_pq: - self.requires("libpq/11.5") + self.requires("libpq/12.2") if self.options.with_odbc: if self.settings.os != "Windows": self.requires("odbc/2.3.7") From eeedec5057f998eaef9e7f9cde439151d0154d88 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 16 Jun 2020 12:22:44 +0200 Subject: [PATCH 18/61] removed licenses from unused modules --- recipes/qt/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 9cbe02a6dfa69..26d62e63b26d4 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -645,6 +645,9 @@ def package(self): Documentation = bin/datadir/doc Examples = bin/datadir/examples""") self.copy("*LICENSE*", src="qt5/", dst="licenses") + for module in self._submodules: + if module != 'qtbase' and not getattr(self.options, module): + tools.rmdir(os.path.join(self.package_folder, "licenses", module)) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) for file_to_remove in glob.glob(os.path.join(self.package_folder, "lib", "*.la*")): From 3b16278a83bcc6bcdde3ce6fe49437d8e82bd6a4 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 16 Jun 2020 12:23:11 +0200 Subject: [PATCH 19/61] fix multiconfiguration hash --- recipes/qt/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 26d62e63b26d4..f71bf48fbc014 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -663,6 +663,11 @@ def package(self): def package_id(self): del self.info.options.cross_compile del self.info.options.sysroot + if self.options.multiconfiguration and self.settings.compiler == "Visual Studio": + if "MD" in self.settings.compiler.runtime: + self.info.settings.compiler.runtime = "MD/MDd" + else: + self.info.settings.compiler.runtime = "MT/MTd" @staticmethod def _remove_duplicate(l): From 385ab001c14bf1516219e8019d215e649e52b8bb Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 16 Jun 2020 12:24:14 +0200 Subject: [PATCH 20/61] Update: harfbuzz dependency --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index f71bf48fbc014..11f04b72d8f05 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -277,7 +277,7 @@ def requirements(self): if self.options.with_icu: self.requires("icu/64.2") if self.options.with_harfbuzz and not self.options.multiconfiguration: - self.requires("harfbuzz/2.6.4") + self.requires("harfbuzz/2.6.7") if self.options.with_libjpeg and not self.options.multiconfiguration: self.requires("libjpeg/9d") if self.options.with_libpng and not self.options.multiconfiguration: From 843a1dd45dd3e863af9aeeac4b526053295f4b1c Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 22 Jun 2020 10:40:10 +0200 Subject: [PATCH 21/61] remove obsolete env variables --- recipes/qt/all/conanfile.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 11f04b72d8f05..7a495fd673561 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -520,8 +520,7 @@ def build(self): ("sdl2", "SDL2"), ("openal", "OPENAL"), ("zstd", "ZSTD"), - ("libalsa", "ALSA"), - ("xkbcommon", "XKBCOMMON")] + ("libalsa", "ALSA")] for package, var in libmap: if package in self.deps_cpp_info.deps: if package == 'freetype': @@ -604,17 +603,6 @@ def _getenvpath(var): with tools.chdir('build_folder'): with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [self.build_folder]} - if self.options.qtwebengine: - if self.settings.compiler in ['gcc', 'clang']: - i_path = [] - l_path = [] - for p in ['fontconfig', 'zlib']: - if p in self.deps_cpp_info.deps: - i_path.extend(self._gather_include_paths(p)) - l_path.extend(self._gather_lib_paths(p)) - build_env['C_INCLUDE_PATH'] = os.pathsep.join(i_path) - build_env['CPLUS_INCLUDE_PATH'] = os.pathsep.join(i_path) - build_env['LIBRARY_PATH'] = os.pathsep.join(l_path) if self.settings.os == "Windows": build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")] with tools.environment_append(build_env): From 8d2d5aa5cb003221c11b32a5ecf35accbe72a5ed Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 3 Jul 2020 11:40:54 +0200 Subject: [PATCH 22/61] upgrade harfbuzz and glib --- recipes/qt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 7a495fd673561..28bce45e4aa58 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -265,7 +265,7 @@ def requirements(self): self.requires("pcre2/10.33") if self.options.with_glib: - self.requires("glib/2.64.0") + self.requires("glib/2.65.0") # if self.options.with_libiconv: # self.requires("libiconv/1.16") if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -277,7 +277,7 @@ def requirements(self): if self.options.with_icu: self.requires("icu/64.2") if self.options.with_harfbuzz and not self.options.multiconfiguration: - self.requires("harfbuzz/2.6.7") + self.requires("harfbuzz/2.6.8") if self.options.with_libjpeg and not self.options.multiconfiguration: self.requires("libjpeg/9d") if self.options.with_libpng and not self.options.multiconfiguration: From 3d5c24a1847cb1d1cd960263daf82d7b8da07f7d Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 9 Jul 2020 18:42:32 +0200 Subject: [PATCH 23/61] Apply suggestions from code review Co-authored-by: Uilian Ries --- recipes/qt/all/conanfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 28bce45e4aa58..a72b401563cba 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -184,12 +184,10 @@ def config_options(self): def configure(self): - if conan_version < Version("1.20.0"): - raise ConanInvalidConfiguration("This recipe needs at least conan 1.20.0, please upgrade.") if self.settings.os != 'Linux': # self.options.with_libiconv = False self.options.with_fontconfig = False - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version.value) < "5.3": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5.3": self.options.with_mysql = False if self.settings.os == "Windows": self.options.with_mysql = False From 26064b879f6010a8d7c3f056bd38f7c73fbbe2cf Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 14 Jul 2020 15:29:16 +0200 Subject: [PATCH 24/61] fix test recipe if gui is disabled also, remove some trailing whitespaces --- recipes/qt/all/conanfile.py | 35 +++++++++----------- recipes/qt/all/test_package/test_package.pro | 2 +- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index a72b401563cba..cf6fc98d95b7f 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -40,7 +40,6 @@ def _getsubmodules(): class QtConan(ConanFile): - _submodules = _getsubmodules() generators = "pkg_config" @@ -62,7 +61,7 @@ class QtConan(ConanFile): "openssl": [True, False], "with_pcre2": [True, False], "with_glib": [True, False], - # "with_libiconv": [True, False], # Qt tests failure "invalid conversion from const char** to char**" + # "with_libiconv": [True, False], # QTBUG-84708 Qt tests failure "invalid conversion from const char** to char**" "with_doubleconversion": [True, False], "with_freetype": [True, False], "with_fontconfig": [True, False], @@ -98,7 +97,7 @@ class QtConan(ConanFile): "openssl": True, "with_pcre2": True, "with_glib": False, - # "with_libiconv": True, + # "with_libiconv": True, # QTBUG-84708 "with_doubleconversion": True, "with_freetype": True, "with_fontconfig": True, @@ -151,7 +150,7 @@ def build_requirements(self): if not python_exe: msg = ("Python2 must be available in PATH " - "in order to build Qt WebEngine") + "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 @@ -167,12 +166,12 @@ def build_requirements(self): v_max = "3.0.0" if (version >= v_min) and (version < v_max): msg = ("Found valid Python 2 required for QtWebengine:" - " version={}, path={}".format(mybuf.getvalue(), python_exe)) + " version={}, path={}".format(mybuf.getvalue(), python_exe)) self.output.success(msg) else: msg = ("Found Python 2 in path, but with invalid version {}" - " (QtWebEngine requires >= {} & < " - "{})".format(verstr, v_min, v_max)) + " (QtWebEngine requires >= {} & < " + "{})".format(verstr, v_min, v_max)) raise ConanInvalidConfiguration(msg) def config_options(self): @@ -182,10 +181,9 @@ def config_options(self): if tools.Version(self.settings.compiler.version) < "10.0": raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") - def configure(self): if self.settings.os != 'Linux': - # self.options.with_libiconv = False + # self.options.with_libiconv = False # QTBUG-84708 self.options.with_fontconfig = False if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5.3": self.options.with_mysql = False @@ -264,8 +262,8 @@ def requirements(self): if self.options.with_glib: self.requires("glib/2.65.0") - # if self.options.with_libiconv: - # self.requires("libiconv/1.16") + # if self.options.with_libiconv: # QTBUG-84708 + # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.1.5") if self.options.with_freetype and not self.options.multiconfiguration: @@ -312,9 +310,9 @@ def source(self): tools.patch(**p) for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: tools.replace_in_file(os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), - " if (enable_precompiled_headers) {\n if (is_win) {", - " if (enable_precompiled_headers) {\n if (false) {" - ) + " if (enable_precompiled_headers) {\n if (is_win) {", + " if (enable_precompiled_headers) {\n if (false) {" + ) def _make_program(self): if self.settings.compiler == "Visual Studio": @@ -455,7 +453,7 @@ def build(self): args += ["-opengl desktop"] elif self.options.opengl == "dynamic": args += ["-opengl dynamic"] - + if self.options.with_vulkan: args.append("-vulkan") else: @@ -470,7 +468,7 @@ def build(self): else: args += ["-openssl-linked"] - # args.append("--iconv=" + ("gnu" if self.options.with_libiconv else "no")) + # args.append("--iconv=" + ("gnu" if self.options.with_libiconv else "no"))# QTBUG-84708 args.append("--glib=" + ("yes" if self.options.with_glib else "no")) args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) @@ -503,7 +501,7 @@ def build(self): ("openssl", "OPENSSL"), ("pcre2", "PCRE2"), ("glib", "GLIB"), - # ("libiconv", "ICONV"), + # ("libiconv", "ICONV"),# QTBUG-84708 ("double-conversion", "DOUBLECONVERSION"), ("freetype", "FREETYPE"), ("fontconfig", "FONTCONFIG"), @@ -610,7 +608,7 @@ def _getenvpath(var): f.write('export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"])) with tools.environment_append({ "BASH_ENV": os.path.abspath("bash_env") - }) if tools.os_info.is_macos else tools.no_op(): + }) if tools.os_info.is_macos else tools.no_op(): self.run(self._make_program(), run_environment=True) def package(self): @@ -644,7 +642,6 @@ def package(self): for name in files: if name.endswith('.pdb'): os.remove(os.path.join(root, name)) - def package_id(self): del self.info.options.cross_compile diff --git a/recipes/qt/all/test_package/test_package.pro b/recipes/qt/all/test_package/test_package.pro index 1dadb5931082e..87e086b3aae87 100644 --- a/recipes/qt/all/test_package/test_package.pro +++ b/recipes/qt/all/test_package/test_package.pro @@ -2,6 +2,6 @@ SOURCES += test_package.cpp HEADERS += greeter.h -QT -= GUI +QT -= gui CONFIG += console From 94dfe331327f9e2a7db5f47537b3d7fdfc812e7f Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Thu, 23 Jul 2020 15:47:43 +0200 Subject: [PATCH 25/61] linux: require xkbcommon --- recipes/qt/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index cf6fc98d95b7f..175ac66efb231 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -294,6 +294,8 @@ def requirements(self): self.requires("libalsa/1.1.9") 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/0.10.0") if self.options.opengl != "no": self.requires("opengl/system") if self.options.with_zstd: @@ -516,7 +518,8 @@ def build(self): ("sdl2", "SDL2"), ("openal", "OPENAL"), ("zstd", "ZSTD"), - ("libalsa", "ALSA")] + ("libalsa", "ALSA"), + ("xkbcommon", "XKBCOMMON")] for package, var in libmap: if package in self.deps_cpp_info.deps: if package == 'freetype': From e4a0cd7f9b163c90ea3e182bac41b001782b1300 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 3 Aug 2020 11:50:37 +0200 Subject: [PATCH 26/61] adapt to conan 1.28.0 also, remove unused function --- recipes/qt/all/conanfile.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 175ac66efb231..a715a90d1a29e 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -664,6 +664,8 @@ def _remove_duplicate(l): yield element def _gather_libs(self, p): + if not p in self.deps_cpp_info.deps: + return [] libs = ["-l" + i for i in self.deps_cpp_info[p].libs + self.deps_cpp_info[p].system_libs] if tools.is_apple_os(self.settings.os): libs += ["-framework " + i for i in self.deps_cpp_info[p].frameworks] @@ -671,15 +673,3 @@ def _gather_libs(self, p): for dep in self.deps_cpp_info[p].public_deps: libs += self._gather_libs(dep) return self._remove_duplicate(libs) - - def _gather_lib_paths(self, p): - lib_paths = self.deps_cpp_info[p].lib_paths - for dep in self.deps_cpp_info[p].public_deps: - lib_paths += self._gather_lib_paths(dep) - return self._remove_duplicate(lib_paths) - - def _gather_include_paths(self, p): - include_paths = self.deps_cpp_info[p].include_paths - for dep in self.deps_cpp_info[p].public_deps: - include_paths += self._gather_include_paths(dep) - return self._remove_duplicate(include_paths) From 0cf64d2b4dacfb294daf894f8ee3377bc9805eb7 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 12 Aug 2020 11:06:58 +0200 Subject: [PATCH 27/61] remove icu option on non-linux platforms --- recipes/qt/all/conanfile.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index a715a90d1a29e..8f6299da45c1c 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -176,7 +176,7 @@ def build_requirements(self): def config_options(self): if self.settings.os != "Linux": - self.options.with_icu = False + del self.options.with_icu 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)") @@ -189,8 +189,6 @@ def configure(self): self.options.with_mysql = False if self.settings.os == "Windows": self.options.with_mysql = False - if not self.options.shared and self.options.with_icu: - raise ConanInvalidConfiguration("icu option is not supported on windows in static build. see QTBUG-77120.") if self.options.widgets and not self.options.GUI: raise ConanInvalidConfiguration("using option qt:widgets without option qt:GUI is not possible. " @@ -270,7 +268,7 @@ def requirements(self): self.requires("freetype/2.10.1") if self.options.with_fontconfig: self.requires("fontconfig/2.13.91") - if self.options.with_icu: + if self.options.get_safe("with_icu", False): self.requires("icu/64.2") if self.options.with_harfbuzz and not self.options.multiconfiguration: self.requires("harfbuzz/2.6.8") @@ -475,7 +473,7 @@ def build(self): args.append("--glib=" + ("yes" if self.options.with_glib else "no")) args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) args.append("--fontconfig=" + ("yes" if self.options.with_fontconfig else "no")) - args.append("--icu=" + ("yes" if self.options.with_icu else "no")) + args.append("--icu=" + ("yes" if self.options.get_safe("with_icu", False) else "no")) args.append("--sql-mysql=" + ("yes" if self.options.with_mysql else "no")) args.append("--sql-psql=" + ("yes" if self.options.with_pq else "no")) args.append("--sql-odbc=" + ("yes" if self.options.with_odbc else "no")) From ddb2337a413ee8b2bcb708291fd3cc7000aee89e Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 12 Aug 2020 11:08:03 +0200 Subject: [PATCH 28/61] remove mysql option when not supported --- recipes/qt/all/conanfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 8f6299da45c1c..deb064019b6c4 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -180,15 +180,15 @@ def config_options(self): 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 == "gcc" and Version(self.settings.compiler.version) < "5.3": + del self.options.with_mysql + if self.settings.os == "Windows": + del self.options.with_mysql def configure(self): if self.settings.os != 'Linux': # self.options.with_libiconv = False # QTBUG-84708 self.options.with_fontconfig = False - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5.3": - self.options.with_mysql = False - if self.settings.os == "Windows": - self.options.with_mysql = False if self.options.widgets and not self.options.GUI: raise ConanInvalidConfiguration("using option qt:widgets without option qt:GUI is not possible. " @@ -279,7 +279,7 @@ def requirements(self): if self.options.with_sqlite3 and not self.options.multiconfiguration: self.requires("sqlite3/3.32.2") self.options["sqlite3"].enable_column_metadata = True - if self.options.with_mysql: + if self.options.get_safe("with_mysql", False): self.requires("libmysqlclient/8.0.17") if self.options.with_pq: self.requires("libpq/12.2") @@ -474,7 +474,7 @@ def build(self): args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) args.append("--fontconfig=" + ("yes" if self.options.with_fontconfig else "no")) args.append("--icu=" + ("yes" if self.options.get_safe("with_icu", False) else "no")) - args.append("--sql-mysql=" + ("yes" if self.options.with_mysql else "no")) + args.append("--sql-mysql=" + ("yes" if self.options.get_safe("with_mysql", False) else "no")) args.append("--sql-psql=" + ("yes" if self.options.with_pq else "no")) args.append("--sql-odbc=" + ("yes" if self.options.with_odbc else "no")) args.append("--zstd=" + ("yes" if self.options.with_zstd else "no")) From 137bec0eb7150b3c22e3dd998675240f80b62783 Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Wed, 12 Aug 2020 09:13:07 +0000 Subject: [PATCH 29/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.24.5 --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index deb064019b6c4..885b8e4ba4300 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -265,7 +265,7 @@ def requirements(self): if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.1.5") if self.options.with_freetype and not self.options.multiconfiguration: - self.requires("freetype/2.10.1") + self.requires("freetype/2.10.2") if self.options.with_fontconfig: self.requires("fontconfig/2.13.91") if self.options.get_safe("with_icu", False): From 19d8640f2831f8be5a4bb774d74613010e8d42b0 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 11 Sep 2020 11:39:38 +0200 Subject: [PATCH 30/61] qt 5.15.1 --- recipes/qt/all/conandata.yml | 12 ++++-------- recipes/qt/config.yml | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/recipes/qt/all/conandata.yml b/recipes/qt/all/conandata.yml index 15323311b7ba2..08acf527f0bf1 100644 --- a/recipes/qt/all/conandata.yml +++ b/recipes/qt/all/conandata.yml @@ -1,14 +1,10 @@ sources: - "5.15.0": - url: "https://download.qt.io/archive/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz" - sha256: "22b63d7a7a45183865cc4141124f12b673e7a17b1fe2b91e433f6547c5d548c3" + "5.15.1": + url: "https://download.qt.io/archive/qt/5.15/5.15.1/single/qt-everywhere-src-5.15.1.tar.xz" + sha256: "44da876057e21e1be42de31facd99be7d5f9f07893e1ea762359bcee0ef64ee9" patches: - "5.15.0": + "5.15.1": - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" base_path: "qt5/qtwebengine" - - patch_file: "patches/e2eb6e9.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/c994a33.diff" - base_path: "qt5/qtbase" diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 22a6711a6a396..0eb4036422f82 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,3 +1,3 @@ versions: - "5.15.0": + "5.15.1": folder: all From 3933189e56ff26a14699c5041db079bcab8470f3 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 11 Sep 2020 11:41:12 +0200 Subject: [PATCH 31/61] quote paths --- recipes/qt/all/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 885b8e4ba4300..1676f28c2807e 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -526,14 +526,14 @@ def build(self): args.append("\"%s_LIBS=%s\"" % (var, " ".join(self._gather_libs(package)))) for package in self.deps_cpp_info.deps: - args += ["-I " + s for s in self.deps_cpp_info[package].include_paths] - args += ["-D " + s for s in self.deps_cpp_info[package].defines] - args += ["-L " + s for s in self.deps_cpp_info[package].lib_paths] + args += ["-I \"%s\"" % s for s in self.deps_cpp_info[package].include_paths] + args += ["-D %s" % s for s in self.deps_cpp_info[package].defines] + args += ["-L \"%s\"" % s for s in self.deps_cpp_info[package].lib_paths] if 'libmysqlclient' in self.deps_cpp_info.deps: - args.append("-mysql_config " + os.path.join(self.deps_cpp_info['libmysqlclient'].rootpath, "bin", "mysql_config")) + args.append("-mysql_config \"%s\"" % os.path.join(self.deps_cpp_info['libmysqlclient'].rootpath, "bin", "mysql_config")) if 'libpq' in self.deps_cpp_info.deps: - args.append("-psql_config " + os.path.join(self.deps_cpp_info['libpq'].rootpath, "bin", "pg_config")) + args.append("-psql_config \"%s\"" % os.path.join(self.deps_cpp_info['libpq'].rootpath, "bin", "pg_config")) if self.settings.os == "Macos": args += ["-no-framework"] elif self.settings.os == "Android": From d3c777fe12dee6372322881c77011a75e780f72b Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 11 Sep 2020 11:49:21 +0200 Subject: [PATCH 32/61] use os-dependant default for opengl --- recipes/qt/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 1676f28c2807e..f1dec976e1812 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -56,7 +56,7 @@ class QtConan(ConanFile): "shared": [True, False], "commercial": [True, False], - "opengl": ["no", "es2", "desktop", "dynamic"], + "opengl": ["no", "es2", "desktop", "dynamic", "auto"], "with_vulkan": [True, False], "openssl": [True, False], "with_pcre2": [True, False], @@ -92,7 +92,7 @@ class QtConan(ConanFile): default_options = { "shared": True, "commercial": False, - "opengl": "desktop", + "opengl": "auto", "with_vulkan": False, "openssl": True, "with_pcre2": True, @@ -186,6 +186,8 @@ def config_options(self): del self.options.with_mysql def configure(self): + if self.options.opengl == "auto": + self.options.opengl = ("dynamic" if self.settings.os == "Windows" else "desktop") if self.settings.os != 'Linux': # self.options.with_libiconv = False # QTBUG-84708 self.options.with_fontconfig = False From f6297be8152e3f252873702e9ca1e4259fcfdfda Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 11 Sep 2020 11:49:33 +0200 Subject: [PATCH 33/61] remove android-g++ mkspec --- recipes/qt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index f1dec976e1812..70aceadf56a35 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -356,8 +356,8 @@ def _xplatform(self): return "macx-tvos-clang" elif self.settings.os == "Android": - return {"clang": "android-clang", - "gcc": "android-g++"}.get(str(self.settings.compiler)) + if self.settings.compiler == "clang": + return "android-clang" elif self.settings.os == "Windows": return {"Visual Studio": "win32-msvc", From 270be82948ab12e4cd5d1a240683f82ac7cc65d7 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 11 Sep 2020 12:08:42 +0200 Subject: [PATCH 34/61] don't force options values --- recipes/qt/all/conanfile.py | 61 +++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 70aceadf56a35..12fbea1fbccdc 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -190,26 +190,26 @@ def configure(self): self.options.opengl = ("dynamic" if self.settings.os == "Windows" else "desktop") if self.settings.os != 'Linux': # self.options.with_libiconv = False # QTBUG-84708 - self.options.with_fontconfig = False + del self.options.with_fontconfig 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: - self.options.opengl = "no" - self.options.with_vulkan = False - self.options.with_freetype = False - self.options.with_fontconfig = False - self.options.with_harfbuzz = False - self.options.with_libjpeg = False - self.options.with_libpng = False + del self.options.opengl + del self.options.with_vulkan + del self.options.with_freetype + del self.options.with_fontconfig + del self.options.with_harfbuzz + del self.options.with_libjpeg + del self.options.with_libpng if not self.options.qtmultimedia: - self.options.with_libalsa = False - self.options.with_openal = False + del self.options.with_libalsa + del self.options.with_openal if self.settings.os != "Linux": - self.options.with_libalsa = False + del self.options.with_libalsa if self.options.qtwebengine: if not self.options.shared: @@ -221,13 +221,13 @@ def configure(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 == "Android" and self.options.opengl == "desktop": + 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.opengl == "dynamic": + 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.with_fontconfig and not self.options.with_freetype: + 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.settings.os == "Macos": @@ -266,17 +266,17 @@ def requirements(self): # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.1.5") - if self.options.with_freetype and not self.options.multiconfiguration: + if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: self.requires("freetype/2.10.2") - if self.options.with_fontconfig: + if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.91") if self.options.get_safe("with_icu", False): self.requires("icu/64.2") - if self.options.with_harfbuzz and not self.options.multiconfiguration: + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: self.requires("harfbuzz/2.6.8") - if self.options.with_libjpeg and not self.options.multiconfiguration: + if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: self.requires("libjpeg/9d") - if self.options.with_libpng and not self.options.multiconfiguration: + if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.37") if self.options.with_sqlite3 and not self.options.multiconfiguration: self.requires("sqlite3/3.32.2") @@ -288,15 +288,15 @@ def requirements(self): if self.options.with_odbc: if self.settings.os != "Windows": self.requires("odbc/2.3.7") - if self.options.with_openal: + if self.options.get_safe("with_openal", False): self.requires("openal/1.19.1") - if self.options.with_libalsa: + if self.options.get_safe("with_libalsa", False): self.requires("libalsa/1.1.9") 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/0.10.0") - if self.options.opengl != "no": + if self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: self.requires("zstd/1.4.5") @@ -447,16 +447,17 @@ def build(self): args.append("--zlib=system") # openGL - if self.options.opengl == "no": + opengl = self.options.get_safe("opengl", "no") + if opengl == "no": args += ["-no-opengl"] - elif self.options.opengl == "es2": + elif opengl == "es2": args += ["-opengl es2"] - elif self.options.opengl == "desktop": + elif opengl == "desktop": args += ["-opengl desktop"] - elif self.options.opengl == "dynamic": + elif opengl == "dynamic": args += ["-opengl dynamic"] - if self.options.with_vulkan: + if self.options.get_safe("with_vulkan", False): args.append("-vulkan") else: args.append("-no-vulkan") @@ -474,7 +475,7 @@ def build(self): args.append("--glib=" + ("yes" if self.options.with_glib else "no")) args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) - args.append("--fontconfig=" + ("yes" if self.options.with_fontconfig else "no")) + args.append("--fontconfig=" + ("yes" if self.options.get_safe("with_fontconfig", False) else "no")) args.append("--icu=" + ("yes" if self.options.get_safe("with_icu", False) else "no")) args.append("--sql-mysql=" + ("yes" if self.options.get_safe("with_mysql", False) else "no")) args.append("--sql-psql=" + ("yes" if self.options.with_pq else "no")) @@ -482,7 +483,7 @@ def build(self): args.append("--zstd=" + ("yes" if self.options.with_zstd else "no")) if self.options.qtmultimedia: - args.append("--alsa=" + ("yes" if self.options.with_libalsa else "no")) + args.append("--alsa=" + ("yes" if self.options.get_safe("with_libalsa", False) else "no")) for opt, conf_arg in [ ("with_doubleconversion", "doubleconversion"), @@ -491,7 +492,7 @@ def build(self): ("with_libjpeg", "libjpeg"), ("with_libpng", "libpng"), ("with_sqlite3", "sqlite")]: - if getattr(self.options, opt): + if getattr(self.options, opt, False): if self.options.multiconfiguration: args += ["-qt-" + conf_arg] else: From c31a7456f8f58ab85f73ff49e3ccb89f01ec6451 Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Fri, 11 Sep 2020 10:14:13 +0000 Subject: [PATCH 35/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.25.0 --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 12fbea1fbccdc..55007407c4b94 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -261,7 +261,7 @@ def requirements(self): self.requires("pcre2/10.33") if self.options.with_glib: - self.requires("glib/2.65.0") + self.requires("glib/2.65.1") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: From ebdca361a3483be816f05f7b14a38d14bdc3e214 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 11 Sep 2020 12:23:25 +0200 Subject: [PATCH 36/61] static by default --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 55007407c4b94..c16cae0246a5e 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -90,7 +90,7 @@ class QtConan(ConanFile): no_copy_source = True default_options = { - "shared": True, + "shared": False, "commercial": False, "opengl": "auto", "with_vulkan": False, From 0c608bbd16551e9bddbf1f280f9328d252b4d6ab Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 25 Sep 2020 09:46:24 +0200 Subject: [PATCH 37/61] raise exception if shared and static runtime --- recipes/qt/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index c16cae0246a5e..e360e51eb32b3 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -244,6 +244,9 @@ def configure(self): 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") + def _enablemodule(mod): if mod != 'qtbase': setattr(self.options, mod, True) From ab748d9ae81433c20e8615d3101669bbc26f6e4b Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 25 Sep 2020 09:53:03 +0200 Subject: [PATCH 38/61] del options in config_options --- recipes/qt/all/conanfile.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index e360e51eb32b3..30a94da842a6f 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -177,6 +177,8 @@ def build_requirements(self): def config_options(self): if self.settings.os != "Linux": del self.options.with_icu + del self.options.with_fontconfig + del self.options.with_libalsa 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)") @@ -184,13 +186,14 @@ def config_options(self): del self.options.with_mysql if self.settings.os == "Windows": del self.options.with_mysql + if self.settings.os == "Macos": + del self.settings.os.version def configure(self): if self.options.opengl == "auto": self.options.opengl = ("dynamic" if self.settings.os == "Windows" else "desktop") - if self.settings.os != 'Linux': - # self.options.with_libiconv = False # QTBUG-84708 - del self.options.with_fontconfig + #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. " @@ -208,9 +211,6 @@ def configure(self): del self.options.with_libalsa del self.options.with_openal - if self.settings.os != "Linux": - del self.options.with_libalsa - if self.options.qtwebengine: if not self.options.shared: raise ConanInvalidConfiguration("Static builds of Qt Webengine are not supported") @@ -230,9 +230,6 @@ def configure(self): 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.settings.os == "Macos": - del self.settings.os.version - if self.options.multiconfiguration: del self.settings.build_type From 38ad95078366e445e42d7ad95c3eaad757c271e5 Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Fri, 25 Sep 2020 07:53:48 +0000 Subject: [PATCH 39/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.26.0 --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 30a94da842a6f..4f5c12ad3874f 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -261,7 +261,7 @@ def requirements(self): self.requires("pcre2/10.33") if self.options.with_glib: - self.requires("glib/2.65.1") + self.requires("glib/2.66.0") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: From 5ddbeb222d3f794c134e77902d50a4f7fb659b40 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Sun, 18 Oct 2020 09:33:08 +0200 Subject: [PATCH 40/61] Apply suggestions from code review Co-authored-by: Anonymous Maarten --- recipes/qt/all/conanfile.py | 55 ++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 4f5c12ad3874f..be6aeb0bb4448 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -77,7 +77,7 @@ class QtConan(ConanFile): "with_openal": [True, False], "with_zstd": [True, False], - "GUI": [True, False], + "gui": [True, False], "widgets": [True, False], "device": "ANY", @@ -113,7 +113,7 @@ class QtConan(ConanFile): "with_openal": True, "with_zstd": True, - "GUI": True, + "gui": True, "widgets": True, "device": None, @@ -134,12 +134,9 @@ def build_requirements(self): self.build_requires("ninja/1.10.0") # gperf, bison, flex, python >= 2.7.5 & < 3 if self.settings.os != "Windows": - if not tools.which("bison"): - self.build_requires("bison/3.5.3") - if not tools.which("gperf"): - self.build_requires("gperf/3.1") - if not tools.which("flex"): - self.build_requires("flex/2.6.4") + self.build_requires("bison/3.7.1") + self.build_requires("gperf/3.1") + self.build_requires("flex/2.6.4") # Check if a valid python2 is available in PATH or it will failflex # Start by checking if python2 can be found @@ -195,10 +192,10 @@ 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: + 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 del self.options.with_freetype @@ -256,12 +253,12 @@ def _enablemodule(mod): def requirements(self): if self.options.openssl: - self.requires("openssl/1.1.1g") + self.requires("openssl/1.1.1h") if self.options.with_pcre2: - self.requires("pcre2/10.33") + self.requires("pcre2/10.35") if self.options.with_glib: - self.requires("glib/2.66.0") + self.requires("glib/2.66.1") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -271,15 +268,15 @@ def requirements(self): if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.91") if self.options.get_safe("with_icu", False): - self.requires("icu/64.2") + self.requires("icu/67.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/2.6.8") + self.requires("harfbuzz/2.7.2") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: self.requires("libjpeg/9d") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.37") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.32.2") + self.requires("sqlite3/3.33.0") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): self.requires("libmysqlclient/8.0.17") @@ -289,10 +286,10 @@ def requirements(self): if self.settings.os != "Windows": self.requires("odbc/2.3.7") if self.options.get_safe("with_openal", False): - self.requires("openal/1.19.1") + self.requires("openal/1.20.1") if self.options.get_safe("with_libalsa", False): - self.requires("libalsa/1.1.9") - if self.options.GUI and self.settings.os == "Linux": + self.requires("libalsa/1.2.2") + 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/0.10.0") @@ -301,7 +298,7 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.4.5") if self.options.qtwebengine and self.settings.os == "Linux": - self.requires("expat/2.2.9") + self.requires("expat/2.2.10") self.requires("opus/1.3.1") def source(self): @@ -415,7 +412,7 @@ def build(self): args.append("-commercial") else: args.append("-opensource") - if not self.options.GUI: + if not self.options.gui: args.append("-no-gui") if not self.options.widgets: args.append("-no-widgets") @@ -638,14 +635,10 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "licenses", module)) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - for file_to_remove in glob.glob(os.path.join(self.package_folder, "lib", "*.la*")): - os.remove(file_to_remove) - for file_to_remove in glob.glob(os.path.join(self.package_folder, "lib", "*.pdb*")): - os.remove(file_to_remove) - for root, dirs, files in os.walk(os.path.join(self.package_folder, "bin")): - for name in files: - if name.endswith('.pdb'): - os.remove(os.path.join(root, name)) + tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.la*') + tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.pdb*') + for root, _, _ in os.walk(os.path.join(self.package_folder, 'bin')): + tools.remove_files_by_mask(root, '*.pdb') def package_id(self): del self.info.options.cross_compile From 8d9729a41978c5b3a7d8c7bdc83027be31d54f29 Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Sun, 18 Oct 2020 07:33:47 +0000 Subject: [PATCH 41/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.27.0 --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index be6aeb0bb4448..c5a468030c932 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -131,7 +131,7 @@ def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self.options.qtwebengine: - self.build_requires("ninja/1.10.0") + self.build_requires("ninja/1.10.1") # gperf, bison, flex, python >= 2.7.5 & < 3 if self.settings.os != "Windows": self.build_requires("bison/3.7.1") From b949026cfc711e3f1ccd30e5a8c20fead7275b02 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 28 Oct 2020 18:14:31 +0100 Subject: [PATCH 42/61] remove the "auto" options trick --- recipes/qt/all/conanfile.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index c5a468030c932..31f04980555cc 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -56,7 +56,7 @@ class QtConan(ConanFile): "shared": [True, False], "commercial": [True, False], - "opengl": ["no", "es2", "desktop", "dynamic", "auto"], + "opengl": ["no", "es2", "desktop", "dynamic"], "with_vulkan": [True, False], "openssl": [True, False], "with_pcre2": [True, False], @@ -92,7 +92,7 @@ class QtConan(ConanFile): default_options = { "shared": False, "commercial": False, - "opengl": "auto", + "opengl": "desktop", "with_vulkan": False, "openssl": True, "with_pcre2": True, @@ -182,13 +182,12 @@ def config_options(self): if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5.3": del self.options.with_mysql if self.settings.os == "Windows": - del self.options.with_mysql + self.options.with_mysql = False + self.options.opengl = "dynamic" if self.settings.os == "Macos": del self.settings.os.version def configure(self): - if self.options.opengl == "auto": - self.options.opengl = ("dynamic" if self.settings.os == "Windows" else "desktop") #if self.settings.os != 'Linux': # self.options.with_libiconv = False # QTBUG-84708 From f77509187d1d01ca21b197735d1191c85c984de4 Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Wed, 28 Oct 2020 17:15:18 +0000 Subject: [PATCH 43/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.28.0 --- recipes/qt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 31f04980555cc..fa3e28f379b79 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -257,13 +257,13 @@ def requirements(self): self.requires("pcre2/10.35") if self.options.with_glib: - self.requires("glib/2.66.1") + self.requires("glib/2.66.2") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.1.5") if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: - self.requires("freetype/2.10.2") + self.requires("freetype/2.10.4") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.91") if self.options.get_safe("with_icu", False): From b1dd50f0299670bc6c8102029dbf4923ae319c21 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 24 Nov 2020 18:43:21 +0100 Subject: [PATCH 44/61] fix macos authored by @narcdev --- recipes/qt/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index fa3e28f379b79..9a37f41851978 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -602,6 +602,11 @@ def _getenvpath(var): if self.settings.os == "Windows": build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")] with tools.environment_append(build_env): + + if tools.os_info.is_macos: + open(".qmake.stash" , 'w').close() + open(".qmake.super" , 'w').close() + self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True) if tools.os_info.is_macos: with open("bash_env", "w") as f: From a33aa3a30a93a017c837e641d7a33a8a1d192259 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 24 Nov 2020 18:47:51 +0100 Subject: [PATCH 45/61] add support for libjpeg-turbo authored by @Renari --- recipes/qt/all/conanfile.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index 9a37f41851978..b4ea6cb56253e 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -67,7 +67,7 @@ class QtConan(ConanFile): "with_fontconfig": [True, False], "with_icu": [True, False], "with_harfbuzz": [True, False], - "with_libjpeg": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], "with_libpng": [True, False], "with_sqlite3": [True, False], "with_mysql": [True, False], @@ -103,7 +103,7 @@ class QtConan(ConanFile): "with_fontconfig": True, "with_icu": True, "with_harfbuzz": False, - "with_libjpeg": True, + "with_libjpeg": "libjpeg", "with_libpng": True, "with_sqlite3": True, "with_mysql": True, @@ -271,7 +271,10 @@ def requirements(self): if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: self.requires("harfbuzz/2.7.2") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: - self.requires("libjpeg/9d") + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.0.5") + else: + self.requires("libjpeg/9d") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.37") if self.options.with_sqlite3 and not self.options.multiconfiguration: @@ -507,6 +510,7 @@ def build(self): ("icu", "ICU"), ("harfbuzz", "HARFBUZZ"), ("libjpeg", "LIBJPEG"), + ("libjpeg-turbo", "LIBJPEG"), ("libpng", "LIBPNG"), ("sqlite3", "SQLITE"), ("libmysqlclient", "MYSQL"), From 316b05ff87713bfea14cf7ce864e2a72e64c062e Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 24 Nov 2020 18:56:48 +0100 Subject: [PATCH 46/61] populate cpp_info authored by @atrelinski --- recipes/qt/all/conanfile.py | 29 ++++++++++++++++++++++ recipes/qt/all/test_package/CMakeLists.txt | 18 ++++++++++++++ recipes/qt/all/test_package/conanfile.py | 23 +++++++++++++++-- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 recipes/qt/all/test_package/CMakeLists.txt diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index b4ea6cb56253e..ab7146ba03269 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -647,6 +647,10 @@ def package(self): tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.pdb*') for root, _, _ in os.walk(os.path.join(self.package_folder, 'bin')): tools.remove_files_by_mask(root, '*.pdb') + # "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains + # symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll". + for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")): + os.remove(fl) def package_id(self): del self.info.options.cross_compile @@ -657,6 +661,31 @@ def package_id(self): else: self.info.settings.compiler.runtime = "MT/MTd" + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + + # Add top level include directory, so code compile if someone uses + # includes with prefixes (e.g. "#include ") + self.cpp_info.includedirs = ['include'] + + # 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 + + 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 + + @staticmethod def _remove_duplicate(l): seen = set() diff --git a/recipes/qt/all/test_package/CMakeLists.txt b/recipes/qt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3181606a21156 --- /dev/null +++ b/recipes/qt/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1.0) + +set(CMAKE_CXX_STANDARD 11) + +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +find_package(qt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp greeter.h moc_greeter.cpp) +# 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) diff --git a/recipes/qt/all/test_package/conanfile.py b/recipes/qt/all/test_package/conanfile.py index 92cdfc2c9e928..60ea56750feff 100644 --- a/recipes/qt/all/test_package/conanfile.py +++ b/recipes/qt/all/test_package/conanfile.py @@ -1,13 +1,13 @@ import os import shutil -from conans import ConanFile, tools, Meson, RunEnvironment +from conans import ConanFile, tools, Meson, RunEnvironment, CMake from conans.errors import ConanException class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "qt" + generators = "qt", "cmake", "cmake_find_package_multi" def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": @@ -73,9 +73,22 @@ def _build_with_meson(self): raise meson.build() + def _build_with_cmake_find_package_multi(self): + self.output.info("Building with cmake_find_package_multi") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.14' + + self.run("moc %s -o moc_greeter.cpp" % os.path.join(self.source_folder, "greeter.h"), run_environment=True) + cmake.configure() + cmake.build() + def build(self): self._build_with_qmake() self._build_with_meson() + self._build_with_cmake_find_package_multi() def _test_with_qmake(self): self.output.info("Testing qmake") @@ -90,8 +103,14 @@ def _test_with_meson(self): self.output.info("Testing Meson") shutil.copy("qt.conf", "meson_folder") self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake_find_package_multi(self): + self.output.info("Testing CMake_find_package_multi") + shutil.copy("qt.conf", "bin") + self.run(os.path.join("bin", "test_package"), run_environment=True) def test(self): if not tools.cross_building(self.settings, skip_x64_x86=True): self._test_with_qmake() self._test_with_meson() + self._test_with_cmake_find_package_multi() From ecdff9c95b79d47e94b16b80892d942db19ed183 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Tue, 24 Nov 2020 18:56:58 +0100 Subject: [PATCH 47/61] qt 5.15.2 --- recipes/qt/all/conandata.yml | 8 ++++---- recipes/qt/config.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/qt/all/conandata.yml b/recipes/qt/all/conandata.yml index 08acf527f0bf1..6d6f7c74ca10e 100644 --- a/recipes/qt/all/conandata.yml +++ b/recipes/qt/all/conandata.yml @@ -1,9 +1,9 @@ sources: - "5.15.1": - url: "https://download.qt.io/archive/qt/5.15/5.15.1/single/qt-everywhere-src-5.15.1.tar.xz" - sha256: "44da876057e21e1be42de31facd99be7d5f9f07893e1ea762359bcee0ef64ee9" + "5.15.2": + url: "https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" + sha256: "3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240" patches: - "5.15.1": + "5.15.2": - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 0eb4036422f82..835d5cf235d36 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,3 +1,3 @@ versions: - "5.15.1": + "5.15.2": folder: all From f01c7aaa2cfd4539e66306259bf0a81ac815764a Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Tue, 24 Nov 2020 18:24:02 +0000 Subject: [PATCH 48/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.29.0 --- recipes/qt/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index ab7146ba03269..c8e1f1ae18cfb 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -257,7 +257,7 @@ def requirements(self): self.requires("pcre2/10.35") if self.options.with_glib: - self.requires("glib/2.66.2") + self.requires("glib/2.67.0") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -265,9 +265,9 @@ def requirements(self): if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: self.requires("freetype/2.10.4") if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.13.91") + self.requires("fontconfig/2.13.92") if self.options.get_safe("with_icu", False): - self.requires("icu/67.1") + self.requires("icu/68.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: self.requires("harfbuzz/2.7.2") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: @@ -290,7 +290,7 @@ def requirements(self): if self.options.get_safe("with_openal", False): self.requires("openal/1.20.1") if self.options.get_safe("with_libalsa", False): - self.requires("libalsa/1.2.2") + self.requires("libalsa/1.2.4") if self.options.gui and self.settings.os == "Linux": self.requires("xorg/system") if not tools.cross_building(self, skip_x64_x86=True): From 9a883671e32062d55808cb1f5ef20283b7ca9ca4 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 25 Nov 2020 07:24:58 +0100 Subject: [PATCH 49/61] upgrade xkbcommon --- recipes/qt/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/all/conanfile.py index c8e1f1ae18cfb..2c6e84c34c8f3 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/all/conanfile.py @@ -294,7 +294,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/0.10.0") + self.requires("xkbcommon/1.0.3") if self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: From 0d6c9d79358e71789dd1d90023e6bd66ee9b017f Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 7 Dec 2020 08:53:35 +0100 Subject: [PATCH 50/61] move to 5.x.x and export modules by version --- recipes/qt/{all => 5.x.x}/conandata.yml | 0 recipes/qt/{all => 5.x.x}/conanfile.py | 60 ++++++++++--------- .../qt/{all => 5.x.x}/patches/aa2a39dea5.diff | 0 .../qt/{all => 5.x.x}/patches/c72097e.diff | 0 .../qt/{all => 5.x.x}/patches/c994a33.diff | 0 .../qt/{all => 5.x.x}/patches/e2eb6e9.diff | 0 .../qtmodules5.15.2.conf} | 0 .../test_package/CMakeLists.txt | 0 .../{all => 5.x.x}/test_package/conanfile.py | 0 .../qt/{all => 5.x.x}/test_package/greeter.h | 0 .../{all => 5.x.x}/test_package/meson.build | 0 .../test_package/test_package.cpp | 0 .../test_package/test_package.pro | 0 recipes/qt/config.yml | 2 +- 14 files changed, 33 insertions(+), 29 deletions(-) rename recipes/qt/{all => 5.x.x}/conandata.yml (100%) rename recipes/qt/{all => 5.x.x}/conanfile.py (94%) rename recipes/qt/{all => 5.x.x}/patches/aa2a39dea5.diff (100%) rename recipes/qt/{all => 5.x.x}/patches/c72097e.diff (100%) rename recipes/qt/{all => 5.x.x}/patches/c994a33.diff (100%) rename recipes/qt/{all => 5.x.x}/patches/e2eb6e9.diff (100%) rename recipes/qt/{all/qtmodules.conf => 5.x.x/qtmodules5.15.2.conf} (100%) rename recipes/qt/{all => 5.x.x}/test_package/CMakeLists.txt (100%) rename recipes/qt/{all => 5.x.x}/test_package/conanfile.py (100%) rename recipes/qt/{all => 5.x.x}/test_package/greeter.h (100%) rename recipes/qt/{all => 5.x.x}/test_package/meson.build (100%) rename recipes/qt/{all => 5.x.x}/test_package/test_package.cpp (100%) rename recipes/qt/{all => 5.x.x}/test_package/test_package.pro (100%) diff --git a/recipes/qt/all/conandata.yml b/recipes/qt/5.x.x/conandata.yml similarity index 100% rename from recipes/qt/all/conandata.yml rename to recipes/qt/5.x.x/conandata.yml diff --git a/recipes/qt/all/conanfile.py b/recipes/qt/5.x.x/conanfile.py similarity index 94% rename from recipes/qt/all/conanfile.py rename to recipes/qt/5.x.x/conanfile.py index 2c6e84c34c8f3..501458cd6b33f 100644 --- a/recipes/qt/all/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -20,27 +20,13 @@ def content(self): return "[Paths]\nPrefix = %s\n" % self.conanfile.deps_cpp_info["qt"].rootpath.replace("\\", "/") -def _getsubmodules(): - config = configparser.ConfigParser() - config.read('qtmodules.conf') - res = {} - assert config.sections() - for s in config.sections(): - section = str(s) - assert section.startswith("submodule ") - assert section.count('"') == 2 - modulename = section[section.find('"') + 1: section.rfind('"')] - status = str(config.get(section, "status")) - if status != "obsolete" and status != "ignore": - res[modulename] = {"status": status, - "path": str(config.get(section, "path")), "depends": []} - if config.has_option(section, "depends"): - res[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] - return res - - class QtConan(ConanFile): - _submodules = _getsubmodules() + _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtscript", "qtmultimedia", "qttools", "qtxmlpatterns", + "qttranslations", "qtdoc", "qtrepotools", "qtqa", "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", + "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d"] generators = "pkg_config" name = "qt" @@ -49,7 +35,7 @@ class QtConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.qt.io" license = "LGPL-3.0" - exports = ["qtmodules.conf", "patches/*.diff"] + exports = ["patches/*.diff"] settings = "os", "arch", "compiler", "build_type" options = { @@ -86,7 +72,7 @@ class QtConan(ConanFile): "config": "ANY", "multiconfiguration": [True, False], } - options.update({module: [True, False] for module in _submodules if module != 'qtbase'}) + options.update({module: [True, False] for module in _submodules}) no_copy_source = True default_options = { @@ -122,11 +108,14 @@ class QtConan(ConanFile): "config": None, "multiconfiguration": False, } - default_options.update({module: False for module in _submodules if module != 'qtbase'}) + default_options.update({module: False for module in _submodules}) requires = "zlib/1.2.11" short_paths = True + def export(self): + self.copy("qtmodules%s.conf" % self.version) + def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") @@ -240,14 +229,30 @@ def configure(self): 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") + config = configparser.ConfigParser() + config.read(os.path.join(self.recipe_folder, 'qtmodules%s.conf' % self.version)) + submodules_tree = {} + assert config.sections() + for s in config.sections(): + section = str(s) + assert section.startswith("submodule ") + assert section.count('"') == 2 + modulename = section[section.find('"') + 1: section.rfind('"')] + status = str(config.get(section, "status")) + if status != "obsolete" and status != "ignore": + submodules_tree[modulename] = {"status": status, + "path": str(config.get(section, "path")), "depends": []} + if config.has_option(section, "depends"): + submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] + def _enablemodule(mod): if mod != 'qtbase': setattr(self.options, mod, True) - for req in self._submodules[mod]["depends"]: + for req in submodules_tree[mod]["depends"]: _enablemodule(req) for module in self._submodules: - if module != 'qtbase' and getattr(self.options, module): + if getattr(self.options, module): _enablemodule(module) def requirements(self): @@ -439,8 +444,7 @@ def build(self): args.append("-optimize-size") for module in self._submodules: - if module != 'qtbase' and not getattr(self.options, module) \ - and os.path.isdir(os.path.join(self.source_folder, 'qt5', self._submodules[module]['path'])): + if not getattr(self.options, module): args.append("-skip " + module) args.append("--zlib=system") @@ -639,7 +643,7 @@ def package(self): Examples = bin/datadir/examples""") self.copy("*LICENSE*", src="qt5/", dst="licenses") for module in self._submodules: - if module != 'qtbase' and not getattr(self.options, module): + if not getattr(self.options, module): tools.rmdir(os.path.join(self.package_folder, "licenses", module)) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/qt/all/patches/aa2a39dea5.diff b/recipes/qt/5.x.x/patches/aa2a39dea5.diff similarity index 100% rename from recipes/qt/all/patches/aa2a39dea5.diff rename to recipes/qt/5.x.x/patches/aa2a39dea5.diff diff --git a/recipes/qt/all/patches/c72097e.diff b/recipes/qt/5.x.x/patches/c72097e.diff similarity index 100% rename from recipes/qt/all/patches/c72097e.diff rename to recipes/qt/5.x.x/patches/c72097e.diff diff --git a/recipes/qt/all/patches/c994a33.diff b/recipes/qt/5.x.x/patches/c994a33.diff similarity index 100% rename from recipes/qt/all/patches/c994a33.diff rename to recipes/qt/5.x.x/patches/c994a33.diff diff --git a/recipes/qt/all/patches/e2eb6e9.diff b/recipes/qt/5.x.x/patches/e2eb6e9.diff similarity index 100% rename from recipes/qt/all/patches/e2eb6e9.diff rename to recipes/qt/5.x.x/patches/e2eb6e9.diff diff --git a/recipes/qt/all/qtmodules.conf b/recipes/qt/5.x.x/qtmodules5.15.2.conf similarity index 100% rename from recipes/qt/all/qtmodules.conf rename to recipes/qt/5.x.x/qtmodules5.15.2.conf diff --git a/recipes/qt/all/test_package/CMakeLists.txt b/recipes/qt/5.x.x/test_package/CMakeLists.txt similarity index 100% rename from recipes/qt/all/test_package/CMakeLists.txt rename to recipes/qt/5.x.x/test_package/CMakeLists.txt diff --git a/recipes/qt/all/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py similarity index 100% rename from recipes/qt/all/test_package/conanfile.py rename to recipes/qt/5.x.x/test_package/conanfile.py diff --git a/recipes/qt/all/test_package/greeter.h b/recipes/qt/5.x.x/test_package/greeter.h similarity index 100% rename from recipes/qt/all/test_package/greeter.h rename to recipes/qt/5.x.x/test_package/greeter.h diff --git a/recipes/qt/all/test_package/meson.build b/recipes/qt/5.x.x/test_package/meson.build similarity index 100% rename from recipes/qt/all/test_package/meson.build rename to recipes/qt/5.x.x/test_package/meson.build diff --git a/recipes/qt/all/test_package/test_package.cpp b/recipes/qt/5.x.x/test_package/test_package.cpp similarity index 100% rename from recipes/qt/all/test_package/test_package.cpp rename to recipes/qt/5.x.x/test_package/test_package.cpp diff --git a/recipes/qt/all/test_package/test_package.pro b/recipes/qt/5.x.x/test_package/test_package.pro similarity index 100% rename from recipes/qt/all/test_package/test_package.pro rename to recipes/qt/5.x.x/test_package/test_package.pro diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 835d5cf235d36..b482fbebe2f42 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,3 +1,3 @@ versions: "5.15.2": - folder: all + folder: 5.x.x From 354c8dd12c10eb7da62969ff7a3f3dd79d4875f0 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 22 Jan 2021 07:31:10 +0100 Subject: [PATCH 51/61] add mirrors --- recipes/qt/5.x.x/conandata.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index 6d6f7c74ca10e..610312a1371bd 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,6 +1,10 @@ sources: "5.15.2": - url: "https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" + url: + - "https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" sha256: "3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240" patches: "5.15.2": From 9ded6ac79f87cf633011a19a08530b629d99466b Mon Sep 17 00:00:00 2001 From: bincrafters-user Date: Fri, 22 Jan 2021 06:31:46 +0000 Subject: [PATCH 52/61] qt: Update Conan conventions Automatically created by bincrafters-conventions 0.30.2 --- recipes/qt/5.x.x/conanfile.py | 14 +++++++------- recipes/qt/5.x.x/test_package/conanfile.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 501458cd6b33f..9499486c7f1d2 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -120,7 +120,7 @@ def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self.options.qtwebengine: - self.build_requires("ninja/1.10.1") + self.build_requires("ninja/1.10.2") # gperf, bison, flex, python >= 2.7.5 & < 3 if self.settings.os != "Windows": self.build_requires("bison/3.7.1") @@ -257,12 +257,12 @@ def _enablemodule(mod): def requirements(self): if self.options.openssl: - self.requires("openssl/1.1.1h") + self.requires("openssl/1.1.1i") if self.options.with_pcre2: self.requires("pcre2/10.35") if self.options.with_glib: - self.requires("glib/2.67.0") + self.requires("glib/2.67.1") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -272,12 +272,12 @@ def requirements(self): if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.92") if self.options.get_safe("with_icu", False): - self.requires("icu/68.1") + self.requires("icu/68.2") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/2.7.2") + self.requires("harfbuzz/2.7.4") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.0.5") + self.requires("libjpeg-turbo/2.0.6") else: self.requires("libjpeg/9d") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: @@ -303,7 +303,7 @@ def requirements(self): if self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: - self.requires("zstd/1.4.5") + self.requires("zstd/1.4.8") if self.options.qtwebengine and self.settings.os == "Linux": self.requires("expat/2.2.10") self.requires("opus/1.3.1") diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py index 60ea56750feff..774a485421dc7 100644 --- a/recipes/qt/5.x.x/test_package/conanfile.py +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -13,7 +13,7 @@ def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self._meson_supported(): - self.build_requires("meson/0.54.2") + self.build_requires("meson/0.56.2") def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" From 8fa795737fd5430eb274d8201cb81d0182657c36 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 07:51:24 +0100 Subject: [PATCH 53/61] remove unused patch files --- recipes/qt/5.x.x/patches/c994a33.diff | 27 --------------------------- recipes/qt/5.x.x/patches/e2eb6e9.diff | 27 --------------------------- 2 files changed, 54 deletions(-) delete mode 100644 recipes/qt/5.x.x/patches/c994a33.diff delete mode 100644 recipes/qt/5.x.x/patches/e2eb6e9.diff diff --git a/recipes/qt/5.x.x/patches/c994a33.diff b/recipes/qt/5.x.x/patches/c994a33.diff deleted file mode 100644 index 0829b02a69b79..0000000000000 --- a/recipes/qt/5.x.x/patches/c994a33.diff +++ /dev/null @@ -1,27 +0,0 @@ -From c994a334701ab80fcc154f5330492c751d1e2490 Mon Sep 17 00:00:00 2001 -From: Eric Lemanissier -Date: Tue, 26 May 2020 16:51:08 +0000 -Subject: [PATCH] QMimeDatabase/xml: use xmlstarlet instead of xml - -some distributions (eg Ubuntu) don't provide xml executable, but only xmlstarlet executable - -Change-Id: Icc801ded8d4ec1ec4d1dab93289a2365f8cd9cbd -Pick-to: 5.15 ---- - -diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl -index 0f87d61..4c1cb5b 100644 ---- a/src/corelib/mimetypes/mime/generate.pl -+++ b/src/corelib/mimetypes/mime/generate.pl -@@ -67,9 +67,9 @@ - - # Check if xml (from xmlstarlet) is in $PATH - my $cmd; --if (checkCommand("xml")) { -+if (checkCommand("xmlstarlet")) { - # Minify the data before compressing -- $cmd = "xml sel -D -B -t -c / $fname"; -+ $cmd = "xmlstarlet sel -D -B -t -c / $fname"; - $cmd .= "| $compress" if $compress; - } elsif ($compress) { - $cmd = "$compress < $fname" diff --git a/recipes/qt/5.x.x/patches/e2eb6e9.diff b/recipes/qt/5.x.x/patches/e2eb6e9.diff deleted file mode 100644 index 588d9d38e8b5c..0000000000000 --- a/recipes/qt/5.x.x/patches/e2eb6e9.diff +++ /dev/null @@ -1,27 +0,0 @@ -From e2eb6e9bf75957b3139aefc4827d6256458d8836 Mon Sep 17 00:00:00 2001 -From: Thiago Macieira -Date: Tue, 26 May 2020 09:10:39 -0700 -Subject: [PATCH] QMimeDatabase/zstd: use -T1 instead of --single-thread - -Some older versions of the command-line tool don't have --single-thread -but do have -T1. They're slightly different according to the -documentation, but it's not important to us. What we want is to make -sure we consume a single CPU during build. - -Pick-To: 5.15 -Change-Id: Ied637aece2a7427b8a2dfffd16129fe88a0466ee ---- - -diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl -index 0f87d61..8ac4b50 100644 ---- a/src/corelib/mimetypes/mime/generate.pl -+++ b/src/corelib/mimetypes/mime/generate.pl -@@ -60,7 +60,7 @@ - if ($fname eq "--zstd") { - $fname = shift @ARGV; - if (checkCommand("zstd")) { -- $compress = "zstd -cq19 --single-thread"; -+ $compress = "zstd -cq19 -T1"; - $macro = "MIME_DATABASE_IS_ZSTD"; - } - } From 4bd44adb9ff6269bc11d2b5311887c42c64ae9ce Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 07:54:19 +0100 Subject: [PATCH 54/61] fixup tools.Version usage --- recipes/qt/5.x.x/conanfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9499486c7f1d2..942aca5a4c4c7 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -4,10 +4,9 @@ import glob import configparser -from conans import ConanFile, tools, __version__ as conan_version, RunEnvironment +from conans import ConanFile, tools, RunEnvironment from conans.errors import ConanInvalidConfiguration from conans.model import Generator -from conans.tools import Version class qt(Generator): @@ -168,7 +167,7 @@ def config_options(self): 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 == "gcc" and Version(self.settings.compiler.version) < "5.3": + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5.3": del self.options.with_mysql if self.settings.os == "Windows": self.options.with_mysql = False From e57d6fbc216d4ce117c2f9b670b4373b5fd7449f Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 07:55:23 +0100 Subject: [PATCH 55/61] don't dlete settings.os.version on macos --- recipes/qt/5.x.x/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 942aca5a4c4c7..97732aff90eca 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -172,8 +172,6 @@ def config_options(self): if self.settings.os == "Windows": self.options.with_mysql = False self.options.opengl = "dynamic" - if self.settings.os == "Macos": - del self.settings.os.version def configure(self): #if self.settings.os != 'Linux': From 210c9549bc23b3e9c39788f053e97265d6c02065 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 07:58:51 +0100 Subject: [PATCH 56/61] smarter patch application --- recipes/qt/5.x.x/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 97732aff90eca..23de1e1dabae1 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -309,8 +309,8 @@ def source(self): tools.get(**self.conan_data["sources"][self.version]) shutil.move("qt-everywhere-src-%s" % self.version, "qt5") - for p in self.conan_data["patches"][self.version]: - tools.patch(**p) + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: tools.replace_in_file(os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), " if (enable_precompiled_headers) {\n if (is_win) {", From 463468dd46d6a5f4e1bcdf14b21090dd9b5a7f53 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 08:01:10 +0100 Subject: [PATCH 57/61] add winrt on msvc 2019 --- recipes/qt/5.x.x/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 23de1e1dabae1..90343b3954aad 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -372,7 +372,10 @@ def _xplatform(self): "x86_64": "winrt-x64-msvc2015"}, "15": {"armv7": "winrt-arm-msvc2017", "x86": "winrt-x86-msvc2017", - "x86_64": "winrt-x64-msvc2017"} + "x86_64": "winrt-x64-msvc2017"}, + "16": {"armv7": "winrt-arm-msvc2019", + "x86": "winrt-x86-msvc2019", + "x86_64": "winrt-x64-msvc2019"} }.get(str(self.settings.compiler.version)).get(str(self.settings.arch)) elif self.settings.os == "FreeBSD": From 87ff60071e7e84c90ae9f1dae62d632ac01f3aa8 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 08:05:03 +0100 Subject: [PATCH 58/61] fixup ConanInvalidConfiguration --- recipes/qt/5.x.x/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 90343b3954aad..3de76bc1d6c09 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -167,6 +167,9 @@ def config_options(self): 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") if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5.3": del self.options.with_mysql if self.settings.os == "Windows": @@ -406,9 +409,6 @@ def _xplatform(self): return None def build(self): - if self.settings.compiler in ["gcc", "clang"]: - if tools.Version(self.settings.compiler.version) < "5.0": - raise ConanInvalidConfiguration("qt 5.15.0 is not support on GCC or clang before 5.0") args = ["-confirm-license", "-silent", "-nomake examples", "-nomake tests", "-prefix %s" % self.package_folder] args.append("-v") From 1c9259b77e2ba8694b61287c1714a83a76f4f6a9 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 08:09:27 +0100 Subject: [PATCH 59/61] use get_safe --- recipes/qt/5.x.x/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 3de76bc1d6c09..a2d30477009d6 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -252,7 +252,7 @@ def _enablemodule(mod): _enablemodule(req) for module in self._submodules: - if getattr(self.options, module): + if self.options.get_safe(module): _enablemodule(module) def requirements(self): @@ -444,7 +444,7 @@ def build(self): args.append("-optimize-size") for module in self._submodules: - if not getattr(self.options, module): + if not self.options.get_safe(module): args.append("-skip " + module) args.append("--zlib=system") @@ -495,7 +495,7 @@ def build(self): ("with_libjpeg", "libjpeg"), ("with_libpng", "libpng"), ("with_sqlite3", "sqlite")]: - if getattr(self.options, opt, False): + if self.options.get_safe(opt, False): if self.options.multiconfiguration: args += ["-qt-" + conf_arg] else: @@ -643,7 +643,7 @@ def package(self): Examples = bin/datadir/examples""") self.copy("*LICENSE*", src="qt5/", dst="licenses") for module in self._submodules: - if not getattr(self.options, module): + if not self.options.get_safe(module): tools.rmdir(os.path.join(self.package_folder, "licenses", module)) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) From b8ee11f865e66c0cf3449763e25488b55b1e9011 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 08:10:51 +0100 Subject: [PATCH 60/61] simplify remove_files_by_mask --- recipes/qt/5.x.x/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index a2d30477009d6..0077f839928fc 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -649,8 +649,7 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.la*') tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.pdb*') - for root, _, _ in os.walk(os.path.join(self.package_folder, 'bin')): - tools.remove_files_by_mask(root, '*.pdb') + tools.remove_files_by_mask(os.path.join(self.package_folder, 'bin'), '*.pdb') # "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains # symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll". for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")): From 0c10c0cf75e0547c134515b78999d799b407dc41 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Wed, 27 Jan 2021 08:37:37 +0100 Subject: [PATCH 61/61] formatting --- recipes/qt/5.x.x/conanfile.py | 79 ++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 0077f839928fc..cdb23cde81d85 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -20,10 +20,10 @@ def content(self): class QtConan(ConanFile): - _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtscript", "qtmultimedia", "qttools", "qtxmlpatterns", + _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtscript", "qtmultimedia", "qttools", "qtxmlpatterns", "qttranslations", "qtdoc", "qtrepotools", "qtqa", "qtlocation", "qtsensors", "qtconnectivity", "qtwayland", "qt3d", "qtimageformats", "qtgraphicaleffects", "qtquickcontrols", "qtserialbus", "qtserialport", "qtx11extras", - "qtmacextras", "qtwinextras", "qtandroidextras", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", + "qtmacextras", "qtwinextras", "qtandroidextras", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", "qtquickcontrols2", "qtpurchasing", "qtcharts", "qtdatavis3d", "qtvirtualkeyboard", "qtgamepad", "qtscxml", "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d"] @@ -142,8 +142,8 @@ def build_requirements(self): mybuf = StringIO() cmd_v = "{} --version".format(python_exe) self.run(cmd_v, output=mybuf) - verstr = mybuf.getvalue().strip().split('Python ')[1] - if verstr.endswith('+'): + verstr = mybuf.getvalue().strip().split("Python ")[1] + if verstr.endswith("+"): verstr = verstr[:-1] version = tools.Version(verstr) # >= 2.7.5 & < 3 @@ -177,7 +177,7 @@ def config_options(self): self.options.opengl = "dynamic" def configure(self): - #if self.settings.os != 'Linux': + #if self.settings.os != "Linux": # self.options.with_libiconv = False # QTBUG-84708 if self.options.widgets and not self.options.gui: @@ -219,8 +219,8 @@ def configure(self): 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++') + 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: @@ -230,7 +230,7 @@ def configure(self): raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") config = configparser.ConfigParser() - config.read(os.path.join(self.recipe_folder, 'qtmodules%s.conf' % self.version)) + config.read(os.path.join(self.recipe_folder, "qtmodules%s.conf" % self.version)) submodules_tree = {} assert config.sections() for s in config.sections(): @@ -246,7 +246,7 @@ def configure(self): submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] def _enablemodule(mod): - if mod != 'qtbase': + if mod != "qtbase": setattr(self.options, mod, True) for req in submodules_tree[mod]["depends"]: _enablemodule(req) @@ -527,7 +527,7 @@ def build(self): ("xkbcommon", "XKBCOMMON")] for package, var in libmap: if package in self.deps_cpp_info.deps: - if package == 'freetype': + if package == "freetype": args.append("\"%s_INCDIR=%s\"" % (var, self.deps_cpp_info[package].include_paths[-1])) args.append("\"%s_LIBS=%s\"" % (var, " ".join(self._gather_libs(package)))) @@ -537,10 +537,10 @@ def build(self): args += ["-D %s" % s for s in self.deps_cpp_info[package].defines] args += ["-L \"%s\"" % s for s in self.deps_cpp_info[package].lib_paths] - if 'libmysqlclient' in self.deps_cpp_info.deps: - args.append("-mysql_config \"%s\"" % os.path.join(self.deps_cpp_info['libmysqlclient'].rootpath, "bin", "mysql_config")) - if 'libpq' in self.deps_cpp_info.deps: - args.append("-psql_config \"%s\"" % os.path.join(self.deps_cpp_info['libpq'].rootpath, "bin", "pg_config")) + if "libmysqlclient" in self.deps_cpp_info.deps: + args.append("-mysql_config \"%s\"" % os.path.join(self.deps_cpp_info["libmysqlclient"].rootpath, "bin", "mysql_config")) + if "libpq" in self.deps_cpp_info.deps: + args.append("-psql_config \"%s\"" % os.path.join(self.deps_cpp_info["libpq"].rootpath, "bin", "pg_config")) if self.settings.os == "Macos": args += ["-no-framework"] elif self.settings.os == "Android": @@ -581,7 +581,7 @@ def _getenvpath(var): os.environ[var] = val return val - value = _getenvpath('CC') + value = _getenvpath("CC") if value: args += ['QMAKE_CC="' + value + '"', 'QMAKE_LINK_C="' + value + '"', @@ -597,23 +597,23 @@ def _getenvpath(var): args += ['QMAKE_CXXFLAGS+="-ftemplate-depth=1024"'] if self.options.qtwebengine and self.settings.os == "Linux": - args += ['-qt-webengine-ffmpeg', - '-system-webengine-opus'] + args += ["-qt-webengine-ffmpeg", + "-system-webengine-opus"] if self.options.config: args.append(str(self.options.config)) - os.mkdir('build_folder') - with tools.chdir('build_folder'): + os.mkdir("build_folder") + with tools.chdir("build_folder"): with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [self.build_folder]} if self.settings.os == "Windows": build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")] with tools.environment_append(build_env): - + if tools.os_info.is_macos: - open(".qmake.stash" , 'w').close() - open(".qmake.super" , 'w').close() + open(".qmake.stash" , "w").close() + open(".qmake.super" , "w").close() self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True) if tools.os_info.is_macos: @@ -625,9 +625,9 @@ def _getenvpath(var): self.run(self._make_program(), run_environment=True) def package(self): - with tools.chdir('build_folder'): + with tools.chdir("build_folder"): self.run("%s install" % self._make_program()) - with open(os.path.join(self.package_folder, "bin", "qt.conf"), 'w') as f: + with open(os.path.join(self.package_folder, "bin", "qt.conf"), "w") as f: f.write("""[Paths] Prefix = .. ArchData = bin/archdatadir @@ -647,9 +647,9 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "licenses", module)) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.la*') - tools.remove_files_by_mask(os.path.join(self.package_folder, 'lib'), '*.pdb*') - tools.remove_files_by_mask(os.path.join(self.package_folder, 'bin'), '*.pdb') + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la*") + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb*") + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") # "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains # symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll". for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")): @@ -665,28 +665,29 @@ 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) # Add top level include directory, so code compile if someone uses # includes with prefixes (e.g. "#include ") - self.cpp_info.includedirs = ['include'] + self.cpp_info.includedirs = ["include"] # 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()] + 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 - - 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 + 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 + + 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 @staticmethod