From e2980c8f91327614f24abec6704a5831d8074a8a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 26 Feb 2018 18:18:43 -0800 Subject: [vcpkg] Add 7zip internal tool --- scripts/vcpkgTools.xml | 7 +++++++ toolsrc/include/vcpkg/vcpkgpaths.h | 2 ++ toolsrc/src/vcpkg/vcpkgpaths.cpp | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index e54d16864..02fd0b996 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -33,4 +33,11 @@ f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 QtInstallerFramework-win-x86.zip + + 18.01.0 + 7za920\7za.exe + http://www.7-zip.org/a/7za920.zip + 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac + 7za920.zip + diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 33a9b0067..84e8110ec 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -63,6 +63,7 @@ namespace vcpkg fs::path ports_cmake; + const fs::path& get_7za_exe() const; const fs::path& get_cmake_exe() const; const fs::path& get_git_exe() const; const fs::path& get_nuget_exe() const; @@ -80,6 +81,7 @@ namespace vcpkg private: Lazy> available_triplets; + Lazy _7za_exe; Lazy cmake_exe; Lazy git_exe; Lazy nuget_exe; diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index bf231cecd..f2b39c110 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -205,6 +205,20 @@ namespace vcpkg return fetch_tool(paths.scripts, "cmake", TOOL_DATA); } + static fs::path get_7za_path(const VcpkgPaths& paths) + { +#if defined(_WIN32) + static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "7zip"); + if (!paths.get_filesystem().exists(TOOL_DATA.downloaded_exe_path)) + { + return fetch_tool(paths.scripts, "7zip", TOOL_DATA); + } + return TOOL_DATA.downloaded_exe_path; +#else + Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot download 7zip for non-Windows platforms."); +#endif + } + static fs::path get_nuget_path(const VcpkgPaths& paths) { static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "nuget"); @@ -353,6 +367,11 @@ namespace vcpkg return it != this->get_available_triplets().cend(); } + const fs::path& VcpkgPaths::get_7za_exe() const + { + return this->_7za_exe.get_lazy([this]() { return get_7za_path(*this); }); + } + const fs::path& VcpkgPaths::get_cmake_exe() const { return this->cmake_exe.get_lazy([this]() { return get_cmake_path(*this); }); -- cgit v1.2.3