Răsfoiți Sursa

Add qt installer framework from aqt (#2342)

* add qt installer framework from aqt

* fix several issues

* Update xmake.lua

* add missing xcb library

* add msys platform

* fix #2

* change xcb package

* add missiong package 2

* fix 3rd

* fix 4th

* add missing library 5th

* fix 6th

* fix conflict package

* re-add shared 7th

* fix 8th

* fix package conflict 9th

* install qtifw only on macos and windows

* Update xmake.lua

* Update xmake.lua

---------

Co-authored-by: ruki <[email protected]>
Yiheng Wu 2 ani în urmă
părinte
comite
fed8abacbe
1 a modificat fișierele cu 44 adăugiri și 0 ștergeri
  1. 44 0
      packages/q/qtifw/xmake.lua

+ 44 - 0
packages/q/qtifw/xmake.lua

@@ -0,0 +1,44 @@
+package("qtifw")
+    set_kind("binary")
+    set_homepage("https://doc.qt.io/qtinstallerframework/")
+    set_description("The Qt Installer Framework provides a set of tools and utilities to create installers for the supported desktop Qt platforms: Linux, Microsoft Windows, and macOS.")
+    set_license("GPL-3")
+
+    add_versions("4.6.0", "dummy")
+
+    add_deps("aqt")
+
+    on_install("@windows", "@msys", "@macosx", function (package)
+
+        local host
+        if is_host("windows", "msys") then
+            host = "windows"
+        elseif is_host("linux") then
+            host = "linux"
+        elseif is_host("macosx") then
+            host = "mac"
+        else
+            raise("unhandled host " .. os.host())
+        end
+
+        local target = "desktop"
+        local version = package:version()
+        local installdir = package:installdir()
+        os.vrunv("aqt", {"install-tool", "-O", installdir, host, target, "tools_ifw", "qt.tools.ifw." .. version:major() .. version:minor()})
+        os.mv(path.join(installdir, "Tools", "*", version:major() .. "." .. version:minor(), "*"), installdir)
+        os.rmdir(path.join(installdir, "Tools"))
+    end)
+
+    on_test(function (package)
+        local function assertbin(name)
+            if is_host("windows") then
+                name = name .. ".exe"
+            end
+            local exec = path.join(package:installdir(), "bin", name)
+            assert(os.isexec(exec), name .. " not found!")
+        end
+        os.vrun("binarycreator --help")
+        os.vrun("archivegen --help")
+        os.vrun("devtool --help")
+        assertbin("repogen")
+    end)