Merge branch 'Add-mirror-support' of https://github.com/Ninetainedo/vcpkg into Ninetainedo-Add-mirror-support

This commit is contained in:
Alexander Karatarakis 2016-09-26 13:47:52 -07:00
commit 7147ef13eb
34 changed files with 79 additions and 47 deletions

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -1,20 +1,52 @@
# Usage: vcpkg_download_distfile(<VAR> URL <http://...> FILENAME <output.zip> SHA512 <5981de...>)
# Usage: vcpkg_download_distfile(<VAR> URLS <http://mainUrl> <http://mirror1> <http://mirror2> FILENAME <output.zip> SHA512 <5981de...>)
function(vcpkg_download_distfile VAR)
set(oneValueArgs URL FILENAME SHA512)
cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "" ${ARGN})
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 ${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}")
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
"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"
"${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()
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.
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)
if (NOT "${status_code}" STREQUAL "0")
message(STATUS "Downloading ${url}... Failed. Status: ${download_status}")
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\n")
else()
test_hash("downloaded file" "The file may be corrupted.")
endif()
endif()
set(${VAR} ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME} PARENT_SCOPE)
set(${VAR} ${downloaded_file_path} PARENT_SCOPE)
endfunction()

View File

@ -1,6 +1,6 @@
include(vcpkg_common_functions)
vcpkg_download_distfile(ARCHIVE
URL "@URL@"
URLS "@URL@"
FILENAME "@FILENAME@"
SHA512 @SHA512@
)