diff options
| author | ruki <[email protected]> | 2021-07-30 22:31:46 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-07-30 22:31:46 +0800 |
| commit | 37acf62ce546f31d2eab0350bf1fb649e2ea5bb1 (patch) | |
| tree | 500eacdd00e386d06c2e8846396ad005efad7a62 | |
| parent | 9776c89aec960c73bc1fd7c47ef61a54de2ba4ef (diff) | |
update git and 7z packages
| -rw-r--r-- | xmake/repository/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch | 19 | ||||
| -rw-r--r-- | xmake/repository/packages/7/7z/xmake.lua | 39 | ||||
| -rw-r--r-- | xmake/repository/packages/g/git/xmake.lua | 2 |
3 files changed, 46 insertions, 14 deletions
diff --git a/xmake/repository/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch b/xmake/repository/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch new file mode 100644 index 000000000..a5e7db712 --- /dev/null +++ b/xmake/repository/packages/7/7z/patches/21.02/backport-21.03-fix-for-GCC-10.patch @@ -0,0 +1,19 @@ +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/repository/packages/7/7z/xmake.lua b/xmake/repository/packages/7/7z/xmake.lua index 313f5e434..afa0c38dc 100644 --- a/xmake/repository/packages/7/7z/xmake.lua +++ b/xmake/repository/packages/7/7z/xmake.lua @@ -5,7 +5,7 @@ package("7z") set_description("A file archiver with a high compression ratio.") if is_host("windows") then - if os.arch() == "x64" 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") @@ -17,24 +17,39 @@ package("7z") add_versions("18.05", "544c37bebee30437aba405071484e0ac6310332b4bdabe4ca7420a800d4b4b5e") end else - add_urls("https://github.com/xmake-mirror/p7zip/archive/$(version).zip", {alias = "github"}) - add_urls("https://gitlab.com/xmake-mirror/p7zip/-/archive/$(version)/p7zip-$(version).zip", {alias = "gitlab"}) - add_urls("https://gitee.com/xmake-mirror/p7zip.git", - "https://github.com/xmake-mirror/p7zip.git", - "https://gitlab.com/xmake-mirror/p7zip.git") - add_versions("github:16.02", "1cb98f266f8f6109d99d35473dfc8db71a9933b1dea58a89833650858e504b52") - add_versions("gitlab:16.02", "93c6a14efb6dc9ee2fbb8c8fd4b5f319537c98182f8810f3b25cfa6363d9905b") + 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 - set_plat(os.host()) - set_arch(os.arch()) on_install("macosx", "linux", function (package) - os.vrun("make 7z") - os.cp("bin", package:installdir()) + -- 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) diff --git a/xmake/repository/packages/g/git/xmake.lua b/xmake/repository/packages/g/git/xmake.lua index df9fb6668..c90cdf241 100644 --- a/xmake/repository/packages/g/git/xmake.lua +++ b/xmake/repository/packages/g/git/xmake.lua @@ -23,8 +23,6 @@ package("git") end end end - set_plat(os.host()) - set_arch(os.arch()) on_load("windows", function (package) package:addenv("PATH", path.join("share", "MinGit", "mingw32", "bin")) |
