diff --git a/xmake-repo/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch b/xmake-repo/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch deleted file mode 100644 index a5e7db712..000000000 --- a/xmake-repo/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CPP/7zip/Common/OffsetStream.cpp b/CPP/7zip/Common/OffsetStream.cpp -index b3e710f..b16124c 100644 ---- a/CPP/7zip/Common/OffsetStream.cpp -+++ b/CPP/7zip/Common/OffsetStream.cpp -@@ -20,13 +20,13 @@ STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *proc - - STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) - { -- UInt64 absoluteNewPosition; - if (seekOrigin == STREAM_SEEK_SET) - { - if (offset < 0) - return HRESULT_WIN32_ERROR_NEGATIVE_SEEK; - offset += _offset; - } -+ UInt64 absoluteNewPosition = 0; // =0 for gcc-10 - HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition); - if (newPosition) - *newPosition = absoluteNewPosition - _offset; diff --git a/xmake-repo/packages/7/7z/xmake.lua b/xmake-repo/packages/7/7z/xmake.lua deleted file mode 100644 index afa0c38dc..000000000 --- a/xmake-repo/packages/7/7z/xmake.lua +++ /dev/null @@ -1,57 +0,0 @@ -package("7z") - - set_kind("binary") - set_homepage("https://www.7-zip.org/") - set_description("A file archiver with a high compression ratio.") - - if is_host("windows") then - if is_arch("x64", "x86_64") then - set_urls("https://github.com/xmake-mirror/7zip/releases/download/$(version)/7z$(version)-x64.zip", - "https://gitlab.com/xmake-mirror/7zip-releases/raw/master/7z$(version)-x64.zip") - add_versions("19.00", "fc21cf510d70a69bfa8e5b0449fe0a054fb76e2f8bd568364821f319c8b1d86d") - add_versions("18.05", "e6e2d21e2c482f1b1c5a6d21ed80800ce1273b902cf4b9afa68621545540ee2f") - else - set_urls("https://github.com/xmake-mirror/7zip/releases/download/$(version)/7z$(version)-x86.zip", - "https://gitlab.com/xmake-mirror/7zip-releases/raw/master/7z$(version)-x86.zip") - add_versions("19.00", "f84fab081a2d8a6b5868a2eaf01cd56017363fb24560259cea80567f8062334f") - add_versions("18.05", "544c37bebee30437aba405071484e0ac6310332b4bdabe4ca7420a800d4b4b5e") - end - else - set_urls("https://github.com/xmake-mirror/7zip/archive/refs/tags/$(version).tar.gz", - "https://github.com/xmake-mirror/7zip.git") - add_versions("21.02", "b2a4c5bec8207508b26f94507f62f5a79c57ae9ab77dbf393f3b2fc8eef2e382") - add_patches("21.02", path.join(os.scriptdir(), "patches", "21.02", "backport-21.03-fix-for-GCC-10.patch"), "f1d8fa0bbb25123b28e9b2842da07604238b77e51b918260a369f97c2f694c89") - end - - on_install("macosx", "linux", function (package) - -- Clang has some indentation warnings that fails compilation using -Werror, remove it - io.replace("CPP/7zip/7zip_gcc.mak", "CFLAGS_WARN_WALL = -Wall -Werror -Wextra", "CFLAGS_WARN_WALL = -Wall -Wextra", {plain = true}) - - os.cd("CPP/7zip/Bundles/Alone2") - os.vrun("make -j -f makefile.gcc") - - local bin = package:installdir("bin") - os.cp("_o/7zz", bin) - os.ln(bin .. "/7zz", bin .. "/7z") - end) - - on_install("windows", function (package) - os.cp("*", package:installdir("bin")) - - --[[ - Build code for windows - - local archdir = package:is_arch("x64", "x86_64") and "x64" or "x86" - os.cd("CPP/7zip/Bundles/Alone2") - local configs = {"-f", "makefile"} - table.insert(configs, "PLATFORM=" .. archdir) - import("package.tools.nmake").build(package, configs) - - local bin = package:installdir("bin") - os.cp(archdir .. "/7zz.exe", bin .. "/7z.exe") - ]] - end) - - on_test(function (package) - os.vrun("7z --help") - end) diff --git a/xmake-repo/packages/n/nodeeditor/xmake.lua b/xmake-repo/packages/n/nodeeditor/xmake.lua index 155456eb9..84e8775f4 100644 --- a/xmake-repo/packages/n/nodeeditor/xmake.lua +++ b/xmake-repo/packages/n/nodeeditor/xmake.lua @@ -9,9 +9,11 @@ package("nodeeditor") add_versions("2.1.3", "4e3194a04ac4a2a2bf4bc8eb6cc27d5cc154923143c1ecf579ce7f0115a90585") add_patches("2.1.3", path.join(os.scriptdir(), "patches", "2.1.3", "fix_qt.patch"), "3192c66fe711ad4bbfba96348601655396bc32465e2807f5be252cde6e2a3d59") - add_deps("cmake", "qt5core", "qt5gui", "qt5widgets") + add_deps("cmake") on_load(function (package) + package:add("deps", "qt5core", "qt5gui", "qt5widgets", {debug = package:is_debug()}) + if package:config("shared") then package:add("defines", "NODE_EDITOR_SHARED") else diff --git a/xmake-repo/packages/q/qt5base/xmake.lua b/xmake-repo/packages/q/qt5base/xmake.lua index f75c3e30f..7a6ce6e00 100644 --- a/xmake-repo/packages/q/qt5base/xmake.lua +++ b/xmake-repo/packages/q/qt5base/xmake.lua @@ -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") diff --git a/xmake-repo/packages/q/qt5core/xmake.lua b/xmake-repo/packages/q/qt5core/xmake.lua index df975f05e..5922758f3 100644 --- a/xmake-repo/packages/q/qt5core/xmake.lua +++ b/xmake-repo/packages/q/qt5core/xmake.lua @@ -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) diff --git a/xmake-repo/packages/q/qt5gui/xmake.lua b/xmake-repo/packages/q/qt5gui/xmake.lua index 1166f597a..b1051dc73 100644 --- a/xmake-repo/packages/q/qt5gui/xmake.lua +++ b/xmake-repo/packages/q/qt5gui/xmake.lua @@ -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) diff --git a/xmake-repo/packages/q/qt5widgets/xmake.lua b/xmake-repo/packages/q/qt5widgets/xmake.lua index d99f7ae0f..95b1f46a4 100644 --- a/xmake-repo/packages/q/qt5widgets/xmake.lua +++ b/xmake-repo/packages/q/qt5widgets/xmake.lua @@ -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)