From 874f87f079b397a189bef6442359761efa826448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Fri, 25 Feb 2022 13:25:07 +0100 Subject: [PATCH] XMake: Improve Qt packages --- xmake-repo/packages/a/aqt/xmake.lua | 3 +++ xmake-repo/packages/q/qt5base/xmake.lua | 7 +++++-- xmake-repo/packages/q/qt5core/xmake.lua | 9 ++++++++- xmake-repo/packages/q/qt5gui/xmake.lua | 9 ++++++++- xmake-repo/packages/q/qt5widgets/xmake.lua | 11 ++++++++++- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/xmake-repo/packages/a/aqt/xmake.lua b/xmake-repo/packages/a/aqt/xmake.lua index 968b4e1bb..16b23d3ea 100644 --- a/xmake-repo/packages/a/aqt/xmake.lua +++ b/xmake-repo/packages/a/aqt/xmake.lua @@ -6,6 +6,9 @@ package("aqt") set_license("MIT") if is_host("windows") then + add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) + add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + if os.arch() == "x86" then add_urls("https://github.com/miurahr/aqtinstall/releases/download/v$(version)/aqt_x86.exe") add_versions("2.0.6", "b980985cfeb1cefef1d2ebab91ae4e648873a27fae8831deff8144661480c56a") diff --git a/xmake-repo/packages/q/qt5base/xmake.lua b/xmake-repo/packages/q/qt5base/xmake.lua index d375f4774..884095fcc 100644 --- a/xmake-repo/packages/q/qt5base/xmake.lua +++ b/xmake-repo/packages/q/qt5base/xmake.lua @@ -5,6 +5,9 @@ package("qt5base") set_description("Qt is the faster, smarter way to create innovative devices, modern UIs & applications for multiple screens. Cross-platform software development at its best.") set_license("LGPL-3") + add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) + add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + add_versions("5.15.2", "dummy") add_versions("5.12.5", "dummy") @@ -51,7 +54,6 @@ package("qt5base") end) on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function (package) - local installdir = package:installdir() local version = package:version() or semver.new("5.15.2") local host @@ -140,6 +142,7 @@ package("qt5base") end end + local installdir = package:installdir() os.vrunv("aqt", {"install-qt", "-O", installdir, host, target, version:shortstr(), arch}) -- move files to root @@ -183,7 +186,7 @@ package("qt5base") local installeddir for _, subdir in pairs(subdirs) do - local results = os.dirs(path.join(installdir, version, subdir), function (file, isdir) print(file) print(isdir) return false end) + local results = os.dirs(path.join(installdir, version, subdir), function (file, isdir) return false end) if results and #results > 0 then installeddir = results[1] break diff --git a/xmake-repo/packages/q/qt5core/xmake.lua b/xmake-repo/packages/q/qt5core/xmake.lua index 2286206cb..a89d1a62e 100644 --- a/xmake-repo/packages/q/qt5core/xmake.lua +++ b/xmake-repo/packages/q/qt5core/xmake.lua @@ -4,8 +4,14 @@ package("qt5core") set_description("Qt is the faster, smarter way to create innovative devices, modern UIs & applications for multiple screens. Cross-platform software development at its best.") set_license("LGPL-3") + add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) + add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + + add_versions("5.15.2", "dummy") + add_versions("5.12.5", "dummy") + on_load(function (package) - package:add("deps", "qt5base", {debug = package:is_debug()}) + package:add("deps", "qt5base", {debug = package:is_debug(), version = package:version_str()}) end) on_fetch(function (package) @@ -17,6 +23,7 @@ package("qt5core") return { qtdir = qt, + version = qt.version, includedirs = {qt.includedir, path.join(qt.includedir, "QtCore")}, links = table.wrap("Qt5Core" .. (package:is_plat("windows") and package:is_debug() and "d" or "")), linkdirs = table.wrap(qt.libdir) diff --git a/xmake-repo/packages/q/qt5gui/xmake.lua b/xmake-repo/packages/q/qt5gui/xmake.lua index 5529d4a37..4493bdf47 100644 --- a/xmake-repo/packages/q/qt5gui/xmake.lua +++ b/xmake-repo/packages/q/qt5gui/xmake.lua @@ -4,8 +4,14 @@ package("qt5gui") set_description("Qt is the faster, smarter way to create innovative devices, modern UIs & applications for multiple screens. Cross-platform software development at its best.") set_license("LGPL-3") + add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) + add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + + add_versions("5.15.2", "dummy") + add_versions("5.12.5", "dummy") + on_load(function (package) - package:add("deps", "qt5base", "qt5core", {debug = package:is_debug()}) + package:add("deps", "qt5base", "qt5core", {debug = package:is_debug(), version = package:version_str()}) end) on_fetch(function (package) @@ -16,6 +22,7 @@ package("qt5gui") end return { + version = qt.version, includedirs = {qt.includedir, path.join(qt.includedir, "QtGui")}, links = table.wrap("Qt5Gui" .. (package:is_plat("windows") and package:is_debug() and "d" or "")), linkdirs = table.wrap(qt.libdir), diff --git a/xmake-repo/packages/q/qt5widgets/xmake.lua b/xmake-repo/packages/q/qt5widgets/xmake.lua index 247013719..5692df2db 100644 --- a/xmake-repo/packages/q/qt5widgets/xmake.lua +++ b/xmake-repo/packages/q/qt5widgets/xmake.lua @@ -4,18 +4,27 @@ package("qt5widgets") set_description("Qt is the faster, smarter way to create innovative devices, modern UIs & applications for multiple screens. Cross-platform software development at its best.") set_license("LGPL-3") + add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) + add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + + add_versions("5.15.2", "dummy") + add_versions("5.12.5", "dummy") + on_load(function (package) - package:add("deps", "qt5base", "qt5core", "qt5gui", {debug = package:is_debug()}) + package:add("deps", "qt5base", "qt5core", "qt5gui", {debug = package:is_debug(), version = package:version_str()}) end) on_fetch(function (package) + print("on_fetch") local base = package:dep("qt5base") local qt = base:data("qtdir") if not qt then + print("nani") return end return { + version = qt.version, includedirs = {qt.includedir, path.join(qt.includedir, "QtWidgets")}, links = table.wrap("Qt5Widgets" .. (package:is_plat("windows") and package:is_debug() and "d" or "")), linkdirs = table.wrap(qt.libdir)