diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml new file mode 100644 index 0000000000000..610312a1371bd --- /dev/null +++ b/recipes/qt/5.x.x/conandata.yml @@ -0,0 +1,14 @@ +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" + - "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": + - patch_file: "patches/aa2a39dea5.diff" + base_path: "qt5/qtbase" + - patch_file: "patches/c72097e.diff" + base_path: "qt5/qtwebengine" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py new file mode 100644 index 0000000000000..cdb23cde81d85 --- /dev/null +++ b/recipes/qt/5.x.x/conanfile.py @@ -0,0 +1,710 @@ +import os +import shutil +import itertools +import glob + +import configparser +from conans import ConanFile, tools, RunEnvironment +from conans.errors import ConanInvalidConfiguration +from conans.model import Generator + + +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("\\", "/") + + +class QtConan(ConanFile): + _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" + 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 = ["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], # QTBUG-84708 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": ["libjpeg", "libjpeg-turbo", 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}) + + no_copy_source = True + default_options = { + "shared": False, + "commercial": False, + "opengl": "desktop", + "with_vulkan": False, + "openssl": True, + "with_pcre2": True, + "with_glib": False, + # "with_libiconv": True, # QTBUG-84708 + "with_doubleconversion": True, + "with_freetype": True, + "with_fontconfig": True, + "with_icu": True, + "with_harfbuzz": False, + "with_libjpeg": "libjpeg", + "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}) + + 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") + if self.options.qtwebengine: + 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") + 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 + 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": + 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)") + 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": + self.options.with_mysql = False + self.options.opengl = "dynamic" + + def configure(self): + #if self.settings.os != "Linux": + # self.options.with_libiconv = False # QTBUG-84708 + + if self.options.widgets and not self.options.gui: + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") + if not self.options.gui: + del self.options.opengl + del self.options.with_vulkan + 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: + del self.options.with_libalsa + del self.options.with_openal + + if self.options.qtwebengine: + if not self.options.shared: + raise ConanInvalidConfiguration("Static builds of Qt Webengine are not supported") + + if tools.cross_building(self.settings, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") + + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported") + + if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") + + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if self.options.multiconfiguration: + del self.settings.build_type + + if not self.options.with_doubleconversion and str(self.settings.compiler.libcxx) != "libc++": + raise ConanInvalidConfiguration("Qt without libc++ needs qt:with_doubleconversion. " + "Either enable qt:with_doubleconversion or switch to libc++") + + if tools.os_info.is_linux: + if self.options.qtwebengine: + self.options.with_fontconfig = True + + if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: + raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + + 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 submodules_tree[mod]["depends"]: + _enablemodule(req) + + for module in self._submodules: + if self.options.get_safe(module): + _enablemodule(module) + + def requirements(self): + if self.options.openssl: + 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.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: + 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.4") + 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.2") + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + 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.6") + 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: + 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") + if self.options.with_pq: + self.requires("libpq/12.2") + if self.options.with_odbc: + if self.settings.os != "Windows": + self.requires("odbc/2.3.7") + 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.4") + if self.options.gui and self.settings.os == "Linux": + self.requires("xorg/system") + if not tools.cross_building(self, skip_x64_x86=True): + self.requires("xkbcommon/1.0.3") + if self.options.get_safe("opengl", "no") != "no": + self.requires("opengl/system") + if self.options.with_zstd: + 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") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + shutil.move("qt-everywhere-src-%s" % self.version, "qt5") + + 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) {", + " 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": + if self.settings.compiler == "clang": + return "android-clang" + + 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"}, + "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": + 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") + 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: + 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 not self.options.get_safe(module): + args.append("-skip " + module) + + args.append("--zlib=system") + + # openGL + opengl = self.options.get_safe("opengl", "no") + if opengl == "no": + args += ["-no-opengl"] + elif opengl == "es2": + args += ["-opengl es2"] + elif opengl == "desktop": + args += ["-opengl desktop"] + elif opengl == "dynamic": + args += ["-opengl dynamic"] + + if self.options.get_safe("with_vulkan", False): + 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"))# QTBUG-84708 + + 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.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")) + 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.get_safe("with_libalsa", False) 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 self.options.get_safe(opt, False): + 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"),# QTBUG-84708 + ("double-conversion", "DOUBLECONVERSION"), + ("freetype", "FREETYPE"), + ("fontconfig", "FONTCONFIG"), + ("icu", "ICU"), + ("harfbuzz", "HARFBUZZ"), + ("libjpeg", "LIBJPEG"), + ("libjpeg-turbo", "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\"" % 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 \"%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": + 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)) + + 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() + + 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) + + def package(self): + 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: + 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") + for module in self._submodules: + 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")) + 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*")): + os.remove(fl) + + 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" + + 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"] + + # 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() + seen_add = seen.add + for element in itertools.filterfalse(seen.__contains__, l): + seen_add(element) + 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] + 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) diff --git a/recipes/qt/5.x.x/patches/aa2a39dea5.diff b/recipes/qt/5.x.x/patches/aa2a39dea5.diff new file mode 100644 index 0000000000000..3fe3827463641 --- /dev/null +++ b/recipes/qt/5.x.x/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/5.x.x/patches/c72097e.diff b/recipes/qt/5.x.x/patches/c72097e.diff new file mode 100644 index 0000000000000..56b2679d626fb --- /dev/null +++ b/recipes/qt/5.x.x/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/5.x.x/qtmodules5.15.2.conf b/recipes/qt/5.x.x/qtmodules5.15.2.conf new file mode 100644 index 0000000000000..788b31c881415 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.2.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/5.x.x/test_package/CMakeLists.txt b/recipes/qt/5.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3181606a21156 --- /dev/null +++ b/recipes/qt/5.x.x/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/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..774a485421dc7 --- /dev/null +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -0,0 +1,116 @@ +import os +import shutil + +from conans import ConanFile, tools, Meson, RunEnvironment, CMake +from conans.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "qt", "cmake", "cmake_find_package_multi" + + 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.56.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 _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_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") + 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_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() diff --git a/recipes/qt/5.x.x/test_package/greeter.h b/recipes/qt/5.x.x/test_package/greeter.h new file mode 100644 index 0000000000000..85052e081d4fb --- /dev/null +++ b/recipes/qt/5.x.x/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/5.x.x/test_package/meson.build b/recipes/qt/5.x.x/test_package/meson.build new file mode 100644 index 0000000000000..fac1eb87e2e4b --- /dev/null +++ b/recipes/qt/5.x.x/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/5.x.x/test_package/test_package.cpp b/recipes/qt/5.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..30381b074590c --- /dev/null +++ b/recipes/qt/5.x.x/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/5.x.x/test_package/test_package.pro b/recipes/qt/5.x.x/test_package/test_package.pro new file mode 100644 index 0000000000000..87e086b3aae87 --- /dev/null +++ b/recipes/qt/5.x.x/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..b482fbebe2f42 --- /dev/null +++ b/recipes/qt/config.yml @@ -0,0 +1,3 @@ +versions: + "5.15.2": + folder: 5.x.x