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