xmake.lua 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package("aqt")
  2. set_kind("binary")
  3. set_homepage("https://github.com/miurahr/aqtinstall")
  4. set_description("aqt: Another (unofficial) Qt CLI Installer on multi-platforms")
  5. set_license("MIT")
  6. add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true})
  7. if is_host("windows") and (os.arch() == "x64" or os.arch() == "x86") then
  8. add_configs("runtimes", {description = "Set compiler runtimes.", default = "MD", readonly = true})
  9. if os.arch() == "x86" then
  10. add_urls("https://github.com/miurahr/aqtinstall/releases/download/v$(version)/aqt_x86.exe")
  11. add_versions("3.3.0", "372ed5c099f2e010284e9a69cca0731b7dbf29be41100588685c2cd1f917bc40")
  12. add_versions("3.1.21", "b79465e771a78a76a8967c4bc49ac93210e25d6ead58b929a57100b3c6da71df")
  13. add_versions("3.1.17", "d3abbd3378907f2e3ebf3af3387590245bb04175e1a720d04463b047732e1cd2")
  14. add_versions("3.1.6", "093b536fab2e3726a792cdb60292313c0c8950b8aa9b56ccdeff7adb1146f964")
  15. add_versions("3.0.2", "aac5d8949eed3f231bfc589736afe0f88372dc590182c8b3a2bed7c78952b944")
  16. add_versions("2.0.6", "b980985cfeb1cefef1d2ebab91ae4e648873a27fae8831deff8144661480c56a")
  17. else
  18. add_urls("https://github.com/miurahr/aqtinstall/releases/download/v$(version)/aqt_x64.exe")
  19. add_versions("3.3.0", "4f74d4c95c464d238d7e17ec2d9b7f22a7c333f0f5270a62584e2b47fc765150")
  20. add_versions("3.1.21", "da834e08268f3ffbb4c3e1c3e8a3ef8885d446e96e48dd35780a8d73e4a9e4ed")
  21. add_versions("3.1.17", "02acc10c6317a2a9f76464d5c26b129b836531f81938b2b222498c495d69fcdb")
  22. add_versions("3.1.6", "4f7e3fbc2d155f903ed9597b7929201681ffb7628e97765511cc7efa8a60f3e6")
  23. add_versions("3.0.2", "96e46eca0d18a899db00a26facd20c799f2400645aef6445d49f4bd0aeab0a3f")
  24. add_versions("2.0.6", "b0ad07fe8fd2c094425449f3053598959e467833dadf509da948571259510078")
  25. end
  26. elseif is_host("macosx") and (os.arch() == "arm64" or os.arch() == "x86_64") then
  27. add_urls("https://github.com/miurahr/aqtinstall/releases/download/v$(version)/aqt-macos")
  28. add_versions("3.3.0", "fcc241c15ef6b9880b1ecb1f162fc9eca439f0628ae962eb20ba45dc279abe1a")
  29. add_versions("3.1.21", "aa720dbf0928b0843d02b06273086d0e4974b742461783c343b6ddde5ec7e0be")
  30. add_versions("3.1.17", "cb51decbc12500d2e3e4b743dd4abb86a91fd9f25a916cafe54572963acf0690")
  31. else
  32. add_deps("7z")
  33. add_deps("python >=3.6", {kind="binary"})
  34. end
  35. on_install("@macosx", "@linux", "@windows", "@msys", function (package)
  36. if is_host("windows") and (os.arch() == "x64" or os.arch() == "x86") then
  37. os.cp(package:originfile(), path.join(package:installdir("bin"), "aqt.exe"))
  38. elseif is_host("macosx") and (os.arch() == "arm64" or os.arch() == "x86_64") then
  39. os.cp(package:originfile(), path.join(package:installdir("bin"), "aqt"))
  40. os.vrunv("chmod", {"+x", path.join(package:installdir("bin"), "aqt")})
  41. else
  42. -- ensurepip has been dropped in recent releases
  43. try {function () os.vrunv("python3", {"-m", "ensurepip"}) end}
  44. os.vrunv("python3", {"-m", "pip", "install", "-U", "pip"})
  45. os.vrunv("python3", {"-m", "pip", "install", "aqtinstall"})
  46. end
  47. end)
  48. on_test(function (package)
  49. os.vrun("aqt -h")
  50. end)