From 7142a093448baad2869e1ac99e619f02d3a395c1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 05:56:02 -0700 Subject: [vcpkg] Improve non-Windows default triplet detection --- scripts/buildsystems/vcpkg.cmake | 8 +++++--- scripts/toolchains/freebsd.cmake | 4 ++++ scripts/toolchains/linux.cmake | 2 -- scripts/toolchains/osx.cmake | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 scripts/toolchains/freebsd.cmake (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 1d1977e6a..196ddcb3c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,12 +57,14 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")) set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) set(_VCPKG_TARGET_TRIPLET_PLAT osx) -else() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")) set(_VCPKG_TARGET_TRIPLET_PLAT windows) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")) + set(_VCPKG_TARGET_TRIPLET_PLAT freebsd) endif() set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") diff --git a/scripts/toolchains/freebsd.cmake b/scripts/toolchains/freebsd.cmake new file mode 100644 index 000000000..bfeabe18b --- /dev/null +++ b/scripts/toolchains/freebsd.cmake @@ -0,0 +1,4 @@ +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") + set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") +endif() +set(CMAKE_SYSTEM_NAME FreeBSD CACHE STRING "") diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index d09d374c8..ea4f15d60 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.5) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") endif() diff --git a/scripts/toolchains/osx.cmake b/scripts/toolchains/osx.cmake index 1a164f178..dd21f5264 100644 --- a/scripts/toolchains/osx.cmake +++ b/scripts/toolchains/osx.cmake @@ -1 +1,4 @@ +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") +endif() set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "") -- cgit v1.2.3 From 94360c2c65c6b38844ee75890d2be4632cdb4514 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 11:35:19 -0700 Subject: [vcpkg-find-acquire-program] Handle PERL and NASM on non-windows --- scripts/cmake/vcpkg_find_acquire_program.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 21d7ecd8f..083b86fc2 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -49,12 +49,16 @@ function(vcpkg_find_acquire_program VAR) if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) + set(BREW_PACKAGE_NAME "perl") + set(APT_PACKAGE_NAME "perl") set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip") set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip") set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) + set(BREW_PACKAGE_NAME "nasm") + set(APT_PACKAGE_NAME "nasm") set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip" "http://mirrors.kodi.tv/build-deps/win32/nasm-2.12.02-win32.zip" -- cgit v1.2.3 From c5f93055a09629247236d1d7dca2c4aa9c1de7c9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 05:08:35 -0700 Subject: [vcpkg-cmake-toolchain] Only wrap find_package(Boost) if a boost library is installed. --- scripts/buildsystems/vcpkg.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 196ddcb3c..10e3c3f13 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -190,23 +190,13 @@ macro(find_package name) if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake") set(ARGS "${ARGV}") include(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake) - elseif("${name}" STREQUAL "Boost") - set(_Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS}) - set(_Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED}) - set(_Boost_USE_STATIC_RUNTIME ${Boost_USE_STATIC_RUNTIME}) - set(_Boost_COMPILER ${Boost_COMPILER}) + elseif("${name}" STREQUAL "Boost" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/boost") + # Checking for the boost headers disables this wrapper unless the user has installed at least one boost library unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - if(NOT Boost_FOUND) - set(Boost_USE_STATIC_LIBS ${_Boost_USE_STATIC_LIBS}) - set(Boost_USE_MULTITHREADED ${_Boost_USE_MULTITHREADED}) - set(Boost_USE_STATIC_RUNTIME ${_Boost_USE_STATIC_RUNTIME}) - set(Boost_COMPILER ${_Boost_COMPILER}) - _find_package(${ARGV}) - endif() elseif("${name}" STREQUAL "ICU") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) -- cgit v1.2.3 From 49a719b78a4c7feccc2aca970ec7fb242e1c121b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 19 Mar 2018 10:30:33 -0700 Subject: [libmysql] Use system dependencies to avoid ODR violations --- scripts/cmake/vcpkg_build_cmake.cmake | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index bdf192792..630662588 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -15,6 +15,9 @@ ## The target passed to the cmake build command (`cmake --build . --target `). If not specified, no target will ## be passed. ## +## ### ADD_BIN_TO_PATH +## Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. +## ## ## Notes: ## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). ## You can use the alias [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the @@ -27,7 +30,7 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_build_cmake) - cmake_parse_arguments(_bc "DISABLE_PARALLEL" "TARGET;LOGFILE_ROOT" "" ${ARGN}) + cmake_parse_arguments(_bc "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "TARGET;LOGFILE_ROOT" "" ${ARGN}) if(NOT _bc_LOGFILE_ROOT) set(_bc_LOGFILE_ROOT "build") @@ -65,20 +68,24 @@ function(vcpkg_build_cmake) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) if(BUILDTYPE STREQUAL "debug") set(SHORT_BUILDTYPE "dbg") + set(CONFIG "Debug") else() set(SHORT_BUILDTYPE "rel") + set(CONFIG "Release") endif() message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") set(LOGS) - if(BUILDTYPE STREQUAL "release") - set(CONFIG "Release") - else() - set(CONFIG "Debug") + if(_bc_ADD_BIN_TO_PATH) + set(_BACKUP_ENV_PATH "$ENV{PATH}") + if(BUILDTYPE STREQUAL "debug") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin;$ENV{PATH}") + else() + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin;$ENV{PATH}") + endif() endif() - execute_process( COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} OUTPUT_FILE "${LOGPREFIX}-out.log" @@ -134,6 +141,9 @@ function(vcpkg_build_cmake) endif() endif() message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} done") + if(_bc_ADD_BIN_TO_PATH) + set(ENV{PATH} "${_BACKUP_ENV_PATH}") + endif() endif() endforeach() endfunction() -- cgit v1.2.3 From fdf8d471ed553fa802db784e1b049cd77e721ce2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 20 Mar 2018 12:39:43 -0700 Subject: [TLS 1.2] Add message for Powershell 5.1+ --- scripts/VcpkgPowershellUtils.ps1 | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 73a3fc9ad..82718ecdc 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -140,6 +140,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, { Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" Write-Warning "Please manually download $url to $downloadPath" + Write-Warning "To solve this issue for future downloads, you can also install PowerShell 5.1+" throw "Download failed" } } -- cgit v1.2.3 From 9e54b3792daca1898a1b751d37fa22360721eba5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 20 Mar 2018 21:45:01 -0700 Subject: [mpg123] Disable LTCG for static libs to avoid ABI incompatibility --- scripts/cmake/vcpkg_build_msbuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index b8403d277..6da8a7369 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -87,6 +87,12 @@ function(vcpkg_build_msbuild) /m ) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions + # TODO: Add a way for the user to override this if they want to opt-in to incompatibility + list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -- cgit v1.2.3 From d5e433f03bf5220ef075489c18f5d1522fda1a4d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 17 Feb 2018 04:46:38 -0800 Subject: [vcpkg-build-msbuild] Add option to use vcpkg's integration. Fixes #891. Fixes #828. --- scripts/cmake/vcpkg_build_msbuild.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 6da8a7369..db04530ef 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -19,6 +19,11 @@ ## ``` ## ## ## Parameters +## ### USE_VCPKG_INTEGRATION +## Apply the normal `integrate install` integration for building the project. +## +## By default, projects built with this command will not automatically link libraries or have header paths set. +## ## ### PROJECT_PATH ## The path to the solution (`.sln`) or project (`.vcxproj`) file. ## @@ -56,7 +61,13 @@ ## * [cppunit](https://github.com/Microsoft/vcpkg/blob/master/ports/cppunit/portfile.cmake) function(vcpkg_build_msbuild) - cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) + cmake_parse_arguments( + _csc + "USE_VCPKG_INTEGRATION" + "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" + "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" + ${ARGN} + ) if(NOT DEFINED _csc_RELEASE_CONFIGURATION) set(_csc_RELEASE_CONFIGURATION Release) @@ -93,6 +104,10 @@ function(vcpkg_build_msbuild) list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false) endif() + if(_csc_USE_VCPKG_INTEGRATION) + list(APPEND _csc_OPTIONS /p:ForceImportBeforeCppTargets=${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/vcpkg.targets) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -- cgit v1.2.3 From 38c9c97b6b2106304a9602ddf580b17e7bf56311 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 21 Mar 2018 11:34:24 -0700 Subject: [double-conversion] Fix on non-windows --- scripts/cmake/vcpkg_configure_cmake.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 951b6443f..5fa42cb11 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -180,6 +180,8 @@ function(vcpkg_configure_cmake) "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_BINDIR=bin" ) if(DEFINED ARCH) -- cgit v1.2.3 From c3fb0b169751ec0f25ac3752a7e83e21173073a4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 22 Mar 2018 03:08:25 -0700 Subject: [vcpkg] Download cmake on osx and linux --- scripts/fetchTool.ps1 | 8 ++++---- scripts/vcpkgTools.xml | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 2c2f599ef..86174ee19 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -35,14 +35,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" if ($isArchive) { - $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + $downloadPath = "$downloadsDir\$(@($toolData.archiveRelativePath)[0])" } else { - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + $downloadPath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" } - $url = $toolData.url + [String]$url = @($toolData.url)[0] if (!(Test-Path $downloadPath)) { Write-Host "Downloading $tool..." @@ -50,7 +50,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) Write-Host "Downloading $tool has completed successfully." } - $expectedDownloadedFileHash = $toolData.sha256 + $expectedDownloadedFileHash = @($toolData.sha256)[0] $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 02fd0b996..9c78e92d9 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -6,6 +6,12 @@ https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 cmake-3.10.2-win32-x86.zip + cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz + cmake-3.10.2-Darwin-x86_64.tar.gz + cmake-3.10.2-Linux-x86_64/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz + cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 -- cgit v1.2.3 From 637c9bc0f012e402f5cff5e5f9ac1ca993f89ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 22 Mar 2018 22:28:17 +0100 Subject: [vcpkg] Fix setting exePath in fetchTool (#3114) --- scripts/fetchTool.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 86174ee19..ff9b5d9bf 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $exePath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" if (Test-Path $exePath) { -- cgit v1.2.3 From bc4fd2653bba4b22b2a9b94a5f22ee0e253413b5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Mar 2018 16:46:52 -0700 Subject: Improve warning message about Powershell 5.1 --- scripts/VcpkgPowershellUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 82718ecdc..d9c9e3760 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -140,7 +140,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, { Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" Write-Warning "Please manually download $url to $downloadPath" - Write-Warning "To solve this issue for future downloads, you can also install PowerShell 5.1+" + Write-Warning "To solve this issue for future downloads, you can also install Windows Management Framework 5.1+" throw "Download failed" } } -- cgit v1.2.3 From 6c690a22837bff0804e7ea4c9b2934cf97cd2211 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 23 Mar 2018 16:23:37 -0700 Subject: [vcpkg-configure-cmake] Set CMAKE_INSTALL_LIBDIR as type string to avoid CMake forming an absolute path --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 5fa42cb11..4ab02f710 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -180,8 +180,8 @@ function(vcpkg_configure_cmake) "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + "-DCMAKE_INSTALL_BINDIR:STRING=bin" ) if(DEFINED ARCH) -- cgit v1.2.3 From e8d1666d9c88ff1ccce3b388ea09f500735f17b7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 24 Mar 2018 13:08:06 -0700 Subject: [aws-sdk-cpp] Update and fix cmake files --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 7f1f827c2..475047737 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -81,7 +81,7 @@ function(vcpkg_fixup_cmake_targets) endif() endif() - file(GLOB UNUSED_FILES + file(GLOB_RECURSE UNUSED_FILES "${DEBUG_SHARE}/*[Tt]argets.cmake" "${DEBUG_SHARE}/*[Cc]onfig.cmake" "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake" @@ -91,10 +91,10 @@ function(vcpkg_fixup_cmake_targets) file(REMOVE ${UNUSED_FILES}) endif() - file(GLOB RELEASE_TARGETS + file(GLOB_RECURSE RELEASE_TARGETS "${RELEASE_SHARE}/*-release.cmake" ) - foreach(RELEASE_TARGET ${RELEASE_TARGETS}) + foreach(RELEASE_TARGET IN LISTS RELEASE_TARGETS) file(READ ${RELEASE_TARGET} _contents) string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") @@ -102,25 +102,25 @@ function(vcpkg_fixup_cmake_targets) endforeach() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB DEBUG_TARGETS + file(GLOB_RECURSE DEBUG_TARGETS "${DEBUG_SHARE}/*-debug.cmake" ) - foreach(DEBUG_TARGET ${DEBUG_TARGETS}) - get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) + foreach(DEBUG_TARGET IN LISTS DEBUG_TARGETS) + file(RELATIVE_PATH DEBUG_TARGET_REL "${DEBUG_SHARE}" "${DEBUG_TARGET}") file(READ ${DEBUG_TARGET} _contents) string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}/${DEBUG_TARGET_NAME} "${_contents}") + file(WRITE ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}") file(REMOVE ${DEBUG_TARGET}) endforeach() endif() - file(GLOB MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") - foreach(MAIN_TARGET ${MAIN_TARGETS}) + file(GLOB_RECURSE MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") + foreach(MAIN_TARGET IN LISTS MAIN_TARGETS) file(READ ${MAIN_TARGET} _contents) string(REGEX REPLACE "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" @@ -133,8 +133,8 @@ function(vcpkg_fixup_cmake_targets) file(WRITE ${MAIN_TARGET} "${_contents}") endforeach() - file(GLOB MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake") - foreach(MAIN_CONFIG ${MAIN_CONFIGS}) + file(GLOB_RECURSE MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake") + foreach(MAIN_CONFIG IN LISTS MAIN_CONFIGS) file(READ ${MAIN_CONFIG} _contents) string(REGEX REPLACE "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" -- cgit v1.2.3 From 72758773321476dcbb7b9d18f11bf57134bb4545 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 03:04:05 -0700 Subject: [ps1] Fixes/tweaks --- scripts/VcpkgPowershellUtils.ps1 | 13 ++++++------- scripts/fetchTool.ps1 | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d9c9e3760..bc84afa7f 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -110,9 +110,9 @@ function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath) function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath, [Parameter(Mandatory=$true)][string]$expectedHash, - [Parameter(Mandatory=$true)][string]$actualHash ) + [Parameter(Mandatory=$true)][string]$actualHash) { - if ($expectedDownloadedFileHash -ne $downloadedFileHash) + if ($expectedHash -ne $actualHash) { Write-Host ("`nFile does not have expected hash:`n" + " File path: [ $filePath ]`n" + @@ -150,7 +150,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, $downloadPartPath = "$downloadPath.part" vcpkgRemoveItem $downloadPartPath - $wc = New-Object System.Net.WebClient if (!$wc.Proxy.IsBypassed($url)) { @@ -161,7 +160,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, Move-Item -Path $downloadPartPath -Destination $downloadPath } -function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, +function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath, [Parameter(Mandatory=$true)][string]$destinationDir, [Parameter(Mandatory=$true)][string]$outFilename) { @@ -176,18 +175,18 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destinationPartial + Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial } elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') { Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $file -OutputPath $destinationPartial + Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial } else { Write-Verbose("Extracting via shell") $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $file).fullname) + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) foreach($item in $zip.items()) { # Piping to Out-Null is used to block until finished diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index ff9b5d9bf..a52986553 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -47,7 +47,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $tool has completed successfully." + Write-Host "Downloading $tool... done." } $expectedDownloadedFileHash = @($toolData.sha256)[0] -- cgit v1.2.3 From 72194ae8a0e435aee63b8e40f585646247672e3b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 04:08:57 -0700 Subject: [ps1] More fixes/tweaks --- scripts/VcpkgPowershellUtils.ps1 | 7 +++++-- scripts/fetchTool.ps1 | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index bc84afa7f..92e0f21d0 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -194,11 +194,14 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath, } } - $itemCount = @(Get-ChildItem "$destinationPartial").Count + $items = @(Get-ChildItem "$destinationPartial") + $itemCount = $items.Count if ($itemCount -eq 1) { - Move-Item -Path "$destinationPartial\*" -Destination $output + $item = $items | Select-Object -first 1 + Write-Host "$item" + Move-Item -Path "$destinationPartial\$item" -Destination $output vcpkgRemoveItem $destinationPartial } else diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index a52986553..af6d4d1d9 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -58,13 +58,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." - vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $tool has completed successfully." + vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool... done." } if (-not (Test-Path $exePath)) { - throw ("Could not detect or download " + $tool) + Write-Error "Could not detect or download $tool" + throw } return $exePath -- cgit v1.2.3 From cfd0d9c0e2e90227532f36343907f95908a1864d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 26 Mar 2018 17:21:46 -0700 Subject: [vcpkg-find-acquire-program] Update version of YASM --- scripts/cmake/vcpkg_find_acquire_program.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 083b86fc2..64d0c7599 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -40,6 +40,7 @@ function(vcpkg_find_acquire_program VAR) endif() unset(NOEXTRACT) + unset(_vfa_RENAME) unset(SUBDIR) unset(REQUIRED_INTERPRETER) @@ -67,11 +68,13 @@ function(vcpkg_find_acquire_program VAR) set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36) elseif(VAR MATCHES "YASM") set(PROGNAME yasm) - set(PATHS ${DOWNLOADS}/tools/yasm) - set(URL "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe") - set(ARCHIVE "yasm.exe") + set(SUBDIR 1.3.0.6) + set(PATHS ${DOWNLOADS}/tools/yasm/${SUBDIR}) + set(URL "https://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe") + set(ARCHIVE "yasm-1.3.0.6.g1962.exe") + set(_vfa_RENAME "yasm.exe") set(NOEXTRACT ON) - set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) + set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b) elseif(VAR MATCHES "PYTHON3") set(PROGNAME python) set(SUBDIR "python3") @@ -205,7 +208,11 @@ function(vcpkg_find_acquire_program VAR) file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) if(DEFINED NOEXTRACT) - file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + if(DEFINED _vfa_RENAME) + file(INSTALL ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} RENAME ${_vfa_RENAME}) + else() + file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + endif() else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) -- cgit v1.2.3 From 45d31162c25e168c46d9dd0f3f00e49edf625f21 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 17:48:33 -0700 Subject: [ps1] Remove extraneous function --- scripts/fetchTool.ps1 | 93 ++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 50 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index af6d4d1d9..8cf8002bc 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -13,64 +13,57 @@ $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" vcpkgCreateDirectoryIfNotExists $downloadsDir -function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) -{ - $tool = $tool.toLower() - - [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" - $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! +$tool = $tool.toLower() - if ($toolData -eq $null) - { - throw "Unkown tool $tool" - } +[xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" +$toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! - $exePath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" +if ($toolData -eq $null) +{ + throw "Unkown tool $tool" +} - if (Test-Path $exePath) - { - return $exePath - } +$exePath = "$downloadsDir\$($toolData.exeRelativePath)" - $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" - if ($isArchive) - { - $downloadPath = "$downloadsDir\$(@($toolData.archiveRelativePath)[0])" - } - else - { - $downloadPath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" - } +if (Test-Path $exePath) +{ + return $exePath +} - [String]$url = @($toolData.url)[0] - if (!(Test-Path $downloadPath)) - { - Write-Host "Downloading $tool..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $tool... done." - } +$isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" +if ($isArchive) +{ + $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" +} +else +{ + $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" +} - $expectedDownloadedFileHash = @($toolData.sha256)[0] - $downloadedFileHash = vcpkgGetSHA256 $downloadPath - vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash +[String]$url = $toolData.url +if (!(Test-Path $downloadPath)) +{ + Write-Host "Downloading $tool..." + vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $tool... done." +} - if ($isArchive) - { - $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $tool... done." - } +$expectedDownloadedFileHash = $toolData.sha256 +$downloadedFileHash = vcpkgGetSHA256 $downloadPath +vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if (-not (Test-Path $exePath)) - { - Write-Error "Could not detect or download $tool" - throw - } +if ($isArchive) +{ + $outFilename = (Get-ChildItem $downloadPath).BaseName + Write-Host "Extracting $tool..." + vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool... done." +} - return $exePath +if (-not (Test-Path $exePath)) +{ + Write-Error "Could not detect or download $tool" + throw } -$path = fetchToolInternal $tool -Write-Verbose "Fetching tool: $tool. Done." -return "::$path::" +return "::$exePath::" -- cgit v1.2.3 From c814c9b8ac883aa42930e1f48660145fd4234fe6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 13:23:30 -0700 Subject: [vcpkgTools.xml] Restructre os-specific info --- scripts/vcpkgTools.xml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 9c78e92d9..5df2de7ad 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -6,12 +6,20 @@ https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 cmake-3.10.2-win32-x86.zip - cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake - https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz - cmake-3.10.2-Darwin-x86_64.tar.gz - cmake-3.10.2-Linux-x86_64/bin/cmake - https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz - cmake-3.10.2-Linux-x86_64.tar.gz + + + 3.10.2 + cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz + e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718 + cmake-3.10.2-Darwin-x86_64.tar.gz + + + 3.10.2 + cmake-3.10.2-Linux-x86_64/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz + 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea + cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 -- cgit v1.2.3 From 12d862ab2b6e387b596e680d334daa212b77fb32 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 18:06:02 -0700 Subject: [ps1] Revert function removal --- scripts/fetchTool.ps1 | 93 +++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 43 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 8cf8002bc..26eedac3b 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -13,57 +13,64 @@ $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" vcpkgCreateDirectoryIfNotExists $downloadsDir -$tool = $tool.toLower() +function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) +{ + $tool = $tool.toLower() -[xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" -$toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! + [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" + $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! -if ($toolData -eq $null) -{ - throw "Unkown tool $tool" -} + if ($toolData -eq $null) + { + throw "Unkown tool $tool" + } -$exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $exePath = "$downloadsDir\$($toolData.exeRelativePath)" -if (Test-Path $exePath) -{ - return $exePath -} + if (Test-Path $exePath) + { + return $exePath + } -$isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" -if ($isArchive) -{ - $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" -} -else -{ - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" -} + $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" + if ($isArchive) + { + $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + } + else + { + $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + } -[String]$url = $toolData.url -if (!(Test-Path $downloadPath)) -{ - Write-Host "Downloading $tool..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $tool... done." -} + [String]$url = $toolData.url + if (!(Test-Path $downloadPath)) + { + Write-Host "Downloading $tool..." + vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $tool... done." + } -$expectedDownloadedFileHash = $toolData.sha256 -$downloadedFileHash = vcpkgGetSHA256 $downloadPath -vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash + $expectedDownloadedFileHash = $toolData.sha256 + $downloadedFileHash = vcpkgGetSHA256 $downloadPath + vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash -if ($isArchive) -{ - $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $tool... done." -} + if ($isArchive) + { + $outFilename = (Get-ChildItem $downloadPath).BaseName + Write-Host "Extracting $tool..." + vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool... done." + } -if (-not (Test-Path $exePath)) -{ - Write-Error "Could not detect or download $tool" - throw + if (-not (Test-Path $exePath)) + { + Write-Error "Could not detect or download $tool" + throw + } + + return $exePath } -return "::$exePath::" +$path = fetchToolInternal $tool +Write-Verbose "Fetching tool: $tool. Done." +return "::$path::" -- cgit v1.2.3 From 3e1104465eb4e40e3b4dce1a212d90a68928d442 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Mar 2018 18:35:27 -0700 Subject: Add ninja to vcpkgTools.xml --- scripts/vcpkgTools.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 5df2de7ad..477584c5a 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -54,4 +54,18 @@ 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac 7za920.zip + + 1.8.2 + ninja + https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip + d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 + ninja-linux.zip + + + 1.8.2 + ninja + https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip + 0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc + ninja-mac.zip + -- cgit v1.2.3 From f9d4692749ad68340a07453add49a8ef029fa155 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 29 Mar 2018 21:14:06 -0700 Subject: [vcpkg.cmake] Remove Windows SDK detection. Let cmake detect it --- scripts/buildsystems/vcpkg.cmake | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 10e3c3f13..0c32b22fb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -44,7 +44,7 @@ else() elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) elseif(_VCPKG_CL MATCHES "arm64/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm64) + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") @@ -110,16 +110,6 @@ list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) -if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") - include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) - # This is used as an implicit parameter for vcpkg_get_windows_sdk - set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR}) - vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION) - unset(VCPKG_ROOT_DIR) - set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION} CACHE STRING "Windows SDK version") - message(STATUS "Found Windows SDK ${WINDOWS_SDK_VERSION}") -endif() - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) set(CMAKE_SYSTEM_IGNORE_PATH "${_programfiles}/OpenSSL" -- cgit v1.2.3 From 800f8b0e1dca9cfdb90a9e74c01060bc0440d2a6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 30 Mar 2018 16:59:59 -0700 Subject: Specify ninja exe --- scripts/cmake/vcpkg_configure_cmake.cmake | 1 + scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 4ab02f710..3a3a88515 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -115,6 +115,7 @@ function(vcpkg_configure_cmake) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 64d0c7599..0352b1890 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -105,14 +105,18 @@ function(vcpkg_find_acquire_program VAR) set(HASH 830cd94ed6518fbe4604a0f5a3322671b4674b87d25a71349c745500d38e85c0fac4f6995242fc5521eb048e3966bb5ec2a96a06b041343ed8da9bba78124f34) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" "${DOWNLOADS}/tools/7z/Files/7-Zip") set(URL "http://7-zip.org/a/7z1604.msi") set(ARCHIVE "7z1604.msi") set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) set(SUBDIR "ninja-1.8.2") - set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) + if(CMAKE_HOST_WIN32) + set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + else() + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}") + endif() set(BREW_PACKAGE_NAME "ninja") set(APT_PACKAGE_NAME "ninja-build") set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip") -- cgit v1.2.3 From 892f7052f943570eb5d8da991ace01725323c695 Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Wed, 7 Mar 2018 17:57:16 +0800 Subject: [vcpkg] Add support of external downloader aria2 --- scripts/cmake/vcpkg_download_distfile.cmake | 47 +++++++++++++++++++++----- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 +++++ 2 files changed, 46 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 4b111f3f0..fc6199146 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -103,19 +103,48 @@ function(vcpkg_download_distfile VAR) endif() # Tries to download the file. - foreach(url IN LISTS vcpkg_download_distfile_URLS) - message(STATUS "Downloading ${url}...") - file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") + list(GET vcpkg_download_distfile_URLS 0 SAMPLE_URL) + if(${_VCPKG_DOWNLOAD_TOOL} MATCHES "ARIA2" AND NOT ${SAMPLE_URL} MATCHES "aria2") + vcpkg_find_acquire_program("ARIA2") + message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}...") + execute_process( + COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} + -o temp/${vcpkg_download_distfile_FILENAME} + -l download-${vcpkg_download_distfile_FILENAME}-detailed.log + OUTPUT_FILE download-${vcpkg_download_distfile_FILENAME}-out.log + ERROR_FILE download-${vcpkg_download_distfile_FILENAME}-err.log + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${DOWNLOADS} + ) + if (NOT "${error_code}" STREQUAL "0") + message(STATUS + "Downloading ${vcpkg_download_distfile_FILENAME}... Failed.\n" + " Exit Code: ${error_code}\n" + " See logs for more information:\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log\n" + ) set(download_success 0) else() - message(STATUS "Downloading ${url}... OK") + message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}... OK") set(download_success 1) - break() endif() - endforeach(url) + else() + foreach(url IN LISTS vcpkg_download_distfile_URLS) + message(STATUS "Downloading ${url}...") + file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") + set(download_success 0) + else() + message(STATUS "Downloading ${url}... OK") + set(download_success 1) + break() + endif() + endforeach(url) + endif() if (NOT download_success) message(FATAL_ERROR diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 0352b1890..ef0e1584f 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -25,6 +25,7 @@ ## - NASM ## - NINJA ## - YASM +## - ARIA2 (Downloader) ## ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). ## @@ -178,6 +179,13 @@ function(vcpkg_find_acquire_program VAR) set(URL "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.14.windows.bin.zip") set(ARCHIVE "doxygen-1.8.14.windows.bin.zip") set(HASH d0d706501e7112045b1f401f22d12a2c8d9b7728edee9ad1975a17dff914c16494ae48a70beab6f6304643779935843f268c7afed3b9da7d403b5cb11cac0c50) + # Download Tools + elseif(VAR MATCHES "ARIA2") + set(PROGNAME aria2c) + set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-1.33.1-win-32bit-build1) + set(URL "https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip") + set(ARCHIVE "aria2-1.33.1-win-32bit-build1.zip") + set(HASH 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 875410599151252b475234c162c3a9babb8be73f Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Thu, 15 Mar 2018 13:17:54 +0800 Subject: [vcpkg] Remove log files when downloading succeeds. --- scripts/cmake/vcpkg_download_distfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index fc6199146..9fc0a0c9a 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -128,6 +128,11 @@ function(vcpkg_download_distfile VAR) set(download_success 0) else() message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}... OK") + file(REMOVE + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log + ) set(download_success 1) endif() else() -- cgit v1.2.3 From 35f5a0de5327efdea1e9aea7979a2c828daacc0d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 5 Apr 2018 21:39:47 -0700 Subject: [vcpkg-cmake-toolchain] Remove some hardcoded find_package helpers and guard all remaining ones --- scripts/buildsystems/vcpkg.cmake | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 0c32b22fb..a9f8190f7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -187,7 +187,7 @@ macro(find_package name) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - elseif("${name}" STREQUAL "ICU") + elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) set(COMPONENTS_IDX ${COMPONENTS_IDX} PARENT_SCOPE) @@ -198,7 +198,7 @@ macro(find_package name) else() _find_package(${ARGV}) endif() - elseif("${name}" STREQUAL "TIFF") + elseif("${name}" STREQUAL "TIFF" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tiff.h") _find_package(${ARGV}) find_package(LibLZMA) if(TARGET TIFF::TIFF) @@ -207,24 +207,7 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() - elseif("${name}" STREQUAL "Freetype") - _find_package(${ARGV}) - find_package(ZLIB) - find_package(PNG) - find_package(BZip2) - if(TARGET Freetype::Freetype) - set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2 PNG::PNG ZLIB::ZLIB) - endif() - if(FREETYPE_LIBRARIES) - list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) - endif() - elseif("${name}" STREQUAL "tinyxml2") - _find_package(${ARGV}) - if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) - _add_library(tinyxml2 INTERFACE IMPORTED) - set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") - endif() - elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK") + elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/hdf5.h") # This is a hack to make VTK work. TODO: find another way to suppress the built-in find module. _find_package(${ARGV} CONFIG) # Fill in missing static/shared targets @@ -237,7 +220,7 @@ macro(find_package name) set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") endif() endforeach() - elseif("${name}" STREQUAL "GSL") + elseif("${name}" STREQUAL "GSL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/gsl") _find_package(${ARGV}) if(GSL_FOUND AND TARGET GSL::gsl) set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) @@ -249,7 +232,7 @@ macro(find_package name) set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" ) endif() endif() - elseif("${name}" STREQUAL "CURL") + elseif("${name}" STREQUAL "CURL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/curl") _find_package(${ARGV}) if(CURL_FOUND) if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") @@ -258,16 +241,6 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() endif() - elseif("${name}" STREQUAL "LibXml2") - _find_package(${ARGV}) - if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) - list(APPEND LIBXML2_LIBRARIES - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib - ws2_32) - endif() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 31377dee20dad9b95357934732996e2448f2eaf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Apr 2018 21:05:31 -0700 Subject: Use 7z for extracting. Extract tools in downloads/tools --- scripts/VcpkgPowershellUtils.ps1 | 58 +++++++--------------------------------- scripts/fetchTool.ps1 | 22 ++++++++++++--- scripts/vcpkgTools.xml | 20 +++++++++----- 3 files changed, 41 insertions(+), 59 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 92e0f21d0..988c6dbf0 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,8 +1,3 @@ -function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) -{ - return [bool](Get-Module -ListAvailable -Name $moduleName) -} - function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { if ($object -eq $null) @@ -160,54 +155,21 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, Move-Item -Path $downloadPartPath -Destination $downloadPath } -function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir, - [Parameter(Mandatory=$true)][string]$outFilename) +function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, + [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) { - vcpkgCreateDirectoryIfNotExists $destinationDir - $output = "$destinationDir\$outFilename" - vcpkgRemoveItem $output - $destinationPartial = "$destinationDir\partially-extracted" - + vcpkgRemoveItem $destinationDir + $destinationPartial = "$destinationDir.partial" vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial - - if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') - { - Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial - } - elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') - { - Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial - } - else - { - Write-Verbose("Extracting via shell") - $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) - foreach($item in $zip.items()) - { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destinationPartial).copyhere($item) | Out-Null - } - } - - $items = @(Get-ChildItem "$destinationPartial") - $itemCount = $items.Count - - if ($itemCount -eq 1) - { - $item = $items | Select-Object -first 1 - Write-Host "$item" - Move-Item -Path "$destinationPartial\$item" -Destination $output - vcpkgRemoveItem $destinationPartial - } - else + $ec = vcpkgInvokeCommand "$sevenZipExe" "x `"$archivePath`" -o`"$destinationPartial`" -y" + if ($ec -ne 0) { - Move-Item -Path "$destinationPartial" -Destination $output + Write-Host "Could not extract $archivePath" + throw } + Rename-Item -Path "$destinationPartial" -NewName $destinationDir } function vcpkgInvokeCommand() diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 26eedac3b..315983841 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $toolPath="$downloadsDir\tools\$tool-$($toolData.requiredVersion)-windows" + $exePath = "$toolPath\$($toolData.exeRelativePath)" if (Test-Path $exePath) { @@ -39,7 +40,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) } else { - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + $downloadPath = "$toolPath\$($toolData.exeRelativePath)" } [String]$url = $toolData.url @@ -56,9 +57,22 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { - $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + if ($tool -eq "7zip") + { + $sevenZipR = fetchToolInternal "7zr" + $ec = vcpkgInvokeCommand "$sevenZipR" "x `"$downloadPath`" -o`"$toolPath`" -y" + if ($ec -ne 0) + { + Write-Host "Could not extract $downloadPath" + throw + } + } + else + { + $sevenZipExe = fetchToolInternal "7zip" + vcpkgExtractFile -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath + } Write-Host "Extracting $tool... done." } diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 477584c5a..6ef1e4d35 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -23,20 +23,20 @@ 2.16.2 - MinGit-2.16.2-32-bit\cmd\git.exe + cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da MinGit-2.16.2-32-bit.zip 2.3.2 - vswhere-2.3.2\vswhere.exe + vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 4.4.0 - nuget-4.4.0\nuget.exe + nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 @@ -49,10 +49,16 @@ 18.01.0 - 7za920\7za.exe - http://www.7-zip.org/a/7za920.zip - 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac - 7za920.zip + 7za.exe + https://www.7-zip.org/a/7z1801-extra.7z + 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 + 7z1801-extra.7z + + + 18.01.0 + 7zr.exe + https://www.7-zip.org/a/7zr.exe + 2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b 1.8.2 -- cgit v1.2.3 From 54c68da907e4881d29e8017e085e6786e1c34ace Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Apr 2018 22:15:17 -0700 Subject: Use aria2 to do downloads (other than aria2 itself, 7za and 7zr) --- scripts/VcpkgPowershellUtils.ps1 | 26 ++++++++++++++++++++++++++ scripts/fetchTool.ps1 | 13 ++++++++++++- scripts/vcpkgTools.xml | 7 +++++++ 3 files changed, 45 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 988c6dbf0..7082ca747 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -155,6 +155,32 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, Move-Item -Path $downloadPartPath -Destination $downloadPath } +function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$aria2exe, + [Parameter(Mandatory=$true)][string]$url, + [Parameter(Mandatory=$true)][string]$downloadPath) +{ + if (Test-Path $downloadPath) + { + return + } + + vcpkgCreateParentDirectoryIfNotExists $downloadPath + $downloadPartPath = "$downloadPath.part" + vcpkgRemoveItem $downloadPartPath + + $parentDir = split-path -parent $downloadPath + $filename = split-path -leaf $downloadPath + + $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url" + if ($ec -ne 0) + { + Write-Host "Could not download $url" + throw + } + + Move-Item -Path $downloadPartPath -Destination $downloadPath +} + function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, [Parameter(Mandatory=$true)][string]$archivePath, [Parameter(Mandatory=$true)][string]$destinationDir) diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 315983841..05335c724 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -47,7 +47,18 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if (!(Test-Path $downloadPath)) { Write-Host "Downloading $tool..." - vcpkgDownloadFile $url $downloadPath + + # aria2 needs 7zip & 7zr to extract. So, we need to download those trough powershell + if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zr") + { + vcpkgDownloadFile $url $downloadPath + } + else + { + $aria2exe = fetchToolInternal "aria2" + vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath + } + Write-Host "Downloading $tool... done." } diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 6ef1e4d35..fe1cc12a9 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -60,6 +60,13 @@ https://www.7-zip.org/a/7zr.exe 2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b + + 18.01.0 + aria2-1.33.1-win-32bit-build1\aria2c.exe + https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip + 04bf07c0449c703db17fbcd586365aebba00201ca513ca4808b543f1f9208f1f + aria2-1.33.1-win-32bit-build1.zip + 1.8.2 ninja -- cgit v1.2.3 From e3099b458b5c11742c1b88c27847801090870f2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 19:26:14 -0700 Subject: Use 7zip920 instead of 7zr --- scripts/VcpkgPowershellUtils.ps1 | 19 +++++++++++++++++++ scripts/fetchTool.ps1 | 14 +++++++++----- scripts/vcpkgTools.xml | 11 ++++++----- 3 files changed, 34 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 7082ca747..d7967889e 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -198,6 +198,25 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, Rename-Item -Path "$destinationPartial" -NewName $destinationDir } +function vcpkgExtractZipFileWithShell( [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) +{ + vcpkgRemoveItem $destinationDir + $destinationPartial = "$destinationDir.partial" + vcpkgRemoveItem $destinationPartial + vcpkgCreateDirectoryIfNotExists $destinationPartial + + $shell = new-object -com shell.application + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + } + + Rename-Item -Path "$destinationPartial" -NewName $destinationDir +} + function vcpkgInvokeCommand() { param ( [Parameter(Mandatory=$true)][string]$executable, diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 05335c724..e46c7808d 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -48,8 +48,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." - # aria2 needs 7zip & 7zr to extract. So, we need to download those trough powershell - if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zr") + # aria2 needs 7zip & 7zip920 to extract. So, we need to download those trough powershell + if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zip920") { vcpkgDownloadFile $url $downloadPath } @@ -69,10 +69,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { Write-Host "Extracting $tool..." - if ($tool -eq "7zip") + if ($tool -eq "7zip920") { - $sevenZipR = fetchToolInternal "7zr" - $ec = vcpkgInvokeCommand "$sevenZipR" "x `"$downloadPath`" -o`"$toolPath`" -y" + vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath + } + elseif ($tool -eq "7zip") + { + $sevenZip920 = fetchToolInternal "7zip920" + $ec = vcpkgInvokeCommand "$sevenZip920" "x `"$downloadPath`" -o`"$toolPath`" -y" if ($ec -ne 0) { Write-Host "Could not extract $downloadPath" diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index fe1cc12a9..810818998 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -54,11 +54,12 @@ 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 7z1801-extra.7z - - 18.01.0 - 7zr.exe - https://www.7-zip.org/a/7zr.exe - 2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b + + 9.20.0 + 7za.exe + https://www.7-zip.org/a/7za920.zip + 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac + 7za920.zip 18.01.0 -- cgit v1.2.3 From 23c2b82535d24a8ef343ce2ca36e5a63d111dcd8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 19:28:10 -0700 Subject: [vcpkgTools.xml] Add os="windows" to relevant entries --- scripts/vcpkgTools.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 810818998..fbd6aabd6 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,6 +1,6 @@ - + 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip @@ -21,47 +21,47 @@ 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea cmake-3.10.2-Linux-x86_64.tar.gz - + 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da MinGit-2.16.2-32-bit.zip - + 2.3.2 vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 - + 4.4.0 nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 - + 3.1.81 QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 QtInstallerFramework-win-x86.zip - + 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 7z1801-extra.7z - + 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac 7za920.zip - + 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip -- cgit v1.2.3 From 863a8f3329356d260c02c0d6f855e81fd1e2cea9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 19:37:31 -0700 Subject: [vcpkgTools.xml] Rename archiveRelativePath to archiveName --- scripts/fetchTool.ps1 | 4 ++-- scripts/vcpkgTools.xml | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index e46c7808d..79ac82cb0 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -33,10 +33,10 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) return $exePath } - $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" + $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveName" if ($isArchive) { - $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + $downloadPath = "$downloadsDir\$($toolData.archiveName)" } else { diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index fbd6aabd6..839e476b0 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -5,28 +5,28 @@ cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 - cmake-3.10.2-win32-x86.zip + cmake-3.10.2-win32-x86.zip 3.10.2 cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718 - cmake-3.10.2-Darwin-x86_64.tar.gz + cmake-3.10.2-Darwin-x86_64.tar.gz 3.10.2 cmake-3.10.2-Linux-x86_64/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea - cmake-3.10.2-Linux-x86_64.tar.gz + cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da - MinGit-2.16.2-32-bit.zip + MinGit-2.16.2-32-bit.zip 2.3.2 @@ -45,41 +45,41 @@ QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 - QtInstallerFramework-win-x86.zip + QtInstallerFramework-win-x86.zip 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 - 7z1801-extra.7z + 7z1801-extra.7z 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac - 7za920.zip + 7za920.zip 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip 04bf07c0449c703db17fbcd586365aebba00201ca513ca4808b543f1f9208f1f - aria2-1.33.1-win-32bit-build1.zip + aria2-1.33.1-win-32bit-build1.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 - ninja-linux.zip + ninja-linux.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip 0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc - ninja-mac.zip + ninja-mac.zip -- cgit v1.2.3 From 2fa16cda18856ae7f6685c48c0aeefd15225af11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:07:45 -0700 Subject: [vcpkgTools.xml] Change sha256 to sha512 --- scripts/VcpkgPowershellUtils.ps1 | 8 ++++---- scripts/fetchTool.ps1 | 4 ++-- scripts/vcpkgTools.xml | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d7967889e..676ee5c03 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -79,22 +79,22 @@ function vcpkgGetCredentials() } } -function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath) +function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) { if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') { Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") - $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA256).Hash + $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512).Hash } elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash') { Write-Verbose("Hashing with Pscx\Get-Hash") - $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA256).HashString + $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA512).HashString } else { Write-Verbose("Hashing with .NET") - $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") + $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA512") $fileAsByteArray = [io.File]::ReadAllBytes($filePath) $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) $hash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 79ac82cb0..d5c8fe77e 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -62,8 +62,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) Write-Host "Downloading $tool... done." } - $expectedDownloadedFileHash = $toolData.sha256 - $downloadedFileHash = vcpkgGetSHA256 $downloadPath + $expectedDownloadedFileHash = $toolData.sha512 + $downloadedFileHash = vcpkgGetSHA512 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash if ($isArchive) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 839e476b0..c3114c2e5 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -4,82 +4,82 @@ 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip - f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 + 9c16861a2ac09c7011b84f38459ecfec2829a9f825b254acbbde46d98f12f8ca0d4db3a6764758cb671507ee7c0327576d87658b81d7ddf1e8280b37569eb16d cmake-3.10.2-win32-x86.zip 3.10.2 cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz - e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718 + cb7d76e11c892eb786da5804282c4141564390c3552e08c506c7abb93015eb5f619c55255459872b219399ce8114ac321fe92df7f82a7e42bbc874eec240571e cmake-3.10.2-Darwin-x86_64.tar.gz 3.10.2 cmake-3.10.2-Linux-x86_64/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz - 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea + 54389b5cb3f3cb9d182d35e0b1eaf7b301695899930da0d26e9df1dc25056213a077646d23ea609a93daa81d30687757d9cf0dc263339fa3d73dbeb1284bc1a9 cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip - 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da + 004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a MinGit-2.16.2-32-bit.zip 2.3.2 vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe - 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 + 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed 4.4.0 nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe - 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 + fb0903665d2a64ce1da3f40961eb19e46c152a631b2441750aa8b30b20acd2a5e78d7f1058e79e83e37959b3ce9a090a60f081895fdba9998715e3a64437c3e5 3.1.81 QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip - f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 + 1f3e593270d7c2a4e271fdb49c637a2de462351310ef66bba298d30f6ca23365ec6aecf2e57799a00c873267cd3f92060ecac03eb291d42903d0e0869cd17c73 QtInstallerFramework-win-x86.zip 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z - 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 + 9133fc551d76515e37fdd4dd8c1e28d464aea493548246b44565a42bba46715764f41f9cfa14d470d298c3a6e9829d200f8be5168cb67cf8f23d8042fca833bc 7z1801-extra.7z 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip - 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac + 84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3 7za920.zip 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip - 04bf07c0449c703db17fbcd586365aebba00201ca513ca4808b543f1f9208f1f + 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3 aria2-1.33.1-win-32bit-build1.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip - d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 + 38fcb68e745c1f15b4b50f20069ffe686b1ef5baf93b74958e132ea5d30d155cf6970d6dc1b095aafd421ebd8bcc63acf4f64e305c496266b5182f99b815cca5 ninja-linux.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip - 0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc + acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3 ninja-mac.zip -- cgit v1.2.3 From 408cd5ccb8d8260efd9a8f2ff956414587d42e28 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:33:45 -0700 Subject: [vcpkgTools.xml] requiredVersion -> version --- scripts/fetchTool.ps1 | 2 +- scripts/vcpkgTools.xml | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index d5c8fe77e..55d04ec98 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $toolPath="$downloadsDir\tools\$tool-$($toolData.requiredVersion)-windows" + $toolPath="$downloadsDir\tools\$tool-$($toolData.version)-windows" $exePath = "$toolPath\$($toolData.exeRelativePath)" if (Test-Path $exePath) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index c3114c2e5..07284333c 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,82 +1,82 @@ - 3.10.2 + 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip 9c16861a2ac09c7011b84f38459ecfec2829a9f825b254acbbde46d98f12f8ca0d4db3a6764758cb671507ee7c0327576d87658b81d7ddf1e8280b37569eb16d cmake-3.10.2-win32-x86.zip - 3.10.2 + 3.10.2 cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz cb7d76e11c892eb786da5804282c4141564390c3552e08c506c7abb93015eb5f619c55255459872b219399ce8114ac321fe92df7f82a7e42bbc874eec240571e cmake-3.10.2-Darwin-x86_64.tar.gz - 3.10.2 + 3.10.2 cmake-3.10.2-Linux-x86_64/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz 54389b5cb3f3cb9d182d35e0b1eaf7b301695899930da0d26e9df1dc25056213a077646d23ea609a93daa81d30687757d9cf0dc263339fa3d73dbeb1284bc1a9 cmake-3.10.2-Linux-x86_64.tar.gz - 2.16.2 + 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a MinGit-2.16.2-32-bit.zip - 2.3.2 + 2.3.2 vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed - 4.4.0 + 4.4.0 nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe fb0903665d2a64ce1da3f40961eb19e46c152a631b2441750aa8b30b20acd2a5e78d7f1058e79e83e37959b3ce9a090a60f081895fdba9998715e3a64437c3e5 - 3.1.81 + 3.1.81 QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip 1f3e593270d7c2a4e271fdb49c637a2de462351310ef66bba298d30f6ca23365ec6aecf2e57799a00c873267cd3f92060ecac03eb291d42903d0e0869cd17c73 QtInstallerFramework-win-x86.zip - 18.01.0 + 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z 9133fc551d76515e37fdd4dd8c1e28d464aea493548246b44565a42bba46715764f41f9cfa14d470d298c3a6e9829d200f8be5168cb67cf8f23d8042fca833bc 7z1801-extra.7z - 9.20.0 + 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip 84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3 7za920.zip - 18.01.0 + 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3 aria2-1.33.1-win-32bit-build1.zip - 1.8.2 + 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip 38fcb68e745c1f15b4b50f20069ffe686b1ef5baf93b74958e132ea5d30d155cf6970d6dc1b095aafd421ebd8bcc63acf4f64e305c496266b5182f99b815cca5 ninja-linux.zip - 1.8.2 + 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3 -- cgit v1.2.3 From ab9dd6e6eb85331631ba41f16b04c21e292c93d1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:56:55 -0700 Subject: [find_acquire] Extract variable --- scripts/cmake/vcpkg_find_acquire_program.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index ef0e1584f..3f0142377 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -218,19 +218,20 @@ function(vcpkg_find_acquire_program VAR) FILENAME ${ARCHIVE} ) - file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") + file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}) if(DEFINED NOEXTRACT) if(DEFINED _vfa_RENAME) - file(INSTALL ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} RENAME ${_vfa_RENAME}) + file(INSTALL ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} RENAME ${_vfa_RENAME}) else() - file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + file(COPY ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR}) endif() else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) if(ARCHIVE_EXTENSION STREQUAL ".msi") file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) - file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH) + file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} @@ -238,7 +239,7 @@ function(vcpkg_find_acquire_program VAR) else() execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} - WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} ) endif() endif() -- cgit v1.2.3 From e6ed2f89027bd35744f0522c49643449ee12ee33 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:58:50 -0700 Subject: [find_acquire] Fix ninja path --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 3f0142377..30ecb0573 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -116,7 +116,7 @@ function(vcpkg_find_acquire_program VAR) if(CMAKE_HOST_WIN32) set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") else() - set(PATHS "${DOWNLOADS}/tools/${SUBDIR}") + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") endif() set(BREW_PACKAGE_NAME "ninja") set(APT_PACKAGE_NAME "ninja-build") -- cgit v1.2.3 From 5b78dfaf68d33c2444437f92d253d7fa912152ec Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 22:13:12 -0700 Subject: [fetchTool] Extract aria2 with shell --- scripts/fetchTool.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 55d04ec98..c076d304a 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -48,8 +48,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." - # aria2 needs 7zip & 7zip920 to extract. So, we need to download those trough powershell - if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zip920") + # Download aria2 with .NET. aria2 will be used to download everything else. + if ($tool -eq "aria2") { vcpkgDownloadFile $url $downloadPath } @@ -69,7 +69,9 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { Write-Host "Extracting $tool..." - if ($tool -eq "7zip920") + # Extract 7zip920 with shell because we need it to extract 7zip + # Extract aria2 with shell because we need it to download 7zip + if ($tool -eq "7zip920" -or $tool -eq "aria2") { vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath } -- cgit v1.2.3 From 3a9be92f7e9cb867eaef4091ace282e4c8e82b92 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 03:16:22 -0700 Subject: [fetchTool.ps1] Move downloaded file in place after hash check --- scripts/VcpkgPowershellUtils.ps1 | 19 +++++++++++++++---- scripts/fetchTool.ps1 | 8 ++------ 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 676ee5c03..63069f44d 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -103,22 +103,25 @@ function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) return $hash.ToLower() } -function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath, +function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$url, + [Parameter(Mandatory=$true)][string]$filePath, [Parameter(Mandatory=$true)][string]$expectedHash, [Parameter(Mandatory=$true)][string]$actualHash) { if ($expectedHash -ne $actualHash) { Write-Host ("`nFile does not have expected hash:`n" + + " url: [ $url ]`n" + " File path: [ $filePath ]`n" + " Expected hash: [ $expectedHash ]`n" + " Actual hash: [ $actualHash ]`n") - throw "Invalid Hash for file $filePath" + throw } } function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadPath) + [Parameter(Mandatory=$true)][string]$downloadPath, + [Parameter(Mandatory=$true)][string]$sha512) { if (Test-Path $downloadPath) { @@ -152,12 +155,17 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } $wc.DownloadFile($url, $downloadPartPath) + + $actualHash = vcpkgGetSHA512 $downloadPartPath + vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash + Move-Item -Path $downloadPartPath -Destination $downloadPath } function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$aria2exe, [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadPath) + [Parameter(Mandatory=$true)][string]$downloadPath, + [Parameter(Mandatory=$true)][string]$sha512) { if (Test-Path $downloadPath) { @@ -178,6 +186,9 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari throw } + $actualHash = vcpkgGetSHA512 $downloadPartPath + vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash + Move-Item -Path $downloadPartPath -Destination $downloadPath } diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index c076d304a..c1e8d87fc 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -51,21 +51,17 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) # Download aria2 with .NET. aria2 will be used to download everything else. if ($tool -eq "aria2") { - vcpkgDownloadFile $url $downloadPath + vcpkgDownloadFile $url $downloadPath $toolData.sha512 } else { $aria2exe = fetchToolInternal "aria2" - vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath + vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath $toolData.sha512 } Write-Host "Downloading $tool... done." } - $expectedDownloadedFileHash = $toolData.sha512 - $downloadedFileHash = vcpkgGetSHA512 $downloadPath - vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if ($isArchive) { Write-Host "Extracting $tool..." -- cgit v1.2.3 From 3f6f9f3f4d48ef0115f3095f7d8d2c6d3b0c63e1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 17:12:59 -0700 Subject: [metrics] Use new string-hash functions instead of ps1 script --- scripts/SHA256Hash.ps1 | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 scripts/SHA256Hash.ps1 (limited to 'scripts') diff --git a/scripts/SHA256Hash.ps1 b/scripts/SHA256Hash.ps1 deleted file mode 100644 index 348d461b7..000000000 --- a/scripts/SHA256Hash.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -[CmdletBinding()] -Param( - [Parameter(Mandatory=$True)] - [String]$Value -) - -$sha256 = New-Object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider -$utf8 = New-Object -TypeName System.Text.UTF8Encoding -[System.BitConverter]::ToString($sha256.ComputeHash($utf8.GetBytes($Value))) -- cgit v1.2.3 From 7d5c33cf1b9483c94894e5f1831c8411b36f37cf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 14:36:48 -0700 Subject: [vcpkgTools.xml] Bump version to "2" --- scripts/vcpkgTools.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 07284333c..ba81ed926 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,5 +1,5 @@ - + 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe -- cgit v1.2.3 From d5a1e1054120c993560e5de1c6ad8ac16131d356 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 15:22:50 -0700 Subject: [ps1] Verify hash for already present files. Dont check for path twice --- scripts/VcpkgPowershellUtils.ps1 | 23 ++++------------------- scripts/fetchTool.ps1 | 4 ++++ 2 files changed, 8 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 63069f44d..f6882409b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -105,9 +105,9 @@ function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$filePath, - [Parameter(Mandatory=$true)][string]$expectedHash, - [Parameter(Mandatory=$true)][string]$actualHash) + [Parameter(Mandatory=$true)][string]$expectedHash) { + $actualHash = vcpkgGetSHA512 $filePath if ($expectedHash -ne $actualHash) { Write-Host ("`nFile does not have expected hash:`n" + @@ -123,11 +123,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$downloadPath, [Parameter(Mandatory=$true)][string]$sha512) { - if (Test-Path $downloadPath) - { - return - } - if ($url -match "github") { if ([System.Enum]::IsDefined([Net.SecurityProtocolType], "Tls12")) @@ -155,10 +150,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } $wc.DownloadFile($url, $downloadPartPath) - - $actualHash = vcpkgGetSHA512 $downloadPartPath - vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash - + vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512 Move-Item -Path $downloadPartPath -Destination $downloadPath } @@ -167,11 +159,6 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari [Parameter(Mandatory=$true)][string]$downloadPath, [Parameter(Mandatory=$true)][string]$sha512) { - if (Test-Path $downloadPath) - { - return - } - vcpkgCreateParentDirectoryIfNotExists $downloadPath $downloadPartPath = "$downloadPath.part" vcpkgRemoveItem $downloadPartPath @@ -186,9 +173,7 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari throw } - $actualHash = vcpkgGetSHA512 $downloadPartPath - vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash - + vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512 Move-Item -Path $downloadPartPath -Destination $downloadPath } diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index c1e8d87fc..8de642674 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -61,6 +61,10 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) Write-Host "Downloading $tool... done." } + else + { + vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $toolData.sha512 + } if ($isArchive) { -- cgit v1.2.3 From f63994db6c02266525b33c014f1447cb72a19e82 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 20:34:06 -0700 Subject: Update nuget.exe to 4.6.2 --- scripts/vcpkgTools.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index ba81ed926..a11ee344f 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -35,10 +35,10 @@ 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed - 4.4.0 + 4.6.2 nuget.exe - https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe - fb0903665d2a64ce1da3f40961eb19e46c152a631b2441750aa8b30b20acd2a5e78d7f1058e79e83e37959b3ce9a090a60f081895fdba9998715e3a64437c3e5 + https://dist.nuget.org/win-x86-commandline/v4.6.2/nuget.exe + 60daea7bec2de23089f7ad73985dd788ac154171d6326c2c456726849b8f97dfc38cbdd9b9bf8d96aced009ccaaed317905b65c108e149cfbbbcdfb95f8f0519 3.1.81 -- cgit v1.2.3 From 340320487342740ff2313f44efd35eeba9423ac2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 20:36:07 -0700 Subject: Update vswhere.exe to 2.4.1 --- scripts/vcpkgTools.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index a11ee344f..daaf29214 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -29,10 +29,10 @@ MinGit-2.16.2-32-bit.zip - 2.3.2 + 2.4.1 vswhere.exe - https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe - 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed + https://github.com/Microsoft/vswhere/releases/download/2.4.1/vswhere.exe + f477842d0cebefcd6bf9c6d536ab8ea20ec5b0aa967ee963ab6a101aeff9df8742ca600d35f39e2e7158d76d8231f1ed2bef6104dce84d2bf8d6b07d17d706a1 4.6.2 -- cgit v1.2.3 From 1e1899c3a27f3816c39145049e2c33832071b8c6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 8 Apr 2018 15:12:19 -0700 Subject: [ps1] Handle "downloading" local files Fixes #3230 --- scripts/VcpkgPowershellUtils.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index f6882409b..3ab301c55 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -166,6 +166,12 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari $parentDir = split-path -parent $downloadPath $filename = split-path -leaf $downloadPath + if ((Test-Path $url) -or ($url.StartsWith("file://"))) # if is local file + { + vcpkgDownloadFile $url $downloadPath $sha512 + return + } + $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url" if ($ec -ne 0) { -- cgit v1.2.3 From 908e714980fe2f2ab32cba4dd44f6a61b5991733 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 9 Apr 2018 22:14:47 -0700 Subject: Fix typo --- scripts/fetchTool.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 8de642674..be18656c7 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -22,7 +22,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($toolData -eq $null) { - throw "Unkown tool $tool" + throw "Unknown tool $tool" } $toolPath="$downloadsDir\tools\$tool-$($toolData.version)-windows" -- cgit v1.2.3 From bb054e645d6a91adc6d533929ff3b4d9fd1d8788 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 2 Apr 2018 20:40:25 -0700 Subject: [vcpkg] Don't pass /utf-8 to VS 2013 --- scripts/cmake/vcpkg_configure_cmake.cmake | 1 + scripts/toolchains/windows.cmake | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 3a3a88515..3e0922428 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -165,6 +165,7 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" + "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 7bfc2282b..753723bd9 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -9,8 +9,16 @@ if(NOT _CMAKE_IN_TRY_COMPILE) message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"") endif() - set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") - set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + set(CHARSET_FLAG "/utf-8") + if(VCPKG_PLATFORM_TOOLSET MATCHES "v120") + # VS 2013 does not support /utf-8 + set(CHARSET_FLAG) + endif() + + set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") + set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + + unset(CHARSET_FLAG) set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "") set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "") -- cgit v1.2.3 From 58be8482764c4bae5a62418786b30432a69649aa Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 10 Apr 2018 10:52:19 -0700 Subject: [vcpkg] Always use -c65001 for the resource compiler on windows. Fixes #3221. --- scripts/toolchains/windows.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 753723bd9..266e023b1 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -17,6 +17,7 @@ if(NOT _CMAKE_IN_TRY_COMPILE) set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "") unset(CHARSET_FLAG) -- cgit v1.2.3 From 401e7a0e7ca47cefb7e332f50333f8719d26a90c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 10 Apr 2018 15:38:58 -0700 Subject: [vcpkg_build_cmake] Add workaround for WSL filesystem issues --- scripts/cmake/vcpkg_build_cmake.cmake | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 630662588..41415d9a8 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -105,6 +105,7 @@ function(vcpkg_build_cmake) if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: ") # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} without parallelism because memory exceeded") execute_process( COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} OUTPUT_FILE "${LOGPREFIX}-out-1.log" @@ -123,6 +124,33 @@ function(vcpkg_build_cmake) list(APPEND LOGS "${LOGPREFIX}-err-1.log") endif() endif() + elseif(out_contents MATCHES ": No such file or directory") + # WSL workaround - WSL occassionally fails with no such file or directory. Detect if we are running in WSL and restart. + execute_process(COMMAND "uname" "-r" + OUTPUT_VARIABLE UNAME_R ERROR_VARIABLE UNAME_R + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) + + if (UNAME_R MATCHES "Microsoft") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of (potential) wsl subsystem issue.") + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} + OUTPUT_FILE "${LOGPREFIX}-out-1.log" + ERROR_FILE "${LOGPREFIX}-err-1.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-1.log" out_contents) + file(READ "${LOGPREFIX}-err-1.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-1.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-1.log") + endif() + endif() + endif() endif() if(error_code) -- cgit v1.2.3 From dc207a2c891fe6deb2710ccde0abf48078f64fcd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Apr 2018 18:15:38 -0700 Subject: Restore powershell extracting because shell may not be available (see #3252) --- scripts/VcpkgPowershellUtils.ps1 | 40 ++++++++++++++++++++++++++++++---------- scripts/fetchTool.ps1 | 4 ++-- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 3ab301c55..fdd89e7b9 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,3 +1,8 @@ +function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) +{ + return [bool](Get-Module -ListAvailable -Name $moduleName) +} + function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { if ($object -eq $null) @@ -183,9 +188,9 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari Move-Item -Path $downloadPartPath -Destination $downloadPath } -function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, - [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir) +function vcpkgExtractFileWith7z([Parameter(Mandatory=$true)][string]$sevenZipExe, + [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) { vcpkgRemoveItem $destinationDir $destinationPartial = "$destinationDir.partial" @@ -200,20 +205,35 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, Rename-Item -Path "$destinationPartial" -NewName $destinationDir } -function vcpkgExtractZipFileWithShell( [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir) +function vcpkgExtractZipFile( [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) { vcpkgRemoveItem $destinationDir $destinationPartial = "$destinationDir.partial" vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial - $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) - foreach($item in $zip.items()) + + if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') + { + Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") + Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial + } + elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + Write-Verbose("Extracting with Pscx\Expand-Archive") + Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial + } + else + { + Write-Verbose("Extracting via shell") + $shell = new-object -com shell.application + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + } } Rename-Item -Path "$destinationPartial" -NewName $destinationDir diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index be18656c7..dd3f0f9f4 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -73,7 +73,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) # Extract aria2 with shell because we need it to download 7zip if ($tool -eq "7zip920" -or $tool -eq "aria2") { - vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath + vcpkgExtractZipFile -ArchivePath $downloadPath -DestinationDir $toolPath } elseif ($tool -eq "7zip") { @@ -88,7 +88,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) else { $sevenZipExe = fetchToolInternal "7zip" - vcpkgExtractFile -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath + vcpkgExtractFileWith7z -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath } Write-Host "Extracting $tool... done." } -- cgit v1.2.3 From a4b35f14baac9ccaadca7c6daf6dea39cb9817a2 Mon Sep 17 00:00:00 2001 From: John Farrier Date: Tue, 17 Apr 2018 19:11:18 -0400 Subject: Upgrade Celero to v2.2.0 (#3259) * Upgrade Celero to v2.2.0 * [celero] Fix installed cmake targets --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 475047737..47c91f83c 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -28,6 +28,12 @@ function(vcpkg_fixup_cmake_targets) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}) if(_vfct_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}") + if(_vfct_CONFIG_PATH STREQUAL "share") + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/share2) + file(RENAME ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/share2) + set(_vfct_CONFIG_PATH share2) + endif() + set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}) @@ -36,6 +42,7 @@ function(vcpkg_fixup_cmake_targets) message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") endif() + # This roundabout handling enables CONFIG_PATH share file(MAKE_DIRECTORY ${DEBUG_SHARE}) file(GLOB FILES ${DEBUG_CONFIG}/*) file(COPY ${FILES} DESTINATION ${DEBUG_SHARE}) @@ -76,7 +83,7 @@ function(vcpkg_fixup_cmake_targets) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(NOT EXISTS ${DEBUG_SHARE}) + if(NOT EXISTS "${DEBUG_SHARE}") message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") endif() endif() -- cgit v1.2.3 From 3a3fa5cd8f02dde78b00c12273b338e293edcd51 Mon Sep 17 00:00:00 2001 From: Jonathan Hale Date: Thu, 19 Apr 2018 04:33:12 +0200 Subject: [magnum] Properly deploy plugins (#3191) * [magnum] Properly deploy magnum plugins Signed-off-by: Squareys * [magnum-plugins] Add tinygltfimporter feature Signed-off-by: Squareys * [magnum][magnum-plugins] Add features: trade and any* Prepares upcoming move of those sublibraries and allows building --head immediately. For current release this only adds some unused cmake flags that will be ignored. Signed-off-by: Squareys * [magnum] Add gl feature, cleanup dependencies, mark upcoming features And sort features alphabetically. Signed-off-by: Squareys * [magnum-plugins] Prepare renaming of static flag for --head installs Signed-off-by: Squareys * [magnum] Add two missing feature dependencies Signed-off-by: Squareys * [magnum] Enable magnum[any*] features by default Signed-off-by: Squareys --- scripts/buildsystems/msbuild/applocal.ps1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 3f0f2ef37..e5f3c3dd0 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -4,6 +4,7 @@ param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$ $g_searched = @{} # Note: installedDir is actually the bin\ directory. $g_install_root = Split-Path $installedDir -parent +$g_is_debug = $g_install_root -match '(.*\\)?debug(\\)?$' # Ensure we create the copied files log, even if we don't end up copying any files if ($copiedFilesLog) @@ -63,6 +64,13 @@ function resolve([string]$targetBinary) { deployBinary $baseTargetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } + if (Test-Path function:\deployPluginsIfMagnum) { + if ($g_is_debug) { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum-d" "$_" + } else { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum" "$_" + } + } resolve "$baseTargetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" @@ -85,5 +93,12 @@ if (Test-Path "$g_install_root\bin\OpenNI2\openni2deploy.ps1") { . "$g_install_root\bin\OpenNI2\openni2deploy.ps1" } +# Note: This is a hack to make Magnum work. +if (Test-Path "$g_install_root\bin\magnum\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum\magnumdeploy.ps1" +} elseif (Test-Path "$g_install_root\bin\magnum-d\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum-d\magnumdeploy.ps1" +} + resolve($targetBinary) -Write-Verbose $($g_searched | out-string) \ No newline at end of file +Write-Verbose $($g_searched | out-string) -- cgit v1.2.3 From d2f69445b6394f197f986d1b6945e7960fd10b22 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Apr 2018 16:21:36 -0700 Subject: Retry the wsl workaround up to 10 times --- scripts/cmake/vcpkg_build_cmake.cmake | 42 ++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 41415d9a8..983ac9221 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -131,25 +131,31 @@ function(vcpkg_build_cmake) OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) if (UNAME_R MATCHES "Microsoft") - message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of (potential) wsl subsystem issue.") - execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} - OUTPUT_FILE "${LOGPREFIX}-out-1.log" - ERROR_FILE "${LOGPREFIX}-err-1.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - - if(error_code) - file(READ "${LOGPREFIX}-out-1.log" out_contents) - file(READ "${LOGPREFIX}-err-1.log" err_contents) - - if(out_contents) - list(APPEND LOGS "${LOGPREFIX}-out-1.log") + set(ITERATION 0) + while (ITERATION LESS 10 AND out_contents MATCHES ": No such file or directory") + MATH(EXPR ITERATION "${ITERATION}+1") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of wsl subsystem issue. Iteration: ${ITERATION}") + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} + OUTPUT_FILE "${LOGPREFIX}-out-${ITERATION}.log" + ERROR_FILE "${LOGPREFIX}-err-${ITERATION}.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-${ITERATION}.log" out_contents) + file(READ "${LOGPREFIX}-err-${ITERATION}.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-${ITERATION}.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-${ITERATION}.log") + endif() + else() + break() endif() - if(err_contents) - list(APPEND LOGS "${LOGPREFIX}-err-1.log") - endif() - endif() + endwhile() endif() endif() -- cgit v1.2.3 From d84e86a910126e91c781af63e33e3516aa171f2a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Apr 2018 18:13:11 -0700 Subject: Fix grpc lookup (case-insensitive) --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index a9f8190f7..91c196fb9 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -241,6 +241,8 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() endif() + elseif("${_vcpkg_lowercase_name}" STREQUAL "grpc" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/grpc") + _find_package(gRPC ${ARGN}) else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From a11086e3b9d560d3b73de91175c57db658e39809 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 03:03:26 -0700 Subject: Introduce bootstrap.sh --- scripts/bootstrap.sh | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 scripts/bootstrap.sh (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh new file mode 100644 index 000000000..66efb1d62 --- /dev/null +++ b/scripts/bootstrap.sh @@ -0,0 +1,188 @@ +#!/bin/sh + +# Find vcpkg-root +vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P) +while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do + vcpkgRootDir="$(dirname "$vcpkgRootDir")" +done + +downloadsDir="$vcpkgRootDir/downloads" + +extractStringBetweenDelimiters() +{ + input=$1;leftDelim=$2;rightDelim=$3 + output="${input##*$leftDelim}" + output="${output%%$rightDelim*}" + echo "$output" +} + +vcpkgCheckRepoTool() +{ + __tool=$1 + if ! command -v "$__tool" >/dev/null 2>&1 ; then + echo "Could not find $__tool. Please install it (and other dependencies) with:" + echo "sudo apt-get install curl unzip tar" + exit 1 + fi +} + +vcpkgCheckEqualFileHash() +{ + url=$1; filePath=$2; expectedHash=$3 + + actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx + actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word + + if ! [ "$expectedHash" = "$actualHash" ]; then + echo "" + echo "File does not have expected hash:" + echo " url: [ $url ]" + echo " File path: [ $downloadPath ]" + echo " Expected hash: [ $sha512 ]" + echo " Actual hash: [ $actualHash ]" + exit + fi +} + +vcpkgDownloadFile() +{ + url=$1; downloadPath=$2 sha512=$3 + vcpkgCheckRepoTool "curl" + rm -rf "$downloadPath.part" + curl -L $url --create-dirs --output "$downloadPath.part" || exit 1 + + vcpkgCheckEqualFileHash $url "$downloadPath.part" $sha512 + mv "$downloadPath.part" "$downloadPath" +} + +vcpkgExtractArchive() +{ + archive=$1; toPath=$2 + rm -rf "$toPath" "$toPath.partial" + mkdir -p "$toPath.partial" + + archiveType="${archive##*.}" + if [ "$archiveType" = "zip" ]; then + vcpkgCheckRepoTool "unzip" + $(cd "$toPath.partial" && unzip -qqo "$archive") + else + vcpkgCheckRepoTool "tar" + $(cd "$toPath.partial" && tar xzf "$archive") + fi + mv "$toPath.partial" "$toPath" +} + +fetchTool() +{ + tool=$1; UNAME=$2; __output=$3 + + if [ "$tool" = "" ]; then + echo "No tool name provided" + return 1 + fi + + if [ "$UNAME" = "Linux" ]; then + os="linux" + elif [ "$UNAME" = "Darwin" ]; then + os="osx" + else + echo "Unknown uname: $UNAME" + return 1 + fi + + xmlFileAsString=`cat $vcpkgRootDir/scripts/vcpkgTools.xml` + toolRegexStart="" + toolData="$(extractStringBetweenDelimiters "$xmlFileAsString" "$toolRegexStart" "")" + if [ "$toolData" = "" ]; then + echo "Unknown tool: $tool" + return 1 + fi + + version="$(extractStringBetweenDelimiters "$toolData" "" "")" + + toolPath="$downloadsDir/tools/$tool-$version-$os" + + exeRelativePath="$(extractStringBetweenDelimiters "$toolData" "" "")" + exePath="$toolPath/$exeRelativePath" + + if [ -e "$exePath" ]; then + eval $__output="'$exePath'" + return 0 + fi + + isArchive=true + if [ $isArchive = true ]; then + archiveName="$(extractStringBetweenDelimiters "$toolData" "" "")" + downloadPath="$downloadsDir/$archiveName" + else + echo "Non-archives not supported yet" + return 1 + fi + + url="$(extractStringBetweenDelimiters "$toolData" "" "")" + sha512="$(extractStringBetweenDelimiters "$toolData" "" "")" + if ! [ -e "$downloadPath" ]; then + echo "Downloading $tool..." + vcpkgDownloadFile $url "$downloadPath" $sha512 + echo "Downloading $tool... done." + else + vcpkgCheckEqualFileHash $url "$downloadPath" $sha512 + fi + + if [ $isArchive = true ]; then + echo "Extracting $tool..." + vcpkgExtractArchive "$downloadPath" "$toolPath" + echo "Extracting $tool... done." + fi + + if ! [ -e "$exePath" ]; then + echo "Could not detect or download $tool" + return 1 + fi + + eval $__output="'$exePath'" + return 0 +} + +selectCXX() +{ + __output=$1 + + if [ "x$CXX" = "x" ]; then + CXX=g++ + if which g++-7 >/dev/null 2>&1; then + CXX=g++-7 + elif which g++-6 >/dev/null 2>&1; then + CXX=g++-6 + fi + fi + + gccversion="$("$CXX" -v 2>&1)" + gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")" + if [ "$gccversion" = "5" ]; then + echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7." + echo "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" + echo "sudo apt-get update -y" + echo "sudo apt-get install g++-7 -y" + return 1 + fi + + eval $__output="'$CXX'" +} + +# Preparation +UNAME="$(uname)" +fetchTool "cmake" "$UNAME" cmakeExe || exit 1 +fetchTool "ninja" "$UNAME" ninjaExe || exit 1 +selectCXX CXX || exit 1 + +# Do the build +buildDir="$vcpkgRootDir/toolsrc/build.rel" +rm -rf "$buildDir" +mkdir -p "$buildDir" + +(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe") +(cd "$buildDir" && "$cmakeExe" --build .) + +rm -rf "$vcpkgRootDir/vcpkg" +cp "$buildDir/vcpkg" "$vcpkgRootDir/" \ No newline at end of file -- cgit v1.2.3 From f12ded7fd0ca91fb128ddaf20b933f8457d9c1f3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Apr 2018 22:44:46 +0000 Subject: [sh] Fix permission --- scripts/bootstrap.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/bootstrap.sh (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From b5e4c4c7cf68b807e222b09415b678d2f47a3d3b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Apr 2018 16:04:14 -0700 Subject: [find_acquire.cmake] Fix ninja path for mac --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 30ecb0573..39a722d93 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -115,6 +115,8 @@ function(vcpkg_find_acquire_program VAR) set(SUBDIR "ninja-1.8.2") if(CMAKE_HOST_WIN32) set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx") else() set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") endif() -- cgit v1.2.3 From 6a3c1db30bbdc0d2580a3c787d90811e6bb7823a Mon Sep 17 00:00:00 2001 From: Rudi Lee Date: Thu, 26 Apr 2018 07:38:45 +0700 Subject: Checking for sha512sum on OS which doesn't have shasum --- scripts/bootstrap.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 66efb1d62..58eb9e9fb 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -29,8 +29,15 @@ vcpkgCheckRepoTool() vcpkgCheckEqualFileHash() { url=$1; filePath=$2; expectedHash=$3 + + SHASUM="shasum -a 512" # sha512sum is not available on osx - actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx + # checking for sha512sum on os which doesn't have shasum + if which sha512sum >/dev/null 2>&1; then + SHASUM=sha512sum + fi + + actualHash=$("$SHASUM" "$filePath") actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word if ! [ "$expectedHash" = "$actualHash" ]; then -- cgit v1.2.3 From c78a609dabb0df43d0443452261f7c3b592b9b41 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Apr 2018 02:11:04 +0000 Subject: [sh] Tweak so only the sh forwarder needs to be +x --- scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 scripts/bootstrap.sh (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh old mode 100755 new mode 100644 index 66efb1d62..c69dc0135 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -185,4 +185,4 @@ mkdir -p "$buildDir" (cd "$buildDir" && "$cmakeExe" --build .) rm -rf "$vcpkgRootDir/vcpkg" -cp "$buildDir/vcpkg" "$vcpkgRootDir/" \ No newline at end of file +cp "$buildDir/vcpkg" "$vcpkgRootDir/" -- cgit v1.2.3 From ef594607829ad6ed2bd462a0ddcbb0ee698b3f4f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Apr 2018 22:23:45 -0700 Subject: [bootstrap.sh] Minor refactoring for clarity --- scripts/bootstrap.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 2225f029d..95ee75af1 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -29,15 +29,15 @@ vcpkgCheckRepoTool() vcpkgCheckEqualFileHash() { url=$1; filePath=$2; expectedHash=$3 - - SHASUM="shasum -a 512" # sha512sum is not available on osx - # checking for sha512sum on os which doesn't have shasum - if which sha512sum >/dev/null 2>&1; then - SHASUM=sha512sum + if command -v "sha512sum" >/dev/null 2>&1 ; then + actualHash=$(sha512sum "$filePath") + else + # sha512sum is not available by default on osx + # shasum is not available by default on Fedora + actualHash=$(shasum -a 512 "$filePath") fi - actualHash=$("$SHASUM" "$filePath") actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word if ! [ "$expectedHash" = "$actualHash" ]; then -- cgit v1.2.3 From 540a32c8413df21bc11aa714ff3086c9520fe6f5 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Fri, 27 Apr 2018 11:14:47 -0400 Subject: Require the version of g++ to be at least 6 On Ubuntu 16.04, old versions of g++ such as 4.9 are available. Other Linux distributions may also ship with g++ versions older than 5. With the previous test, the bootstrap script was not failing fast and instead was starting to compile vcpkg before it encountered the unsupported flag -std=c++1z. The error message was not very explicit and that was making it difficult to the developer to understand what the problem was. However, when using g++ 5, an clear error message was printed to help the user. This commit shows the helpful error message anytime g++ is older than version 6. --- scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 95ee75af1..037a9136d 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -166,7 +166,7 @@ selectCXX() gccversion="$("$CXX" -v 2>&1)" gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")" - if [ "$gccversion" = "5" ]; then + if [ "$gccversion" -lt "6" ]; then echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7." echo "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" echo "sudo apt-get update -y" -- cgit v1.2.3 From 08afae2a7a5cd276fd251cbeef9a27f15261fc0c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Apr 2018 16:17:18 -0700 Subject: Bump version of git to 2.17.0 (was 2.16.2) --- scripts/vcpkgTools.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index daaf29214..1a2abae81 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -22,11 +22,11 @@ cmake-3.10.2-Linux-x86_64.tar.gz - 2.16.2 + 2.17.0 cmd\git.exe - https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip - 004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a - MinGit-2.16.2-32-bit.zip + https://github.com/git-for-windows/git/releases/download/v2.17.0.windows.1/MinGit-2.17.0-32-bit.zip + a34575ab1b4f553e62535e38492904b512df4d6a837cf4abf205dbcdd05edf1eef450cc5b15a4f63f901424d5f3cd1f78b6b22437d0d4f8cd9ce4e42e82617b9 + MinGit-2.17.0-32-bit.zip 2.4.1 -- cgit v1.2.3 From 468bfeb56e29e0130a1b56adb4c23fdba403221e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 21 Feb 2018 21:17:14 -0800 Subject: [Clean patching] Each portref-patchset combo gets its own hash-based directory --- scripts/cmake/vcpkg_from_github.cmake | 73 ++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index c6a23cff6..28ada0631 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -51,7 +51,7 @@ ## * [beast](https://github.com/Microsoft/vcpkg/blob/master/ports/beast/portfile.cmake) function(vcpkg_from_github) set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 HEAD_REF) - set(multipleValuesArgs) + set(multipleValuesArgs PATCHES) cmake_parse_arguments(_vdud "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) if(NOT DEFINED _vdud_OUT_SOURCE_PATH) @@ -73,21 +73,17 @@ function(vcpkg_from_github) string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) - macro(set_SOURCE_PATH BASE BASEREF) - set(SOURCE_PATH "${BASE}/${REPO_NAME}-${BASEREF}") - if(EXISTS ${SOURCE_PATH}) - set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) - else() - # Sometimes GitHub strips a leading 'v' off the REF. - string(REGEX REPLACE "^v" "" REF ${BASEREF}) - string(REPLACE "/" "-" REF ${REF}) - set(SOURCE_PATH "${BASE}/${REPO_NAME}-${REF}") - if(EXISTS ${SOURCE_PATH}) - set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) - else() - message(FATAL_ERROR "Could not determine source path: '${BASE}/${REPO_NAME}-${BASEREF}' does not exist") - endif() + macro(set_TEMP_SOURCE_PATH BASE BASEREF) + set(TEMP_SOURCE_PATH "${BASE}/${REPO_NAME}-${BASEREF}") + if(NOT EXISTS ${TEMP_SOURCE_PATH}) + # Sometimes GitHub strips a leading 'v' off the REF. + string(REGEX REPLACE "^v" "" REF ${BASEREF}) + string(REPLACE "/" "-" REF ${REF}) + set(TEMP_SOURCE_PATH "${BASE}/${REPO_NAME}-${REF}") + if(NOT EXISTS ${TEMP_SOURCE_PATH}) + message(FATAL_ERROR "Could not determine source path: '${BASE}/${REPO_NAME}-${BASEREF}' does not exist") endif() + endif() endmacro() if(VCPKG_USE_HEAD_VERSION AND NOT DEFINED _vdud_HEAD_REF) @@ -108,8 +104,44 @@ function(vcpkg_from_github) SHA512 "${_vdud_SHA512}" FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz" ) - vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}") - set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${SANITIZED_REF}) + + # Take the last 10 chars of the REF + set(REF_MAX_LENGTH 10) + string(LENGTH ${SANITIZED_REF} REF_LENGTH) + math(EXPR FROM_REF ${REF_LENGTH}-${REF_MAX_LENGTH}) + if(FROM_REF LESS 0) + set(FROM_REF 0) + endif() + string(SUBSTRING ${SANITIZED_REF} ${FROM_REF} ${REF_LENGTH} SHORTENED_SANITIZED_REF) + + # Hash the archive hash along with the patches. Take the first 10 chars of the hash + set(PATCHSET_HASH "${_vdud_SHA512}") + foreach(PATCH IN LISTS _vdud_PATCHES) + file(SHA512 ${PATCH} CURRENT_HASH) + string(APPEND PATCHSET_HASH ${CURRENT_HASH}) + endforeach() + + string(SHA512 PATCHSET_HASH ${PATCHSET_HASH}) + string(SUBSTRING ${PATCHSET_HASH} 0 10 PATCHSET_HASH) + set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}") + + if(NOT EXISTS ${SOURCE_PATH}) + set(TEMP_DIR "${CURRENT_BUILDTREES_DIR}/src/TEMP") + file(REMOVE_RECURSE ${TEMP_DIR}) + vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}" WORKING_DIRECTORY ${TEMP_DIR}) + set_TEMP_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/TEMP ${SANITIZED_REF}) + + vcpkg_apply_patches( + SOURCE_PATH ${TEMP_SOURCE_PATH} + PATCHES ${_vdud_PATCHES} + ) + + file(RENAME ${TEMP_SOURCE_PATH} ${SOURCE_PATH}) + file(REMOVE_RECURSE ${TEMP_DIR}) + endif() + + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + return() endif() @@ -167,5 +199,10 @@ function(vcpkg_from_github) set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) endif() - set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF}) + set_TEMP_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF}) + vcpkg_apply_patches( + SOURCE_PATH ${TEMP_SOURCE_PATH} + PATCHES ${_vdud_PATCHES} + ) + set(${_vdud_OUT_SOURCE_PATH} "${TEMP_SOURCE_PATH}" PARENT_SCOPE) endfunction() -- cgit v1.2.3 From c4caf29213f54b1786102c1b4dc085b6d7142998 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Apr 2018 19:08:34 -0700 Subject: [vcpkg] Fix temporary download directory when vcpkg is located at the root of a drive --- scripts/VcpkgPowershellUtils.ps1 | 17 ++++++++++++++--- scripts/fetchTool.ps1 | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index fdd89e7b9..3ea18116b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -89,7 +89,13 @@ function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') { Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") - $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512).Hash + $hashresult = Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512 -ErrorVariable hashError + if ($hashError) + { + Start-Sleep 3 + $hashresult = Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512 -ErrorVariable Stop + } + $hash = $hashresult.Hash } elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash') { @@ -177,7 +183,7 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari return } - $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url" + $ec = vcpkgInvokeCommand "$aria2exe" "--dir=`"$parentDir`" --out=`"$filename.part`" $url" if ($ec -ne 0) { Write-Host "Could not download $url" @@ -202,7 +208,12 @@ function vcpkgExtractFileWith7z([Parameter(Mandatory=$true)][string]$sevenZipExe Write-Host "Could not extract $archivePath" throw } - Rename-Item -Path "$destinationPartial" -NewName $destinationDir + Rename-Item -Path "$destinationPartial" -NewName $destinationDir -ErrorVariable renameResult + if ($renameResult) + { + Start-Sleep 3 + Rename-Item -Path "$destinationPartial" -NewName $destinationDir -ErrorAction Stop + } } function vcpkgExtractZipFile( [Parameter(Mandatory=$true)][string]$archivePath, diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index dd3f0f9f4..eca405b62 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -4,6 +4,7 @@ param( ) Set-StrictMode -Version Latest + $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" @@ -12,6 +13,7 @@ $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" vcpkgCreateDirectoryIfNotExists $downloadsDir +$downloadsDir = Resolve-Path $downloadsDir function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { -- cgit v1.2.3 From ab58f531ccf6da9895502cb8ae7bd85b29823d1d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 4 May 2018 18:14:54 -0700 Subject: git for linux/osx version moved to vcpkgTools.xml --- scripts/vcpkgTools.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 1a2abae81..1f17102d2 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -28,6 +28,18 @@ a34575ab1b4f553e62535e38492904b512df4d6a837cf4abf205dbcdd05edf1eef450cc5b15a4f63f901424d5f3cd1f78b6b22437d0d4f8cd9ce4e42e82617b9 MinGit-2.17.0-32-bit.zip + + 2.7.4 + + + + + + 2.7.4 + + + + 2.4.1 vswhere.exe -- cgit v1.2.3