From add26b7b5f3bc76b709aaf66eb5d35a6c74aa0e4 Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sat, 24 Sep 2016 15:23:18 +0200 Subject: [PATCH 1/8] Updated vcpkg_download_distfile.cmake to handle MIRRORS. Also updated the HASH errors to match the CMake formatting (easier to read) --- ports/sery/portfile.cmake | 3 +- scripts/cmake/vcpkg_download_distfile.cmake | 61 +++++++++++++++++---- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/ports/sery/portfile.cmake b/ports/sery/portfile.cmake index 34ddb02481..7cc98fe160 100644 --- a/ports/sery/portfile.cmake +++ b/ports/sery/portfile.cmake @@ -1,6 +1,7 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/Ninetainedo/Sery/archive/v1.0.zip" + URL "https://githsdsdub.com/Ninetainedo/Sery/archive/v1.0.zip" + MIRRORS "2http://githdfdub.com/Ninetainedo/Sery/archive/v1.0.zip" "https://github.com/Ninetainedo/Sery/archive/v1.0.zip" FILENAME "sery-1.0.0.zip" SHA512 15ef97bf094e8931049d8dd667a778e23847555f0f8d5b949b250e26edcc2541744fac5c34d935880d070546777fa787b1baf018d8ca2240fcd18a820aded04f ) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 3145c8851b..a394642a2f 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -1,20 +1,57 @@ -# Usage: vcpkg_download_distfile( URL FILENAME SHA512 <5981de...>) +# Usage: vcpkg_download_distfile( URL FILENAME SHA512 <5981de...> MIRRORS ) function(vcpkg_download_distfile VAR) set(oneValueArgs URL FILENAME SHA512) - cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "" ${ARGN}) + set(multipleValuesArgs MIRRORS) + cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) - if(EXISTS ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) - message(STATUS "Using cached ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}") - file(SHA512 ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME} FILE_HASH) - if(NOT FILE_HASH STREQUAL "${vcpkg_download_distfile_SHA512}") + set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) + if(EXISTS ${downloaded_file_path}) + message(STATUS "Using cached ${downloaded_file_path}") + file(SHA512 ${downloaded_file_path} FILE_HASH) + if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") message(FATAL_ERROR - "File does not have expected hash: ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}\n" - " '${FILE_HASH}' <> '${vcpkg_download_distfile_SHA512}'\n" - "Please delete the file and try again if this file should be downloaded again.") + "\nFile does not have expected hash:\n" + " File path: [${downloaded_file_path}]\n" + " Expected hash: [${vcpkg_download_distfile_SHA512}]\n" + " Actual hash: [${FILE_HASH}]\n" + "Please delete the file and try again if this file should be downloaded again.\n") endif() else() - message(STATUS "Downloading ${vcpkg_download_distfile_URL}") - file(DOWNLOAD ${vcpkg_download_distfile_URL} ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME} EXPECTED_HASH SHA512=${vcpkg_download_distfile_SHA512}) + # Tries to download the file. + list(INSERT vcpkg_download_distfile_MIRRORS 0 ${vcpkg_download_distfile_URL}) + foreach(url IN LISTS vcpkg_download_distfile_MIRRORS) + message(STATUS "Downloading ${url}...") + file(DOWNLOAD ${url} ${downloaded_file_path} STATUS download_status) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + message(STATUS "Downloading ${url}... Failed") + file(REMOVE ${downloaded_file_path}) + set(download_success 0) + else() + message(STATUS "Downloading ${url}... OK") + set(download_success 1) + break() + endif() + endforeach(url) + + if (NOT ${download_success}) + message(FATAL_ERROR + "\n" + " Failed to download file.\n" + " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues/new\n") + else() + message(STATUS "Testing integrity of downloaded file...") + file(SHA512 ${downloaded_file_path} FILE_HASH) + if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") + message(FATAL_ERROR + "\nFile does not have expected hash:\n" + " File path: [${downloaded_file_path}]\n" + " Expected hash: [${vcpkg_download_distfile_SHA512}]\n" + " Actual hash: [${FILE_HASH}]\n" + "The file may be corrupted.\n") + endif() + message(STATUS "Testing integrity of downloaded file... OK") + endif() endif() - set(${VAR} ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME} PARENT_SCOPE) + set(${VAR} ${downloaded_file_path} PARENT_SCOPE) endfunction() From 9bb5b4c768acd4380a918b2d162bdafdcbe407df Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sat, 24 Sep 2016 15:24:51 +0200 Subject: [PATCH 2/8] Restored Sery's portfile --- ports/sery/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/sery/portfile.cmake b/ports/sery/portfile.cmake index 7cc98fe160..34ddb02481 100644 --- a/ports/sery/portfile.cmake +++ b/ports/sery/portfile.cmake @@ -1,7 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://githsdsdub.com/Ninetainedo/Sery/archive/v1.0.zip" - MIRRORS "2http://githdfdub.com/Ninetainedo/Sery/archive/v1.0.zip" "https://github.com/Ninetainedo/Sery/archive/v1.0.zip" + URL "https://github.com/Ninetainedo/Sery/archive/v1.0.zip" FILENAME "sery-1.0.0.zip" SHA512 15ef97bf094e8931049d8dd667a778e23847555f0f8d5b949b250e26edcc2541744fac5c34d935880d070546777fa787b1baf018d8ca2240fcd18a820aded04f ) From 930d0a7dedbcd3996a490eea5e061a00aca552d4 Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sun, 25 Sep 2016 00:23:04 +0200 Subject: [PATCH 3/8] URL and MIRRORS are now URLS Updated all portfiles accordingly. --- ports/boost/portfile.cmake | 2 +- ports/cocos2d/portfile.cmake | 4 ++-- ports/curl/portfile.cmake | 2 +- ports/doctest/portfile.cmake | 2 +- ports/eigen3/portfile.cmake | 2 +- ports/expat/portfile.cmake | 2 +- ports/fmt/portfile.cmake | 2 +- ports/freetype/portfile.cmake | 2 +- ports/glew/portfile.cmake | 2 +- ports/glfw3/portfile.cmake | 2 +- ports/glm/portfile.cmake | 2 +- ports/gsl/portfile.cmake | 2 +- ports/libjpeg-turbo/portfile.cmake | 2 +- ports/libpng/portfile.cmake | 2 +- ports/libuv/portfile.cmake | 2 +- ports/libwebsockets/portfile.cmake | 2 +- ports/mpg123/portfile.cmake | 2 +- ports/mpir/portfile.cmake | 2 +- ports/openal-soft/portfile.cmake | 2 +- ports/openssl/portfile.cmake | 2 +- ports/range-v3/portfile.cmake | 2 +- ports/rapidjson/portfile.cmake | 2 +- ports/rapidxml/portfile.cmake | 2 +- ports/sdl2/portfile.cmake | 2 +- ports/sery/portfile.cmake | 2 +- ports/sqlite3/portfile.cmake | 2 +- ports/stb/portfile.cmake | 2 +- ports/tcl/portfile.cmake | 2 +- ports/tiff/portfile.cmake | 2 +- ports/tinyxml2/portfile.cmake | 2 +- ports/tk/portfile.cmake | 2 +- ports/zlib/portfile.cmake | 2 +- scripts/cmake/vcpkg_download_distfile.cmake | 9 ++++----- 33 files changed, 37 insertions(+), 38 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 89839d5498..e5ee25073d 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2" + URLS "http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2" FILENAME "boost_1_61_0.tar.bz2" SHA512 a1c7338e2d2dbac8552ede7c554640d22cbb2fda7fbc325dc3cdcb51e769713626695426ffc158cbe0e1729dd9a7b5ad18af4800d74e24539e8d8564268c2b9d ) diff --git a/ports/cocos2d/portfile.cmake b/ports/cocos2d/portfile.cmake index b39180b400..6359055f10 100644 --- a/ports/cocos2d/portfile.cmake +++ b/ports/cocos2d/portfile.cmake @@ -1,11 +1,11 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "https://github.com/cocos2d/cocos2d-x/archive/cocos2d-x-3.10.tar.gz" + URLS "https://github.com/cocos2d/cocos2d-x/archive/cocos2d-x-3.10.tar.gz" FILENAME "cocos2d-x-3.10.tar.gz" MD5 7c67068675ad28374448e844b0e463ff ) vcpkg_download_distfile(DEPS_ARCHIVE_FILE - URL "https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/archive/v3-deps-79.zip" + URLS "https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/archive/v3-deps-79.zip" FILENAME "cocos2d-x-v3-deps-79.zip" MD5 5d88ff867205080b9ee8da532437e891 ) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index a4ea250c0e..168d5f0ff1 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "https://curl.haxx.se/download/curl-7.48.0.tar.bz2" + URLS "https://curl.haxx.se/download/curl-7.48.0.tar.bz2" FILENAME "curl-7.48.0.tar.bz2" SHA512 9bb554eaf4ccaced0fa9b38de4f381eab84b96c1aa07a45d83ddfd38a925044d0fe9fac517263f67f009d2294a31c33dedb2267defbab0cb14f96091bbed5f92 ) diff --git a/ports/doctest/portfile.cmake b/ports/doctest/portfile.cmake index 46a3abe715..54228c7160 100644 --- a/ports/doctest/portfile.cmake +++ b/ports/doctest/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/onqtam/doctest/archive/1.1.0.zip" + URLS "https://github.com/onqtam/doctest/archive/1.1.0.zip" FILENAME "doctest-1.1.0.zip" SHA512 3cbdbb82d2dceff5a34aaed45222832c5767f21b64b271c41c2da7bae1f9e364a60758a8b6ce64285999afc30dd76de980e287663fa3119d0bcc1d2b45514e0b ) diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index 921058803e..763143a05d 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://bitbucket.org/eigen/eigen/get/3.2.9.tar.bz2" + URLS "http://bitbucket.org/eigen/eigen/get/3.2.9.tar.bz2" FILENAME "eigen-3.2.9.tar.bz2" SHA512 2734ce70e0b04dc5839715a3cc9b8f90e05b341cfca42a7d586df213a9a14fe5642c76ccf36c16d020ae167c0d6e4d5cc306f0b3bf1f519c58372b0736ca7e63 ) diff --git a/ports/expat/portfile.cmake b/ports/expat/portfile.cmake index e0f0d06e01..ea0f0f723d 100644 --- a/ports/expat/portfile.cmake +++ b/ports/expat/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "http://downloads.sourceforge.net/project/expat/expat/2.1.1/expat-2.1.1.tar.bz2" + URLS "http://downloads.sourceforge.net/project/expat/expat/2.1.1/expat-2.1.1.tar.bz2" FILENAME "expat-2.1.1.tar.bz2" SHA512 088e2ef3434f2affd4fc79fe46f0e9826b9b4c3931ddc780cd18892f1cd1e11365169c6807f45916a56bb6abcc627dcd17a23f970be0bf464f048f5be2713628 ) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 74cdd60bee..49a0f3ef54 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "https://github.com/fmtlib/fmt/archive/3.0.0.tar.gz" + URLS "https://github.com/fmtlib/fmt/archive/3.0.0.tar.gz" FILENAME "fmt-3.0.0.tar.gz" SHA512 20c9b1ffe8b46cb5d22015122fc698a75ad854709d3de1a1316b6040d86f54bada4e6d7263f2f1fd94cb13ac37ee9447c162c6aec3f3af650455e8a8a9804871 ) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 750f1a9e45..c618cb23a6 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://download.savannah.gnu.org/releases/freetype/freetype-2.6.3.tar.bz2" + URLS "http://download.savannah.gnu.org/releases/freetype/freetype-2.6.3.tar.bz2" FILENAME "freetype-2.6.3.tar.bz2" SHA512 e1f9018835fc88beeb4479537b59f866c52393ae18d24a1e0710a464cf948ab02b35c2c6043bc20c1db3a04871ee4eb0bb1d210550c0ea2780c8b1aea98fbf0d ) diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 273d7041b7..cd7bbdf9df 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "http://downloads.sourceforge.net/project/glew/glew/1.13.0/glew-1.13.0.tgz" + URLS "http://downloads.sourceforge.net/project/glew/glew/1.13.0/glew-1.13.0.tgz" FILENAME "glew-1.13.0.tgz" SHA512 8fc8d7c0d2cd9235ea51db9972f492701827bff40642fdb3cc54c10b0737dba8e6d8d0dcd8c5aa5bfaaae39c6198ba3d4292cd1662fbe1977eb9a5d187ba635f ) diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index 25438b4200..6d14c34fe6 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/glfw/glfw/releases/download/3.1.2/glfw-3.1.2.zip" + URLS "https://github.com/glfw/glfw/releases/download/3.1.2/glfw-3.1.2.zip" FILENAME "glfw-3.1.2.zip" SHA512 c199137b32182182123869fe69ab991a296feb80dcf3db3cf5e070cdaef31ed958148d9b87e724c1937fa535960122bdceb92ea9dd38f7ef41e4e08e36210fe5 ) diff --git a/ports/glm/portfile.cmake b/ports/glm/portfile.cmake index 63540f95d8..7153101499 100644 --- a/ports/glm/portfile.cmake +++ b/ports/glm/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/g-truc/glm/releases/download/0.9.8.0/glm-0.9.8.0.zip" + URLS "https://github.com/g-truc/glm/releases/download/0.9.8.0/glm-0.9.8.0.zip" FILENAME "glm-0.9.8.0.zip" SHA512 5fe9d1f582e7bbef37fd23c9d10fd9cf7696bb7c6f8086a250248e97f84b0205a89a195c8838a1ddc4c0a4cb4c69d1764f90db6513a9691a94877b7ec6b2befb ) diff --git a/ports/gsl/portfile.cmake b/ports/gsl/portfile.cmake index 53d5556d69..4c7e9f051b 100644 --- a/ports/gsl/portfile.cmake +++ b/ports/gsl/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/Microsoft/GSL/archive/fd5ad87bf25cb5e87104ee58106dee9bc809cd93.zip" + URLS "https://github.com/Microsoft/GSL/archive/fd5ad87bf25cb5e87104ee58106dee9bc809cd93.zip" FILENAME "gsl-fd5ad87bf.zip" SHA512 81887be57e12bfc4e67353713478e1638bf1bffb8f523cf7241acf5415c2e3fe82ea0c0128380dcb2008afb5f53ac0d4893660626a8cd1eb501da536e6af5692 ) diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index 46670d2779..a6227ddd62 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-1.4.90) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.4.90.zip" + URLS "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.4.90.zip" FILENAME "libjpeg-turbo-1.4.90.zip" SHA512 43c3d26c70a7356bb0832276fe82eead040c3f4aa17df118f91a38615bfacfdfb25fab41965f9ca2b69d18e0b937a1bb753e93fa2c114e01d5174fc1100010b4 ) diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index f376201f2c..482b72bad7 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24) vcpkg_download_distfile(ARCHIVE - URL "http://download.sourceforge.net/libpng/libpng-1.6.24.tar.xz" + URLS "http://download.sourceforge.net/libpng/libpng-1.6.24.tar.xz" FILENAME "libpng-1.6.24.tar.xz" SHA512 7eccb90f530a9c728e280b2b1776304a808b5deea559632e7bcf4ea219c7cb5e453aa810215465304501127595000717d4b7c5b26a9f8e22e236ec04af53a90f ) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index 480856cfba..2e0002b4e7 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/libuv/libuv/archive/v1.9.1.zip" + URLS "https://github.com/libuv/libuv/archive/v1.9.1.zip" FILENAME "libuv-v1.9.1.zip" SHA512 3eb8711e3612fb3f5a1ddeb4614b2bec29c022ac5c6c2590bc5239825d758a73be0819c52747956a029859ef4e416bf3fce16665bac2c6c4890f736b47c38226 ) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index ba95019e38..7b8a2c9186 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/warmcat/libwebsockets/archive/v2.0.0.zip" + URLS "https://github.com/warmcat/libwebsockets/archive/v2.0.0.zip" FILENAME "libwebsockets-v2.0.0.zip" SHA512 bf57a46f2c60095e7e6ec6656b185ffd2cf8f553bc22255ae8f6825d3613316d794f139cdefacbdf60ef997b0cd675fe356813d406c9b7c5a5ae838ce5326042 ) diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index f92b268250..ac2e7e7ca8 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://downloads.sourceforge.net/project/mpg123/mpg123/1.23.3/mpg123-1.23.3.tar.bz2" + URLS "http://downloads.sourceforge.net/project/mpg123/mpg123/1.23.3/mpg123-1.23.3.tar.bz2" FILENAME "mpg123-1.23.3.tar.bz2" SHA512 a5ebfb36223a3966386bc8e5769b8543861872d20f9de037d07857e857000f20e198e0b1db04bdc56b18b19d5b4027d8261a104af0216d6ea45274b21a18dda4 ) diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 7e9103ec7a..ff1489291e 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "http://mpir.org/mpir-2.7.2.tar.lz" + URLS "http://mpir.org/mpir-2.7.2.tar.lz" FILENAME "mpir-2.7.2.tar.lz" SHA512 2635c167ddbba99364ec741373768e0675d34f94fad8912d5433b95e6fbfdb0510f5e94a707acc42048254bc658c52c6671bb0c0dac31267c4b82b00c3e74efa ) diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 22129cc87f..d80bc373c3 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://openal-soft.org/openal-releases/openal-soft-1.17.2.tar.bz2" + URLS "http://openal-soft.org/openal-releases/openal-soft-1.17.2.tar.bz2" FILENAME "openal-soft-1.17.2.tar.bz2" MD5 1764e0d8fec499589b47ebc724e0913d SHA512 50c20cd3ddada55d91643a79c2894d5a14315d5fc1ed8e870e3d8d3f410e8b7d8da29b838226e7fce37fbeca719ff919b51806f72e4cd529a18fbe8bd68860e3 diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 0d017bdfc0..345ec8e3b4 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -6,7 +6,7 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE - URL "https://www.openssl.org/source/openssl-1.0.2h.tar.gz" + URLS "https://www.openssl.org/source/openssl-1.0.2h.tar.gz" FILENAME "openssl-1.0.2h.tar.gz" SHA512 780601f6f3f32f42b6d7bbc4c593db39a3575f9db80294a10a68b2b0bb79448d9bd529ca700b9977354cbdfc65887c76af0aa7b90d3ee421f74ab53e6f15c303 ) diff --git a/ports/range-v3/portfile.cmake b/ports/range-v3/portfile.cmake index 66a908362d..4f547c2c81 100644 --- a/ports/range-v3/portfile.cmake +++ b/ports/range-v3/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/Microsoft/Range-V3-VS2015/archive/ede9ad367fd5ec764fecb039c874614bd908e6b6.zip" + URLS "https://github.com/Microsoft/Range-V3-VS2015/archive/ede9ad367fd5ec764fecb039c874614bd908e6b6.zip" FILENAME "range-v3-ede9ad367fd5ec764fecb039c874614bd908e6b6.zip" SHA512 e978c7694471d8616c248647b77689f377b3e2517347abde8629b140e5994de8bf686565a24cdd7dd222f325d43b775f5e478c91220dce75313985499b134637 ) diff --git a/ports/rapidjson/portfile.cmake b/ports/rapidjson/portfile.cmake index 3440428f06..53008daea0 100644 --- a/ports/rapidjson/portfile.cmake +++ b/ports/rapidjson/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/miloyip/rapidjson/archive/879def80f2e466cdf4c86dc7e53ea2dd4cafaea0.zip" + URLS "https://github.com/miloyip/rapidjson/archive/879def80f2e466cdf4c86dc7e53ea2dd4cafaea0.zip" FILENAME "rapidjson-879def80f2e466cdf4c86dc7e53ea2dd4cafaea0.zip" SHA512 4d9ef7cce7d179344c33245c081a142ca5fcb2a0cc170ed39e3d0add008efab8e7389feec03e1ea83b30c5778cd0600865b08bc1c23592e5154dbe1f21f9547d ) diff --git a/ports/rapidxml/portfile.cmake b/ports/rapidxml/portfile.cmake index 7cd885b7d3..9551e17a52 100644 --- a/ports/rapidxml/portfile.cmake +++ b/ports/rapidxml/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" + URLS "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" FILENAME "rapidxml-1.13.zip" SHA512 6c10583e6631ccdb0217d0a5381172cb4c1046226de6ef1acf398d85e81d145228e14c3016aefcd7b70a1db8631505b048d8b4f5d4b0dbf1811d2482eefdd265 ) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 69c6d36725..0f04091604 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "http://libsdl.org/release/SDL2-2.0.4.tar.gz" + URLS "http://libsdl.org/release/SDL2-2.0.4.tar.gz" FILENAME "SDL2-2.0.4.tar.gz" SHA512 dd0a95878639856c0f4b8a579ace8071379ab64519fa139b22d3ed857a0f0db87a75bc8480c7207e02fbffd1fdbd448e3c0b882c451675b0e2f1a945af02e1d6 ) diff --git a/ports/sery/portfile.cmake b/ports/sery/portfile.cmake index 34ddb02481..94a236b85f 100644 --- a/ports/sery/portfile.cmake +++ b/ports/sery/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/Ninetainedo/Sery/archive/v1.0.zip" + URLS "https://github.com/Ninetainedo/Sery/archive/v1.0.zip" FILENAME "sery-1.0.0.zip" SHA512 15ef97bf094e8931049d8dd667a778e23847555f0f8d5b949b250e26edcc2541744fac5c34d935880d070546777fa787b1baf018d8ca2240fcd18a820aded04f ) diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 9cdb67bb65..75dfc73b5b 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://www.sqlite.org/2016/sqlite-amalgamation-3120200.zip" + URLS "http://www.sqlite.org/2016/sqlite-amalgamation-3120200.zip" FILENAME "sqlite-amalgamation-3120200.zip" SHA512 92e1cc09dc4d4e9dd4c189e4a5061664f11971eb3e14c4c59e1f489f201411b08a31dae9e6fc50fffd49bb72f88ac3d99b7c7cd5e334b3079c165ee1c4f5a16e ) diff --git a/ports/stb/portfile.cmake b/ports/stb/portfile.cmake index dace9acd9b..15414d0da7 100644 --- a/ports/stb/portfile.cmake +++ b/ports/stb/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/nothings/stb/archive/e713a69f1ea6ee1e0d55725ed0731520045a5993.zip" + URLS "https://github.com/nothings/stb/archive/e713a69f1ea6ee1e0d55725ed0731520045a5993.zip" FILENAME "stb-e713a69f1ea6ee1e0d55725ed0731520045a5993.zip" SHA512 28d73905e626bf286bc42e30bc50e8449912a9db5e421e09bfbd17790de1909fe9df19c96d6ad3125a6ae0947d45b11b83ee5965dab68d1eadd0c332e391400e ) diff --git a/ports/tcl/portfile.cmake b/ports/tcl/portfile.cmake index 16f9abdbd0..d8b19097a4 100644 --- a/ports/tcl/portfile.cmake +++ b/ports/tcl/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz" + URLS "http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz" FILENAME "tcl8.6.5-src.tar.gz" MD5 0e6426a4ca9401825fbc6ecf3d89a326 ) diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index e6d8d9cc66..ef770a2c51 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz" + URLS "http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz" FILENAME "tiff-4.0.6.tar.gz" SHA512 2c8dbaaaab9f82a7722bfe8cb6fcfcf67472beb692f1b7dafaf322759e7016dad1bc58457c0f03db50aa5bd088fef2b37358fcbc1524e20e9e14a9620373fdf8 ) diff --git a/ports/tinyxml2/portfile.cmake b/ports/tinyxml2/portfile.cmake index 4611ee94cf..3e29b857c9 100644 --- a/ports/tinyxml2/portfile.cmake +++ b/ports/tinyxml2/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "https://github.com/leethomason/tinyxml2/archive/3.0.0.zip" + URLS "https://github.com/leethomason/tinyxml2/archive/3.0.0.zip" FILENAME "tinyxml2-3.0.0.zip" SHA512 3581e086e41ea01418fdf74e53b932c41cada9a45b73fb71c15424672182dc2a1e55110f030962ae44df6f5d9f060478c5b04373f886da843a78fcabae8b063c ) diff --git a/ports/tk/portfile.cmake b/ports/tk/portfile.cmake index 8b5f1f36ed..0391b0b30a 100644 --- a/ports/tk/portfile.cmake +++ b/ports/tk/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "http://prdownloads.sourceforge.net/tcl/tk8.6.5-src.tar.gz" + URLS "http://prdownloads.sourceforge.net/tcl/tk8.6.5-src.tar.gz" FILENAME "tk8.6.5-src.tar.gz" MD5 11dbbd425c3e0201f20d6a51482ce6c4 ) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 461304ffea..82c5cadedf 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URL "http://zlib.net/zlib128.zip" + URLS "http://zlib.net/zlib128.zip" FILENAME "zlib128.zip" SHA512 b0d7e71eca9032910c56fc1de6adbdc4f915bdeafd9a114591fc05701893004ef3363add8ad0e576c956b6be158f2fc339ab393f2dd40e8cc8c2885d641d807b ) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index a394642a2f..602790190e 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -1,7 +1,7 @@ -# Usage: vcpkg_download_distfile( URL FILENAME SHA512 <5981de...> MIRRORS ) +# Usage: vcpkg_download_distfile( URLS FILENAME SHA512 <5981de...>) function(vcpkg_download_distfile VAR) - set(oneValueArgs URL FILENAME SHA512) - set(multipleValuesArgs MIRRORS) + set(oneValueArgs FILENAME SHA512) + set(multipleValuesArgs URLS) cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) @@ -18,8 +18,7 @@ function(vcpkg_download_distfile VAR) endif() else() # Tries to download the file. - list(INSERT vcpkg_download_distfile_MIRRORS 0 ${vcpkg_download_distfile_URL}) - foreach(url IN LISTS vcpkg_download_distfile_MIRRORS) + foreach(url IN LISTS vcpkg_download_distfile_URLS) message(STATUS "Downloading ${url}...") file(DOWNLOAD ${url} ${downloaded_file_path} STATUS download_status) list(GET download_status 0 status_code) From 62d9473412bff2203f1e0aaa63c9e5dc67b364b2 Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sun, 25 Sep 2016 00:24:38 +0200 Subject: [PATCH 4/8] Added spaces between brackets for double clicking --- scripts/cmake/vcpkg_download_distfile.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 602790190e..0429bf853f 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -11,9 +11,9 @@ function(vcpkg_download_distfile VAR) if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") message(FATAL_ERROR "\nFile does not have expected hash:\n" - " File path: [${downloaded_file_path}]\n" - " Expected hash: [${vcpkg_download_distfile_SHA512}]\n" - " Actual hash: [${FILE_HASH}]\n" + " File path: [ ${downloaded_file_path} ]\n" + " Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n" + " Actual hash: [ ${FILE_HASH} ]\n" "Please delete the file and try again if this file should be downloaded again.\n") endif() else() @@ -44,9 +44,9 @@ function(vcpkg_download_distfile VAR) if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") message(FATAL_ERROR "\nFile does not have expected hash:\n" - " File path: [${downloaded_file_path}]\n" - " Expected hash: [${vcpkg_download_distfile_SHA512}]\n" - " Actual hash: [${FILE_HASH}]\n" + " File path: [ ${downloaded_file_path} ]\n" + " Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n" + " Actual hash: [ ${FILE_HASH} ]\n" "The file may be corrupted.\n") endif() message(STATUS "Testing integrity of downloaded file... OK") From 51da39c1ed3debfe1a4fb45eaa65b181555da841 Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sun, 25 Sep 2016 00:25:40 +0200 Subject: [PATCH 5/8] Display status on download error --- scripts/cmake/vcpkg_download_distfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 0429bf853f..4d60191609 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -23,7 +23,7 @@ function(vcpkg_download_distfile VAR) file(DOWNLOAD ${url} ${downloaded_file_path} STATUS download_status) list(GET download_status 0 status_code) if (NOT "${status_code}" STREQUAL "0") - message(STATUS "Downloading ${url}... Failed") + message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") file(REMOVE ${downloaded_file_path}) set(download_success 0) else() From c55c9df2285f0c66f054cb4591248501ba3e70fd Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sun, 25 Sep 2016 00:26:05 +0200 Subject: [PATCH 6/8] Link to "issues" instead of "new issue" --- scripts/cmake/vcpkg_download_distfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 4d60191609..a2f13cd42f 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -37,7 +37,7 @@ function(vcpkg_download_distfile VAR) message(FATAL_ERROR "\n" " Failed to download file.\n" - " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues/new\n") + " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") else() message(STATUS "Testing integrity of downloaded file...") file(SHA512 ${downloaded_file_path} FILE_HASH) From 586c96e1b13c1bd4f7b5db483568cc5743a7a519 Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sun, 25 Sep 2016 00:36:50 +0200 Subject: [PATCH 7/8] Used a function to check file integrity --- scripts/cmake/vcpkg_download_distfile.cmake | 26 +++++++++------------ 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index a2f13cd42f..44b5625736 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -3,10 +3,10 @@ function(vcpkg_download_distfile VAR) set(oneValueArgs FILENAME SHA512) set(multipleValuesArgs URLS) cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) - set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) - if(EXISTS ${downloaded_file_path}) - message(STATUS "Using cached ${downloaded_file_path}") + + function(test_hash FILE_KIND CUSTOM_ERROR_ADVICE) + message(STATUS "Testing integrity of ${FILE_KIND}...") file(SHA512 ${downloaded_file_path} FILE_HASH) if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") message(FATAL_ERROR @@ -14,8 +14,14 @@ function(vcpkg_download_distfile VAR) " File path: [ ${downloaded_file_path} ]\n" " Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n" " Actual hash: [ ${FILE_HASH} ]\n" - "Please delete the file and try again if this file should be downloaded again.\n") + "${CUSTOM_ERROR_ADVICE}\n") endif() + message(STATUS "Testing integrity of ${FILE_KIND}... OK") + endfunction() + + if(EXISTS ${downloaded_file_path}) + message(STATUS "Using cached ${downloaded_file_path}") + test_hash("cached file" "Please delete the file and retry if this file should be downloaded again.") else() # Tries to download the file. foreach(url IN LISTS vcpkg_download_distfile_URLS) @@ -39,17 +45,7 @@ function(vcpkg_download_distfile VAR) " Failed to download file.\n" " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") else() - message(STATUS "Testing integrity of downloaded file...") - file(SHA512 ${downloaded_file_path} FILE_HASH) - if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") - message(FATAL_ERROR - "\nFile does not have expected hash:\n" - " File path: [ ${downloaded_file_path} ]\n" - " Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n" - " Actual hash: [ ${FILE_HASH} ]\n" - "The file may be corrupted.\n") - endif() - message(STATUS "Testing integrity of downloaded file... OK") + test_hash("downloaded file" "The file may be corrupted.") endif() endif() set(${VAR} ${downloaded_file_path} PARENT_SCOPE) From 2491a16b0dd4bb88d48cd582e12e953c50a24b10 Mon Sep 17 00:00:00 2001 From: Ninetainedo Date: Sun, 25 Sep 2016 14:46:43 +0200 Subject: [PATCH 8/8] Updated portfile.in.cmake to use URLS --- scripts/templates/portfile.in.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index 99a3ac3e8e..f74c89aca4 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE - URL "@URL@" + URLS "@URL@" FILENAME "@FILENAME@" SHA512 @SHA512@ )