Improve packages
This commit is contained in:
@@ -11,6 +11,8 @@ package("qt5base")
|
||||
local qt = find_qt()
|
||||
if qt then
|
||||
package:data_set("qtdir", qt)
|
||||
else]]
|
||||
package:add("deps", "python >=3.6", "7z")
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -25,11 +27,32 @@ package("qt5base")
|
||||
}
|
||||
end)
|
||||
|
||||
-- TODO: on_install using aqtinstall
|
||||
on_install(function (package)
|
||||
os.vrunv("python", {"-m", "pip", "install", "-U", "pip"})
|
||||
os.vrunv("python", {"-m", "pip", "install", "aqtinstall"})
|
||||
|
||||
local installdir = package:installdir()
|
||||
local version = "5.15.2"
|
||||
local host = package:is_plat("windows") and "windows" or "linux"
|
||||
local target = "desktop"
|
||||
local arch = package:is_plat("windows") and "win64_msvc2019_64" or nil
|
||||
|
||||
print("LD_LIBRARY_PATH", os.getenv("LD_LIBRARY_PATH"))
|
||||
os.vrunv("python", {"-m", "aqt", "install", "--outputdir", installdir, version, host, target, arch})
|
||||
|
||||
-- move files to root
|
||||
local installeddir = path.join(installdir, version, package:is_plat("windows") and "msvc2019_64" or "gcc_64", "*")
|
||||
os.mv(installeddir, installdir)
|
||||
package:data_set("qtdir", {
|
||||
bindir = path.join(installdir, "bin"),
|
||||
includedir = path.join(installdir, "include"),
|
||||
libdir = path.join(installdir, "lib")
|
||||
})
|
||||
end)
|
||||
|
||||
on_test(function (package)
|
||||
local qt = package:data("qtdir")
|
||||
os.vrun(path.join(qt.bindir, "moc", " -v"))
|
||||
os.vrun(path.join(qt.bindir, "rcc", " -v"))
|
||||
os.vrun(path.join(qt.bindir, "uic", " -v"))
|
||||
os.vrun(path.join(qt.bindir, "moc") .. " -v")
|
||||
os.vrun(path.join(qt.bindir, "rcc") .. " -v")
|
||||
os.vrun(path.join(qt.bindir, "uic") .. " -v")
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user