Try to fix qt through packages
This commit is contained in:
@@ -5,23 +5,39 @@ 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")
|
||||
|
||||
on_load(function (package)
|
||||
-- I think find_qt could be moved here
|
||||
add_deps("python >=3.6", "7z", {private=true}) -- only for installation
|
||||
|
||||
on_fetch(function (package, opt)
|
||||
local qt = package:data("qtdir")
|
||||
if qt then
|
||||
return {
|
||||
qtdir = qt
|
||||
}
|
||||
end
|
||||
|
||||
if os.isfile(package:manifest_file()) then
|
||||
local qt = package:installdir()
|
||||
package:data_set("qtdir", {
|
||||
bindir = path.join(qt, "bin"),
|
||||
includedir = path.join(qt, "include"),
|
||||
libdir = path.join(qt, "lib")
|
||||
})
|
||||
return {
|
||||
qtdir = qt
|
||||
}
|
||||
end
|
||||
|
||||
if not opt.system then
|
||||
return
|
||||
end
|
||||
|
||||
import("detect.sdks.find_qt")
|
||||
local qt = find_qt()
|
||||
if qt then
|
||||
package:data_set("qtdir", qt)
|
||||
else
|
||||
package:add("deps", "python >=3.6", "7z")
|
||||
end
|
||||
end)
|
||||
|
||||
on_fetch(function (package)
|
||||
local qt = package:data("qtdir")
|
||||
if not qt then
|
||||
return
|
||||
end
|
||||
|
||||
package:data_set("qtdir", qt)
|
||||
return {
|
||||
qtdir = qt,
|
||||
}
|
||||
@@ -52,7 +68,7 @@ package("qt5base")
|
||||
end)
|
||||
|
||||
on_test(function (package)
|
||||
local qt = package:data("qtdir")
|
||||
local qt = assert(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")
|
||||
|
||||
Reference in New Issue
Block a user