Skip to content

Commit

Permalink
use vcpkg.exe z-extract
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Matos authored and Javier Matos committed Dec 9, 2024
1 parent 96b5ced commit 1e8a794
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
10 changes: 2 additions & 8 deletions scripts/cmake/vcpkg_extract_archive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@ function(vcpkg_extract_archive)
/qn "TARGETDIR=${destination_native_path}"
WORKING_DIRECTORY "${archive_directory}"
)
elseif("${archive_extension}" MATCHES [[\.7z\.exe$]])
vcpkg_find_acquire_program(7Z)
elseif("${archive_extension}" MATCHES [[\.exe$]])
vcpkg_execute_in_download_mode(
COMMAND ${7Z} x
"${arg_ARCHIVE}"
"-o${arg_DESTINATION}"
-y -bso0 -bsp0
WORKING_DIRECTORY "${arg_DESTINATION}"
)
COMMAND "$ENV{VCPKG_COMMAND}" z-extract "${arg_ARCHIVE}" "${arg_DESTINATION}")
else()
vcpkg_execute_in_download_mode(
COMMAND "${CMAKE_COMMAND}" -E tar xzf "${arg_ARCHIVE}"
Expand Down
11 changes: 6 additions & 5 deletions scripts/cmake/vcpkg_find_acquire_program(7Z).cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set(program_name 7z)
if(CMAKE_HOST_WIN32)
set(paths_to_search "${DOWNLOADS}/tools/7zip_msi-${tool_subdirectory}-windows/Files/7-Zip") # vcpkg fetch 7zip_msi path
list(APPEND paths_to_search "${DOWNLOADS}/tools/7z/${tool_subdirectory}/Files/7-Zip")
set(download_urls "https://github.com/ip7z/7zip/releases/download/24.09/7z2409.msi" "https://7-zip.org/a/7z2409.msi")
set(download_filename "7z2409.msi")
set(download_sha512 33448CC4EDB2550F1FE6C4BAC27C6F8D3E0D1985F7C6ABCF34AC83DFF650FB90B926F65A4553DA4E92868F507DE4DFAD87E5A38B3ED8C68668B983105BB39224)
set(tool_subdirectory "24.08")
set(paths_to_search "${DOWNLOADS}/tools/7z/${tool_subdirectory}/7z2408/SourceDir/Files/7-Zip")
set(download_urls "https://github.com/ip7z/7zip/releases/download/24.08/7z2408.exe")
set(download_filename "7z2408.7z.exe")
set(search_names "7z.exe")
set(download_sha512 7f6c46c780fcb5fc10cc5405221179ddecbbb871c578ca3d9e3a74141271b383bd83e8f9d75c98d7e9d406e9b935d52a6b04913d654169e0b30f0719225e7dd9)
endif()
4 changes: 2 additions & 2 deletions scripts/cmake/vcpkg_find_acquire_program(CLANG).cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if(CMAKE_HOST_WIN32)

if(host_arch MATCHES "64")
set(download_urls "https://github.com/llvm/llvm-project/releases/download/llvmorg-${program_version}/LLVM-${program_version}-win64.exe")
set(download_filename "LLVM-${program_version}-win64.7z.exe")
set(download_filename "LLVM-${program_version}-win64.exe")
set(download_sha512 2dd6f3eea106f2b905e6658ea5ea12856d17285adbfba055edc2d6b6389c4c2f7aa001df5cb0d8fb84fa7fa47d5035a7fddf276523b472dd55f150ae25938768)
else()
set(download_urls "https://github.com/llvm/llvm-project/releases/download/llvmorg-${program_version}/LLVM-${program_version}-win32.exe")
set(download_filename "LLVM-${program_version}-win32.7z.exe")
set(download_filename "LLVM-${program_version}-win32.exe")
set(download_sha512 90225D650EADB0E590A9912B479B46A575D41A19EB5F2DA03C4DC8B032DC0790222F0E3706DFE2A35C0E7747941972AC26CB47D3EB13730DB76168931F37E5F1)
endif()
endif()
Expand Down
10 changes: 5 additions & 5 deletions scripts/vcpkgTools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@
<archiveName>7z2409-x64.msi</archiveName>
</tool>
<tool name="7zip" os="windows">
<version>24.09</version>
<exeRelativePath>7za.exe</exeRelativePath>
<url>https://github.com/ip7z/7zip/releases/download/24.09/7z2409-extra.7z</url>
<sha512>d17ef51ebe5e61761fa449c0d6106950e7e8dd9ef9bb9f129aed048f3d8d81662ba82a71e8264fff7c0f6764f410f2e8a4430d27e4ce915cf339e8d639905b3b</sha512>
<archiveName>7z2409-extra.7z</archiveName>
<version>24.08</version>
<exeRelativePath>7z.exe</exeRelativePath>
<url>https://github.com/ip7z/7zip/releases/download/24.08/7z2408.exe</url>
<sha512>7f6c46c780fcb5fc10cc5405221179ddecbbb871c578ca3d9e3a74141271b383bd83e8f9d75c98d7e9d406e9b935d52a6b04913d654169e0b30f0719225e7dd9</sha512>
<archiveName>7z2408.7z.exe</archiveName>
</tool>
<tool name="7zr" os="windows">
<version>24.09</version>
Expand Down

0 comments on commit 1e8a794

Please sign in to comment.