Try to fix qt through packages

This commit is contained in:
Jérôme Leclercq
2021-07-30 14:57:02 +02:00
parent 8c2fe8333a
commit 101c3f61c5
7 changed files with 77 additions and 92 deletions

View File

@@ -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")

View File

@@ -4,11 +4,16 @@ package("qt5core")
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")
add_deps("qt5base")
on_load(function (package)
package:add("deps", "qt5base", {debug = package:is_debug()})
end)
on_fetch(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
if not qt then
return
end
return {
qtdir = qt,
@@ -17,3 +22,13 @@ package("qt5core")
includedirs = table.wrap(qt.includedir)
}
end)
on_install(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
assert(qt, "qt5base is required")
end)
on_test(function (package)
end)

View File

@@ -4,11 +4,16 @@ package("qt5gui")
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")
add_deps("qt5base", "qt5core", "qt5core")
on_load(function (package)
package:add("deps", "qt5base", "qt5core", {debug = package:is_debug()})
end)
on_fetch(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
if not qt then
return
end
return {
links = table.wrap("Qt5Gui" .. (package:is_plat("windows") and package:is_debug() and "d" or "")),
@@ -16,3 +21,12 @@ package("qt5gui")
includedirs = table.wrap(qt.includedir)
}
end)
on_install(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
assert(qt, "qt5base is required")
end)
on_test(function (package)
end)

View File

@@ -4,11 +4,16 @@ package("qt5widgets")
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")
add_deps("qt5base", "qt5core", "qt5gui")
on_load(function (package)
package:add("deps", "qt5base", "qt5core", "qt5gui", {debug = package:is_debug()})
end)
on_fetch(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
if not qt then
return
end
return {
links = table.wrap("Qt5Widgets" .. (package:is_plat("windows") and package:is_debug() and "d" or "")),
@@ -16,3 +21,12 @@ package("qt5widgets")
includedirs = table.wrap(qt.includedir)
}
end)
on_install(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
assert(qt, "qt5base is required")
end)
on_test(function (package)
end)