2018-08-08 19:16:15 +08:00
# vcpkg_from_gitlab
2021-03-11 01:56:07 +08:00
The latest version of this document lives in the [vcpkg repo ](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_from_gitlab.md ).
2021-03-01 05:17:19 +08:00
2018-08-08 19:16:15 +08:00
Download and extract a project from Gitlab instances. Enables support for `install --head` .
## Usage:
```cmake
vcpkg_from_gitlab(
2018-08-08 20:25:20 +08:00
GITLAB_URL < https: / / gitlab . com >
2018-08-08 19:16:15 +08:00
OUT_SOURCE_PATH < SOURCE_PATH >
REPO < gitlab-org / gitlab-ce >
[REF < v10.7.3 > ]
[SHA512 < 45d0d7f8cc350... > ]
[HEAD_REF < master > ]
2018-10-26 03:34:45 +08:00
[PATCHES < patch1.patch > < patch2.patch > ...]
2020-12-04 05:24:26 +08:00
[FILE_DISAMBIGUATOR < N > ]
2018-08-08 19:16:15 +08:00
)
```
## Parameters:
### GITLAB_URL
The URL of the Gitlab instance to use.
### OUT_SOURCE_PATH
Specifies the out-variable that will contain the extracted location.
This should be set to `SOURCE_PATH` by convention.
### REPO
The organization or user plus the repository name on the Gitlab instance.
### REF
A stable git commit-ish (ideally a tag) that will not change contents. **This should not be a branch.**
For repositories without official releases, this can be set to the full commit id of the current latest master.
If `REF` is specified, `SHA512` must also be specified.
### SHA512
The SHA512 hash that should match the archive (${GITLAB_URL}/${REPO}/-/archive/${REF}/${REPO_NAME}-${REF}.tar.gz).
The REPO_NAME variable is parsed from the value of REPO.
2021-07-16 15:17:19 +08:00
This is most easily determined by first setting it to `0` , then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile.
2018-08-08 19:16:15 +08:00
### HEAD_REF
The unstable git commit-ish (ideally a branch) to pull for `--head` builds.
For most projects, this should be `master` . The chosen branch should be one that is expected to be always buildable on all supported platforms.
2018-10-26 03:34:45 +08:00
### PATCHES
A list of patches to be applied to the extracted sources.
Relative paths are based on the port directory.
2020-12-04 05:24:26 +08:00
### 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.
2018-08-08 19:16:15 +08:00
## Notes:
At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present.
This exports the `VCPKG_HEAD_VERSION` variable during head builds.
2019-03-12 08:29:37 +08:00
## Examples:
2019-03-15 04:43:49 +08:00
* [curl][https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75]
* [folly ](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15 )
* [z3 ](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13 )
2019-03-12 08:29:37 +08:00
2018-08-08 19:16:15 +08:00
## Source
2021-03-01 05:17:19 +08:00
[scripts/cmake/vcpkg\_from\_gitlab.cmake ](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_gitlab.cmake )