Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scripts-audit] vcpkg_from_* #18272

Closed
wants to merge 13 commits into from
6 changes: 6 additions & 0 deletions docs/maintainers/vcpkg_download_distfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ vcpkg_download_distfile(
URLS <http://mainUrl> <http://mirror1>...
FILENAME <output.zip>
SHA512 <5981de...>
[ALWAYS_REDOWNLOAD]
)
```
## Parameters
Expand All @@ -38,6 +39,11 @@ Skip SHA512 hash check for file.

This switch is only valid when building with the `--head` command line flag.

### ALWAYS_REDOWNLOAD
Avoid caching; this is a REST call or otherwise unstable.

Requires `SKIP_SHA512`.

### HEADERS
A list of headers to append to the download request. This can be used for authentication during a download.

Expand Down
1 change: 0 additions & 1 deletion docs/maintainers/vcpkg_from_bitbucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_from_bitbucket.md).

Download and extract a project from Bitbucket.
Enables support for installing HEAD `vcpkg.exe install --head <port>`.

## Usage:
```cmake
Expand Down
8 changes: 1 addition & 7 deletions docs/maintainers/vcpkg_from_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vcpkg_from_git(
OUT_SOURCE_PATH <SOURCE_PATH>
URL <https://android.googlesource.com/platform/external/fdlibm>
REF <59f7335e4d...>
[TAG <v1.0.2>]
[HEAD_REF <ref>]
[PATCHES <patch1.patch> <patch2.patch>...]
)
```
Expand All @@ -27,17 +27,11 @@ The url of the git repository.
### REF
The git sha of the commit to download.

### TAG
An optional git tag to be verified against the `REF`. If the remote repository's tag does not match the specified `REF`, the build will fail.

### PATCHES
A list of patches to be applied to the extracted sources.

Relative paths are based on the port directory.

### X_OUT_REF (internal only)
This parameter is used for automatic REF updates for certain ports in the central vcpkg catalog. It should not be used by any ports outside the central catalog and within the central catalog it should not be used on any user path. This parameter may change behavior incompatibly or be removed at any time.

## Notes:
`OUT_SOURCE_PATH`, `REF`, and `URL` must be specified.

Expand Down
7 changes: 4 additions & 3 deletions docs/maintainers/vcpkg_from_sourceforge.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The latest version of this document lives in the [vcpkg repo](https://github.com

Download and extract a project from sourceforge.

This function automatically checks a set of sourceforge mirrors.
Additional mirrors can be injected through the `VCPKG_SOURCEFORGE_EXTRA_MIRRORS`
list variable in the triplet.

## Usage:
```cmake
vcpkg_from_sourceforge(
Expand Down Expand Up @@ -54,9 +58,6 @@ A list of patches to be applied to the extracted sources.

Relative paths are based on the port directory.

### DISABLE_SSL
Disable ssl when downloading source.

### NO_REMOVE_ONE_LEVEL
Specifies that the default removal of the top level folder should not occur.

Expand Down
3 changes: 2 additions & 1 deletion docs/regenerate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function ParseCmakeDocComment
$Docs.HasError = $True
}

if ($contents.Length -ne 0)
if ($null -eq $contents -or $contents.Length -ne 0)
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
{
$Docs.ActualDocumentation = $contents
}
Expand Down Expand Up @@ -311,6 +311,7 @@ function GetDeprecationMessage
Param(
[CMakeDocumentation]$Doc
)
$message = ''
if ($Doc.IsDeprecated)
{
$message = " (deprecated"
Expand Down
4 changes: 0 additions & 4 deletions ports/qt5-mqtt/CONTROL

This file was deleted.

9 changes: 4 additions & 5 deletions ports/qt5-mqtt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake)
#qt_submodule_installation() No binary package for this port.
if(QT_UPDATE_VERSION)
set(UPDATE_PORT_GIT_OPTIONS X_OUT_REF NEW_REF) # TO get an SHA512 error if the variable is set.
set(VCPKG_USE_HEAD_VERSION ON)
endif()

vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL git://code.qt.io/qt/qtmqtt.git
TAG v${QT_MAJOR_MINOR_VER}.${QT_PATCH_VER}
REF ${QT_HASH_${PORT}}
${UPDATE_PORT_GIT_OPTIONS}
HEAD_REF "v${QT_MAJOR_MINOR_VER}.${QT_PATCH_VER}"
PATCHES ${_qis_PATCHES}
)

if(NEW_REF)
message(STATUS "New qtmqtt ref: ${NEW_REF}")
if(QT_UPDATE_VERSION)
message(STATUS "New qtmqtt ref: ${VCPKG_HEAD_VERSION}")
endif()

# qt module builds from a git repository require a .git entry to invoke syncqt
Expand Down
12 changes: 12 additions & 0 deletions ports/qt5-mqtt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "qt5-mqtt",
"version": "5.15.2",
"port-version": 1,
"description": "Qt5 MQTT module.",
"dependencies": [
{
"name": "qt5-base",
"default-features": false
}
]
}
15 changes: 13 additions & 2 deletions scripts/cmake/vcpkg_download_distfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vcpkg_download_distfile(
URLS <http://mainUrl> <http://mirror1>...
FILENAME <output.zip>
SHA512 <5981de...>
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
[ALWAYS_REDOWNLOAD]
)
```
## Parameters
Expand All @@ -37,6 +38,11 @@ Skip SHA512 hash check for file.

This switch is only valid when building with the `--head` command line flag.

### ALWAYS_REDOWNLOAD
ras0219-msft marked this conversation as resolved.
Show resolved Hide resolved
Avoid caching; this is a REST call or otherwise unstable.

Requires `SKIP_SHA512`.

### HEADERS
A list of headers to append to the download request. This can be used for authentication during a download.

Expand All @@ -55,7 +61,7 @@ The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downlo
include(vcpkg_execute_in_download_mode)

function(vcpkg_download_distfile VAR)
set(options SKIP_SHA512 SILENT_EXIT QUIET)
set(options SKIP_SHA512 SILENT_EXIT QUIET ALWAYS_REDOWNLOAD)
set(oneValueArgs FILENAME SHA512)
set(multipleValuesArgs URLS HEADERS)
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
Expand All @@ -70,6 +76,9 @@ function(vcpkg_download_distfile VAR)
if(vcpkg_download_distfile_SILENT_EXIT)
message(WARNING "SILENT_EXIT has been deprecated as an argument to vcpkg_download_distfile -- remove the argument to resolve this warning")
endif()
if(vcpkg_download_distfile_ALWAYS_REDOWNLOAD AND NOT vcpkg_download_distfile_SKIP_SHA512)
message(FATAL_ERROR "ALWAYS_REDOWNLOAD option requires SKIP_SHA512 as well")
endif()
if(_VCPKG_INTERNAL_NO_HASH_CHECK)
set(vcpkg_download_distfile_SKIP_SHA512 1)
else()
Expand Down Expand Up @@ -125,7 +134,9 @@ function(vcpkg_download_distfile VAR)
endif()
endfunction()

if(EXISTS "${downloaded_file_path}")
# vcpkg_download_distfile_ALWAYS_REDOWNLOAD only triggers when NOT _VCPKG_NO_DOWNLOADS
# this could be de-morgan'd out but it's more clear this way
if(EXISTS "${downloaded_file_path}" AND NOT (vcpkg_download_distfile_ALWAYS_REDOWNLOAD AND NOT _VCPKG_NO_DOWNLOADS))
if(NOT vcpkg_download_distfile_QUIET)
message(STATUS "Using ${downloaded_file_path}")
endif()
Expand Down
Loading