aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-02-26 18:18:43 -0800
committerRobert Schumacher <roschuma@microsoft.com>2018-02-26 18:18:43 -0800
commite2980c8f91327614f24abec6704a5831d8074a8a (patch)
treedbfee9c09fb1f64a1216dd46615c1fddad210cd8
parentebdb41039450383ec7f41bd5f589cc46b7fd6a59 (diff)
downloadvcpkg-e2980c8f91327614f24abec6704a5831d8074a8a.tar.gz
vcpkg-e2980c8f91327614f24abec6704a5831d8074a8a.zip
[vcpkg] Add 7zip internal tool
-rw-r--r--scripts/vcpkgTools.xml7
-rw-r--r--toolsrc/include/vcpkg/vcpkgpaths.h2
-rw-r--r--toolsrc/src/vcpkg/vcpkgpaths.cpp19
3 files changed, 28 insertions, 0 deletions
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 @@
<sha256>f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8</sha256>
<archiveRelativePath>QtInstallerFramework-win-x86.zip</archiveRelativePath>
</tool>
+ <tool name="7zip">
+ <requiredVersion>18.01.0</requiredVersion>
+ <exeRelativePath>7za920\7za.exe</exeRelativePath>
+ <url>http://www.7-zip.org/a/7za920.zip</url>
+ <sha256>2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac</sha256>
+ <archiveRelativePath>7za920.zip</archiveRelativePath>
+ </tool>
</tools>
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<std::vector<std::string>> available_triplets;
+ Lazy<fs::path> _7za_exe;
Lazy<fs::path> cmake_exe;
Lazy<fs::path> git_exe;
Lazy<fs::path> 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); });