From 13bb4cc6eefc6209693497c3bf67ff51d13baa39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Wed, 23 Feb 2022 23:23:39 +0100 Subject: [PATCH] XMake: Move aqt to a separate package to fix MinGW installation --- xmake-repo/packages/a/aqt/xmake.lua | 37 +++++++++++++++++++++++++ xmake-repo/packages/q/qt5base/xmake.lua | 13 ++------- 2 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 xmake-repo/packages/a/aqt/xmake.lua diff --git a/xmake-repo/packages/a/aqt/xmake.lua b/xmake-repo/packages/a/aqt/xmake.lua new file mode 100644 index 000000000..968b4e1bb --- /dev/null +++ b/xmake-repo/packages/a/aqt/xmake.lua @@ -0,0 +1,37 @@ +package("aqt") + + set_kind("binary") + set_homepage("https://github.com/miurahr/aqtinstall") + set_description("aqt: Another (unofficial) Qt CLI Installer on multi-platforms") + set_license("MIT") + + if is_host("windows") then + 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") + else + add_urls("https://github.com/miurahr/aqtinstall/releases/download/v$(version)/aqt_x64.exe") + add_versions("2.0.6", "b0ad07fe8fd2c094425449f3053598959e467833dadf509da948571259510078") + end + else + add_deps("python >=3.6", "7z") + end + + on_install(function (package) + if is_host("windows") then + os.mv(package:originfile(), path.join(package:installdir("bin"), "aqt.exe")) + else + -- ensurepip has been dropped in recent releases + try + { + function () os.vrunv("python3", {"-m", "ensurepip"}) end + } + + os.vrunv("python3", {"-m", "pip", "install", "-U", "pip"}) + os.vrunv("python3", {"-m", "pip", "install", "aqtinstall"}) + end + end) + + on_test(function (package) + os.vrun("aqt -h") + end) diff --git a/xmake-repo/packages/q/qt5base/xmake.lua b/xmake-repo/packages/q/qt5base/xmake.lua index 630f2dc24..d375f4774 100644 --- a/xmake-repo/packages/q/qt5base/xmake.lua +++ b/xmake-repo/packages/q/qt5base/xmake.lua @@ -8,7 +8,7 @@ package("qt5base") add_versions("5.15.2", "dummy") add_versions("5.12.5", "dummy") - add_deps("python >=3.6", "7z", {private=true}) -- only required for installation + add_deps("aqt", {private=true}) -- only required for installation on_fetch(function (package, opt) local qt = package:data("qtdir") @@ -51,15 +51,6 @@ package("qt5base") end) on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function (package) - -- ensurepip has been dropped in recent releases - try - { - function () os.vrunv("python3", {"-m", "ensurepip"}) end - } - - os.vrunv("python3", {"-m", "pip", "install", "-U", "pip"}) - os.vrunv("python3", {"-m", "pip", "install", "aqtinstall"}) - local installdir = package:installdir() local version = package:version() or semver.new("5.15.2") @@ -149,7 +140,7 @@ package("qt5base") end end - os.vrunv("python3", {"-m", "aqt", "install-qt", "-O", installdir, host, target, version:shortstr(), arch}) + os.vrunv("aqt", {"install-qt", "-O", installdir, host, target, version:shortstr(), arch}) -- move files to root local subdirs = {}