aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_from_github.cmake1
-rw-r--r--scripts/cmake/vcpkg_from_gitlab.cmake14
2 files changed, 13 insertions, 2 deletions
diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake
index f52538c8e..1c1b71679 100644
--- a/scripts/cmake/vcpkg_from_github.cmake
+++ b/scripts/cmake/vcpkg_from_github.cmake
@@ -14,6 +14,7 @@ vcpkg_from_github(
[PATCHES <patch1.patch> <patch2.patch>...]
[GITHUB_HOST <https://github.com>]
[AUTHORIZATION_TOKEN <${SECRET_FROM_FILE}>]
+ [FILE_DISAMBIGUATOR <N>]
)
```
diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake
index 354ff85b9..865c5326e 100644
--- a/scripts/cmake/vcpkg_from_gitlab.cmake
+++ b/scripts/cmake/vcpkg_from_gitlab.cmake
@@ -13,6 +13,7 @@ vcpkg_from_gitlab(
[SHA512 <45d0d7f8cc350...>]
[HEAD_REF <master>]
[PATCHES <patch1.patch> <patch2.patch>...]
+ [FILE_DISAMBIGUATOR <N>]
)
```
@@ -52,6 +53,9 @@ A list of patches to be applied to the extracted sources.
Relative paths are based on the port directory.
+### FILE_DISAMBIGUATOR
+A token to uniquely identify the resulting filename if the SHA512 changes even though a git ref does not, to avoid stepping on the same file name.
+
## Notes:
At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present.
@@ -66,7 +70,7 @@ This exports the `VCPKG_HEAD_VERSION` variable during head builds.
include(vcpkg_execute_in_download_mode)
function(vcpkg_from_gitlab)
- set(oneValueArgs OUT_SOURCE_PATH GITLAB_URL USER REPO REF SHA512 HEAD_REF)
+ set(oneValueArgs OUT_SOURCE_PATH GITLAB_URL USER REPO REF SHA512 HEAD_REF FILE_DISAMBIGUATOR)
set(multipleValuesArgs PATCHES)
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
cmake_parse_arguments(PARSE_ARGV 0 _vdud "" "${oneValueArgs}" "${multipleValuesArgs}")
@@ -119,11 +123,17 @@ function(vcpkg_from_gitlab)
endif()
string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}")
+ set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}")
+ if (_vdud_FILE_DISAMBIGUATOR)
+ set(downloaded_file_name "${downloaded_file_name}-${_vdud_FILE_DISAMBIGUATOR}")
+ endif()
+
+ set(downloaded_file_name "${downloaded_file_name}.tar.gz")
vcpkg_download_distfile(ARCHIVE
URLS "${GITLAB_LINK}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz"
SHA512 "${_vdud_SHA512}"
- FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz"
+ FILENAME "${downloaded_file_name}"
)
vcpkg_extract_source_archive_ex(