Improve packages

This commit is contained in:
Jérôme Leclercq
2021-07-29 18:08:07 +02:00
parent 8397fd257b
commit 800028a21f
6 changed files with 106 additions and 7 deletions

View File

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

View File

@@ -4,7 +4,7 @@ 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", {public=true})
add_deps("qt5base")
on_fetch(function (package)
local base = package:dep("qt5base")

View File

@@ -9,7 +9,6 @@ package("qt5widgets")
on_fetch(function (package)
local base = package:dep("qt5base")
local qt = base:data("qtdir")
print(qt)
return {
links = table.wrap("Qt5Widgets" .. (package:is_debug() and "d" or "")),