diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/angle/maintainer-notes.md b/cc-multilingual-main/cc_net/vcpkg/scripts/angle/maintainer-notes.md new file mode 100644 index 0000000000000000000000000000000000000000..16d9367c581e9f9442744641598899f9aa6508df --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/angle/maintainer-notes.md @@ -0,0 +1,32 @@ +# The ANGLE vcpkg port + +The ANGLE port's buildsystem is based off of [WebKit's approach](https://github.com/WebKit/WebKit/tree/main/Source/ThirdParty/ANGLE) to converting ANGLE's buildsystem to CMake. + +Details: + +- `cmake-buildsystem/CMakeLists.txt` + - This is an augmented version of WebKit's [CMakeLists.txt](https://github.com/WebKit/WebKit/blob/main/Source/ThirdParty/ANGLE/CMakeLists.txt), with vcpkg edits and additions. +- `cmake-buildsystem/*.cmake` + - These are configuration files based on [WebKit's approach](https://github.com/WebKit/WebKit/tree/main/Source/ThirdParty/ANGLE), but customized for vcpkg (and using `PlatformLinux` instead of `PlatformGTK`) + + +## Updating the ANGLE vcpkg port + +1. Select a new ANGLE version + +Recommendation: Follow the recommendations in the libANGLE "[Choosing an ANGLE branch](https://github.com/google/angle/blob/master/doc/ChoosingANGLEBranch.md#matching-a-chromium-release-to-an-angle-branch)" guide, and find the branch that matches the current Chromium Stable. + +2. [Find the branch](https://github.com/google/angle/branches) (usually `chromium/`) and latest commit on that branch, and update the following variables in `portfile.cmake`: + - `ANGLE_COMMIT` + - `ANGLE_VERSION` + - `ANGLE_SHA512` + +3. Check the `DEPS` file at that ANGLE commit, for the commit used in `'third_party/zlib'`, and update `ANGLE_THIRDPARTY_ZLIB_COMMIT` in `portfile.cmake` if necessary. + +4. Attempt to build. You may have to tweak the `CMakeLists.txt`, `Platform*.cmake` files, etc. Check with the latest files in [WebKit's repo](https://github.com/WebKit/WebKit/tree/main/Source/ThirdParty/ANGLE) to see if any updates need to be ported to the vcpkg's custom files. You might also need to change the `ANGLE_WEBKIT_BUILDSYSTEM_COMMIT` in the portfile (although this should theoretically need updating less frequently). + +5. Check headers against `opengl-registry` - make sure headers are similar. +> angle defines some additional entrypoints. +> opengl-registry should be latest before updating angle + +6. Complete all the other normal steps in the [Maintainer Guide](/docs/maintainers/maintainer-guide.md) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/android/Dockerfile b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/android/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2a5ff462557bf1c8b45fe081a4f2feda65e72129 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/android/Dockerfile @@ -0,0 +1,66 @@ +# syntax=docker/dockerfile:1.4 +# DisableDockerDetector "Used to build the container deployed to Azure Container Registry" +FROM ubuntu:focal-20240216 + +ADD https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb /packages-microsoft-prod.deb +ADD https://dl.google.com/android/repository/android-ndk-r25c-linux.zip /android-ndk-r25c-linux.zip + +# Add apt packages + +## vcpkg prerequisites +ENV APT_PACKAGES="git curl zip unzip tar" + +## Common build prereqs +ENV APT_PACKAGES="$APT_PACKAGES g++ vim pkg-config cmake ca-certificates" + +ENV APT_PACKAGES="$APT_PACKAGES autoconf nasm bison python2 flex build-essential libtool libtool-bin libltdl-dev gettext automake autoconf-archive" + +## Python related +ENV APT_PACKAGES="$APT_PACKAGES python3-setuptools python3-pip python3-venv python3-mako python3-jinja2" + +## freeglut +ENV APT_PACKAGES="$APT_PACKAGES libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev" + +# glfw3 +ENV APT_PACKAGES="$APT_PACKAGES libxinerama-dev libxcursor-dev" + +# qt5-base +ENV APT_PACKAGES="$APT_PACKAGES libxext-dev libxfixes-dev libxrender-dev \ + libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev \ + libxkbcommon-dev libxcb-keysyms1-dev \ + libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev \ + libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev \ + libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev \ + libxcb-cursor-dev libxkbcommon-x11-dev" + +## PowerShell +ENV APT_PACKAGES="$APT_PACKAGES powershell" + +RUN < /dev/null +apt-get update +apt-get -y --no-install-recommends install docker-ce docker-ce-cli diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/azure-pipelines.yml b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/azure-pipelines.yml new file mode 100644 index 0000000000000000000000000000000000000000..de5d3f1a310585d36c22cb9720d145ccc6ff42fe --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -0,0 +1,83 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +parameters: + - name: vcpkgToolSha + displayName: 'Custom SHA of vcpkg-tool to use rather than bootstrap' + type: string + default: 'use default' + - name: poolName + type: string + - name: tripletPattern + displayName: 'Enable the triplets which contain this substring' + type: string + default: '' + +jobs: +- job: x64_linux + condition: and(succeeded(), contains('^x64-linux$', '${{ parameters.tripletPattern }}')) + pool: + name: ${{ parameters.poolName }} + workspace: + clean: resources + timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: /mnt/vcpkg-ci + - name: VCPKG_DOWNLOADS + value: /mnt/vcpkg-ci/downloads + - group: vcpkg-asset-caching-credentials + - name: X_VCPKG_ASSET_SOURCES + value: "x-azurl,$(root-url-wus3),$(sas-wus3),readwrite" + - group: vcpkg-binary-caching-credentials + - name: X_VCPKG_BINARY_SOURCE_STUB + value: "x-azblob,$(root-bin-url-wus3),$(sas-bin-wus3)" + + steps: + # Note: /mnt is the Azure machines' temporary disk. + - bash: | + sudo mkdir /home/agent -m=777 + sudo chown `id -u` /home/agent + sudo mkdir ${{ variables.WORKING_ROOT }} -m=777 + sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} -m=777 + exit 0 + displayName: 'Create working directories' + - bash: ./bootstrap-vcpkg.sh + displayName: 'Bootstrap vcpkg' + condition: eq('use default', '${{ parameters.vcpkgToolSha }}') + - bash: ./scripts/azure-pipelines/bootstrap-from-source.sh ${{ parameters.vcpkgToolSha }} + displayName: "Build vcpkg with CMake" + condition: ne('use default', '${{ parameters.vcpkgToolSha }}') + - task: PowerShell@2 + displayName: '*** Test Modified Ports' + inputs: + failOnStderr: true + filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' + arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -BinarySourceStub "$(X_VCPKG_BINARY_SOURCE_STUB)" -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory) -IsLinuxHost' + pwsh: true + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: failure logs for x64-linux' + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/failure-logs' + ArtifactName: 'failure logs for x64-linux' + condition: ne(variables['FAILURE_LOGS_EMPTY'], 'True') + - bash: | + python3 scripts/file_script.py /mnt/vcpkg-ci/installed/vcpkg/info/ + displayName: 'Build a file list for all packages' + condition: always() + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: file lists for x64-linux' + condition: always() + inputs: + PathtoPublish: scripts/list_files + ArtifactName: 'file lists for x64-linux' + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: ne(variables['XML_RESULTS_FILE'], '') + inputs: + testRunTitle: x64-linux + testResultsFormat: xUnit + testResultsFiles: $(XML_RESULTS_FILE) + platform: x64-linux + configuration: static diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/changing-linux-packages.md b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/changing-linux-packages.md new file mode 100644 index 0000000000000000000000000000000000000000..f8b5f8265b016fba6a8bdcb37e05a7ad4412358c --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/changing-linux-packages.md @@ -0,0 +1,3 @@ +- [ ] Update `provision-image.sh` to add the new apt package. +- [ ] Update `managed-image.json` to add the new apt package to the very long line of packages. +- [ ] Update the managed image named CPP_GITHUB\PrLin-1ES\PrLin-1ESImage by copying the contents of `managed-image.json` to the Settings\Image text box. diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/managed-image.json b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/managed-image.json new file mode 100644 index 0000000000000000000000000000000000000000..d9075eb08e9e0dccfa41f8b9acb666ca2d066d17 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/managed-image.json @@ -0,0 +1,16 @@ +{ + "artifacts": [ + { + "name": "linux-install-packages", + "parameters": { + "packages": "git curl zip unzip tar at libxt-dev gperf libxaw7-dev cifs-utils build-essential g++ gfortran libx11-dev libxkbcommon-x11-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev libxxf86vm-dev libxcursor-dev yasm libnuma1 libnuma-dev libtool-bin libltdl-dev flex bison libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev xutils-dev dh-autoreconf autoconf-archive libgles2-mesa-dev ruby-full pkg-config meson nasm cmake ninja-build libxext-dev libxfixes-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-dri3-dev libxcb-present-dev libxcb-glx0-dev libxcb-util0-dev libxkbcommon-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libxcb-cursor-dev libkrb5-dev libxcb-res0-dev libxcb-keysyms1-dev libxcb-xkb-dev libxcb-record0-dev python3-setuptools python3-mako python3-pip python3-venv python3-jinja2 nodejs libwayland-dev python-is-python3 guile-2.2-dev libxdamage-dev libdbus-1-dev libxtst-dev haskell-stack golang-go wayland-protocols libbluetooth-dev" + } + }, + { + "name": "linux-ubuntu2204-nvidia-cuda-cudnn" + }, + { + "name": "linux-install-powershell" + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/provision-image.sh b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/provision-image.sh new file mode 100644 index 0000000000000000000000000000000000000000..b2e8d888c961c8531009164efd2d2b777a51dbc1 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/linux/provision-image.sh @@ -0,0 +1,115 @@ +#!/bin/bash +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +export DEBIAN_FRONTEND=noninteractive + +# Add apt repos + +## CUDA +wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin +mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 +apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub +add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" + +## PowerShell +wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb +dpkg -i packages-microsoft-prod.deb +rm -f packages-microsoft-prod.deb +add-apt-repository universe + +apt-get -y update +apt-get -y dist-upgrade + +# Add apt packages + +## vcpkg prerequisites +APT_PACKAGES="git curl zip unzip tar" + +## common build dependencies +APT_PACKAGES="$APT_PACKAGES at libxt-dev gperf libxaw7-dev cifs-utils \ + build-essential g++ gfortran libx11-dev libxkbcommon-x11-dev libxi-dev \ + libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev libxxf86vm-dev \ + libxcursor-dev yasm libnuma1 libnuma-dev libtool-bin libltdl-dev \ + flex bison libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev \ + xutils-dev dh-autoreconf autoconf-archive libgles2-mesa-dev ruby-full \ + pkg-config meson nasm cmake ninja-build" + +## required by qt5-base +APT_PACKAGES="$APT_PACKAGES libxext-dev libxfixes-dev libxrender-dev \ + libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev" + +## required by qt5-base for qt5-x11extras +APT_PACKAGES="$APT_PACKAGES libxkbcommon-dev libxcb-keysyms1-dev \ + libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev \ + libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev \ + libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev" + +## required by xcb feature in qtbase +APT_PACKAGES="$APT_PACKAGES libxcb-cursor-dev" + +## required by libhdfs3 +APT_PACKAGES="$APT_PACKAGES libkrb5-dev" + +## required by kf5windowsystem +APT_PACKAGES="$APT_PACKAGES libxcb-res0-dev" + +## required by kf5globalaccel +APT_PACKAGES="$APT_PACKAGES libxcb-keysyms1-dev libxcb-xkb-dev libxcb-record0-dev" + +## required by mesa +APT_PACKAGES="$APT_PACKAGES python3-setuptools python3-mako libxcb-dri3-dev libxcb-present-dev" + +## required by some packages to install additional python packages +APT_PACKAGES="$APT_PACKAGES python3-pip python3-venv python3-jinja2" + +## required by qtwebengine +APT_PACKAGES="$APT_PACKAGES nodejs" + +## required by qtwayland +APT_PACKAGES="$APT_PACKAGES libwayland-dev" + +## required by all GN projects +APT_PACKAGES="$APT_PACKAGES python-is-python3" + +## required by libctl +APT_PACKAGES="$APT_PACKAGES guile-2.2-dev" + +## required by gtk +APT_PACKAGES="$APT_PACKAGES libxdamage-dev" + +## required by gtk3 and at-spi2-atk +APT_PACKAGES="$APT_PACKAGES libdbus-1-dev" + +## required by at-spi2-atk +APT_PACKAGES="$APT_PACKAGES libxtst-dev" + +## required by bond +APT_PACKAGES="$APT_PACKAGES haskell-stack" + +## required by boringssl +APT_PACKAGES="$APT_PACKAGES golang-go" + +## required by libdecor and mesa +APT_PACKAGES="$APT_PACKAGES wayland-protocols" + +## required by robotraconteur +APT_PACKAGES="$APT_PACKAGES libbluetooth-dev" + +## CUDA +APT_PACKAGES="$APT_PACKAGES cuda-compiler-12-1 cuda-libraries-dev-12-1 cuda-driver-dev-12-1 \ + cuda-cudart-dev-12-1 libcublas-12-1 libcurand-dev-12-1 cuda-nvml-dev-12-1 libcudnn8-dev libnccl2 \ + libnccl-dev" + +## PowerShell +APT_PACKAGES="$APT_PACKAGES powershell" + +## Additionally required/installed by Azure DevOps Scale Set Agents, skip on WSL +if [[ $(grep microsoft /proc/version) ]]; then +echo "Skipping install of ADO prerequisites on WSL." +else +APT_PACKAGES="$APT_PACKAGES libkrb5-3 zlib1g libicu70 debsums liblttng-ust1" +fi + +apt-get -y --no-install-recommends install $APT_PACKAGES diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/patch-tuesday-checklist.md b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/patch-tuesday-checklist.md new file mode 100644 index 0000000000000000000000000000000000000000..c1c5932cc05598a9fd6127424d5b2576169d7de3 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/patch-tuesday-checklist.md @@ -0,0 +1,42 @@ +## First time machine setup: +* [ ] Install Azure PowerShell: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps +* [ ] Run `Connect-AzAccount -Subscription CPP_GITHUB` +* [ ] Install Docker + +## Each Patch Tuesday: +* [ ] Check for depends:vm-update PRs and make relevant changes if possible. +* [ ] Check for Service 360 alerts (possibly at https://aka.ms/s360 ?) against the service named + "C++ VCPKG Validation" about vulnerable software we are installing in the VMs and update that. + (Most often PowerShell needs to be updated) +* [ ] Check for any other software for the Windows images we wish to update and make the edits to do + so in `scripts/azure-pipelines/windows` +* [ ] Check for any updates possible to `vcpkgTools.xml`. Note that PowerShell currently uses the + 7.2.x series due to customer reported problems on older Windows with 7.3.x and later. +* [ ] Update the first line of android/Dockerfile with the current 'focal' image according to + https://hub.docker.com/_/ubuntu +* [ ] Run android/create-docker-image.ps1 +* [ ] Update azure-pipelines.yml to point to the new linux docker image from Azure Container Registry +* [ ] Run windows/create-image.ps1 +* [ ] Run windows/create-vmss.ps1 +* [ ] Create new pools for these in Azure DevOps: https://dev.azure.com/vcpkg/public/_settings/agentqueues + * Windows: 22 agents + * Make sure to check 'Grant access permission to all pipelines' +* [ ] Update azure-pipelines.yml to point to the new pools. +* [ ] Submit PR with those changes. +* [ ] Submit a full CI rebuild with those changes: https://dev.azure.com/vcpkg/public/_build?definitionId=29 + refs/pull/NUMBER/head +* [ ] Look at that and compare with recent build and resolve anything that's not an existing baseline issue. +* [ ] Merge the PR. +* [ ] Update the managed image for compiler testing and delete unused images. + * CPP_GITHUB\vcpkg-image-minting\PrWinWus3 + * Standard HDD LRS + * West US 3, 1 Replica +* [ ] After the last build finishes on the previous pool, delete it in the Azure Devops *Organization* UI and its Resource Group. ( https://dev.azure.com/vcpkg/_settings/agentpools ?) +* [ ] Run `generate-sas-tokens.ps1 -KeyNumber N`, where N is whether the month is even + (Jan = 1, Feb = 2, Mar = 1, and so on) and update the relevant libraries on + dev.azure.com/vcpkg and devdiv.visualstudio.com +* [ ] After builds using previous SAS tokens complete, run `roll-sas-tokens.ps1 -KeyNumber N` where + this N is the other key. (Jan = 2, Feb = 1, Mar = 2, and so on) +* [ ] Mint a new macOS base box. (See instructions in `scripts/azure-pipelines/osx/README.md`) +* [ ] Deploy the new base box to all hosts. +* [ ] Update the software on the CTI's machine #12 to match. diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/roll-sas-tokens.ps1 b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/roll-sas-tokens.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..d0c33f5b75b1c6b1c0a3cedf8a9316df7c7f62d1 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/roll-sas-tokens.ps1 @@ -0,0 +1,13 @@ + +Param( + [Parameter(Mandatory=$true)] + [int]$KeyNumber +) + +$keyName = "key$KeyNumber" + +# Asset Cache: +New-AzStorageAccountKey -ResourceGroupName vcpkg-asset-cache -StorageAccountName vcpkgassetcachewus3 -KeyName $keyName + +# Binary Cache: +New-AzStorageAccountKey -ResourceGroupName vcpkg-binary-cache -StorageAccountName vcpkgbinarycachewus3 -KeyName $keyName diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/README.md b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d60367247ac76859e7e7bea337a01a461ab715ef --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/README.md @@ -0,0 +1,4 @@ +The "unstable" build is used internally by Microsoft to test prerelease versions +of our C++ compiler; not seeing results from these build definitions in the +GitHub portal is normal as these builds depend on acquisition of private +compiler bits that aren't yet shipping. diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/azure-pipelines.yml b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/azure-pipelines.yml new file mode 100644 index 0000000000000000000000000000000000000000..b86cdc13e36eb6d23f83a9a88545e1bb89d4c7cf --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/azure-pipelines.yml @@ -0,0 +1,11 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +variables: + unstable-pool: 'vcpkg-testing-msvc' + +jobs: +- template: job.yml + parameters: + triplet: x64-windows + jobName: x64_windows diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/job.yml b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/job.yml new file mode 100644 index 0000000000000000000000000000000000000000..e691d1645273247de700aacb19a6b8e2c79da991 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/job.yml @@ -0,0 +1,76 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +jobs: +- job: ${{ parameters.jobName }} + pool: + name: $(unstable-pool) + workspace: + clean: resources + timeoutInMinutes: 5760 # 4 days + variables: + - name: WORKING_ROOT + value: D:\ + - name: VCPKG_DOWNLOADS + value: D:\downloads + - group: vcpkg-asset-caching-credentials + - name: X_VCPKG_ASSET_SOURCES + value: "x-azurl,$(root-url-wus3),$(sas-wus3),readwrite" + + steps: + - task: DownloadBuildArtifacts@0 + displayName: 'Download DropBuildNumber if not specified' + inputs: + buildType: specific + project: '0bdbc590-a062-4c3f-b0f6-9383f67865ee' + pipeline: 16549 + buildVersionToDownload: latestFromBranch + branchName: 'refs/heads/$(MSVCBranchName)' + artifactName: BuildNumber + downloadPath: 'D:\msvc-drops' + condition: eq(variables['DropBuildNumber'], '') + - task: PowerShell@2 + displayName: 'Set DropBuildNumber if not specified' + inputs: + targetType: inline + script: | + $DropBuildNumber = Get-Content -Path D:\msvc-drops\BuildNumber\Build.BuildNumber.txt + Write-Host "##vso[task.setvariable variable=DropBuildNumber]$DropBuildNumber" + Write-Host "Build Number set to: $DropBuildNumber" + pwsh: true + condition: eq(variables['DropBuildNumber'], '') + - task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@0 + displayName: 'Download msvc x86 ret' + inputs: + dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection' + buildNumber: 'msvc/builds/$(DropBuildNumber)/x86ret' + destinationPath: 'D:\msvc-drops\$(DropBuildNumber)\binaries.x86ret' + - task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@0 + displayName: 'Download msvc amd64 ret' + inputs: + dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection' + buildNumber: 'msvc/builds/$(DropBuildNumber)/amd64ret' + destinationPath: 'D:\msvc-drops\$(DropBuildNumber)\binaries.amd64ret' + - task: PowerShell@2 + displayName: 'Rearrange MSVC Drop Layout' + inputs: + targetType: filePath + filePath: 'scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1' + arguments: '-DropRoot "D:\msvc-drops\$(DropBuildNumber)" -BuildType ret' + pwsh: true + - script: .\bootstrap-vcpkg.bat + displayName: 'Bootstrap vcpkg' + - task: PowerShell@2 + displayName: '*** Test Modified Ports' + inputs: + failOnStderr: true + filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' + arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory) -PassingIsPassing' + pwsh: true + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: failure logs for ${{ parameters.triplet }}' + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)\failure-logs' + ArtifactName: 'failure logs for ${{ parameters.triplet }}' + condition: ne(variables['FAILURE_LOGS_EMPTY'], 'True') diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1 b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..53692532e31c7e9c7bbca13475011f74d102f53f --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1 @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +<# +.SYNOPSIS +Moves files from an MSVC compiler drop to the locations where they are installed in a Visual Studio installation. + +.PARAMETER DropRoot +The location where the MSVC compiler drop has been downloaded. + +.PARAMETER BuildType +The MSVC drop build type set with /p:_BuildType when MSVC was built. Defaults to 'ret'. + +#> +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)][string]$DropRoot, + [Parameter(Mandatory = $false)][ValidateSet('ret', 'chk')][string]$BuildType = 'ret' +) + +Set-StrictMode -Version Latest + +$MSVCRoot = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC" + +$ErrorActionPreference = "Stop" + +$tempRoot = "$DropRoot\readytodeploy" + +New-Item -ItemType Directory -Path $tempRoot | Out-Null + +Write-Host "Rearranging x86$BuildType" +New-Item -ItemType Directory -Path "$tempRoot\bin\HostX86" | Out-Null +Move-Item "$DropRoot\binaries.x86$BuildType\bin\i386" "$tempRoot\bin\HostX86\x86" +Move-Item "$DropRoot\binaries.x86$BuildType\bin\x86_amd64" "$tempRoot\bin\HostX86\x64" +Move-Item "$DropRoot\binaries.x86$BuildType\bin\x86_arm" "$tempRoot\bin\HostX86\arm" + +Write-Host "Rearranging amd64$BuildType" +New-Item -ItemType Directory -Path "$tempRoot\bin\HostX64" | Out-Null +Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64" "$tempRoot\bin\HostX64\x64" +Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64_x86" "$tempRoot\bin\HostX64\x86" +Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64_arm" "$tempRoot\bin\HostX64\arm" + +# Only copy files and directories that already exist in the VS installation. +Write-Host "Rearranging inc, lib" +New-Item -ItemType Directory -Path "$tempRoot\lib" | Out-Null +Move-Item "$DropRoot\binaries.x86$BuildType\inc" "$tempRoot\include" +Move-Item "$DropRoot\binaries.x86$BuildType\lib\i386" "$tempRoot\lib\x86" +Move-Item "$DropRoot\binaries.amd64$BuildType\lib\amd64" "$tempRoot\lib\x64" + +Write-Host "Rearranging atlmfc" +New-Item -ItemType Directory -Path "$tempRoot\atlmfc" | Out-Null +New-Item -ItemType Directory -Path "$tempRoot\atlmfc\lib" | Out-Null +Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\include" "$tempRoot\atlmfc\include" +Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\lib\i386" "$tempRoot\atlmfc\lib\x86" +Move-Item "$DropRoot\binaries.amd64$BuildType\atlmfc\lib\amd64" "$tempRoot\atlmfc\lib\x64" + +[string[]]$toolsets = Get-ChildItem -Path $MSVCRoot -Directory | Sort-Object -Descending +if ($toolsets.Length -eq 0) { + throw "Could not find Visual Studio toolset!" +} + +Write-Host "Found toolsets:`n$($toolsets -join `"`n`")`n" +$selectedToolset = $toolsets[0] +Write-Host "Using toolset: $selectedToolset" +for ($idx = 1; $idx -lt $toolsets.Length; $idx++) { + $badToolset = $toolsets[$idx] + Write-Host "Deleting toolset: $badToolset" + Remove-Item $badToolset -Recurse -Force +} + +Write-Host "Deploying $tempRoot => $selectedToolset" +Copy-Item "$tempRoot\*" $selectedToolset -Recurse -Force +Write-Host "Deleting $DropRoot..." +Remove-Item $DropRoot -Recurse -Force +Write-Host "Done!" diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows/deploy-settings.txt b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows/deploy-settings.txt new file mode 100644 index 0000000000000000000000000000000000000000..c340453c69e3662059468cb1f60300c18a43d86e --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows/deploy-settings.txt @@ -0,0 +1,21 @@ +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +Write-Host 'Disabling pagefile...' +wmic computersystem set AutomaticManagedPagefile=False +wmic pagefileset delete + +$av = Get-Command Add-MPPreference -ErrorAction SilentlyContinue +if ($null -eq $av) { + Write-Host 'AntiVirus not installed, skipping exclusions.' +} else { + Write-Host 'Configuring AntiVirus exclusions...' + Add-MpPreference -ExclusionPath C:\agent + Add-MPPreference -ExclusionPath D:\ + Add-MPPreference -ExclusionPath E:\ + Add-MPPreference -ExclusionProcess ninja.exe + Add-MPPreference -ExclusionProcess clang-cl.exe + Add-MPPreference -ExclusionProcess cl.exe + Add-MPPreference -ExclusionProcess link.exe + Add-MPPreference -ExclusionProcess python.exe +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows/utility-prefix.ps1 b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows/utility-prefix.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..8cd0066db60097acd2daa5357ac6320bbb256d9b --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/azure-pipelines/windows/utility-prefix.ps1 @@ -0,0 +1,125 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT + +<# +.SYNOPSIS +Gets a random file path in the temp directory. + +.DESCRIPTION +Get-TempFilePath takes an extension, and returns a path with a random +filename component in the temporary directory with that extension. + +.PARAMETER Extension +The extension to use for the path. +#> +Function Get-TempFilePath { + Param( + [String]$Extension + ) + + if ([String]::IsNullOrWhiteSpace($Extension)) { + throw 'Missing Extension' + } + + $tempPath = [System.IO.Path]::GetTempPath() + $tempName = [System.IO.Path]::GetRandomFileName() + '.' + $Extension + return Join-Path $tempPath $tempName +} + +<# +.SYNOPSIS +Writes a message to the screen depending on ExitCode. + +.DESCRIPTION +Since msiexec can return either 0 or 3010 successfully, in both cases +we write that installation succeeded, and which exit code it exited with. +If msiexec returns anything else, we write an error. + +.PARAMETER ExitCode +The exit code that msiexec returned. +#> +Function PrintMsiExitCodeMessage { + Param( + $ExitCode + ) + + # 3010 is probably ERROR_SUCCESS_REBOOT_REQUIRED + if ($ExitCode -eq 0 -or $ExitCode -eq 3010) { + Write-Host "Installation successful! Exited with $ExitCode." + } + else { + Write-Error "Installation failed! Exited with $ExitCode." + throw + } +} + +<# +.SYNOPSIS +Install a .msi file. + +.DESCRIPTION +InstallMSI takes a url where an .msi lives, and installs that .msi to the system. + +.PARAMETER Name +The name of the thing to install. + +.PARAMETER Url +The URL at which the .msi lives. +#> +Function InstallMSI { + Param( + [String]$Name, + [String]$Url + ) + + try { + Write-Host "Downloading $Name..." + [string]$msiPath = Get-TempFilePath -Extension 'msi' + curl.exe -L -o $msiPath -s -S $Url + Write-Host "Installing $Name..." + $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn') + $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru + PrintMsiExitCodeMessage $proc.ExitCode + } + catch { + Write-Error "Failed to install $Name! $($_.Exception.Message)" + throw + } +} + +<# +.SYNOPSIS +Unpacks a zip file to $Dir. + +.DESCRIPTION +InstallZip takes a URL of a zip file, and unpacks the zip file to the directory +$Dir. + +.PARAMETER Name +The name of the tool being installed. + +.PARAMETER Url +The URL of the zip file to unpack. + +.PARAMETER Dir +The directory to unpack the zip file to. +#> +Function InstallZip { + Param( + [String]$Name, + [String]$Url, + [String]$Dir + ) + + try { + Write-Host "Downloading $Name..." + [string]$zipPath = Get-TempFilePath -Extension 'zip' + curl.exe -L -o $zipPath -s -S $Url + Write-Host "Installing $Name..." + Expand-Archive -Path $zipPath -DestinationPath $Dir -Force + } + catch { + Write-Error "Failed to install $Name! $($_.Exception.Message)" + throw + } +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/atomic.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/atomic.cmake new file mode 100644 index 0000000000000000000000000000000000000000..883c85bf29f2281751f777aaaf3dd3c979d38c41 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/atomic.cmake @@ -0,0 +1,2 @@ +# has_synchronization_lib.cpp is used in boost-modular-build-helper/Jamroot.jam.in +file(COPY "${SOURCE_PATH}/config/has_synchronization_lib.cpp" DESTINATION "${CURRENT_PACKAGES_DIR}/share/boost-atomic") \ No newline at end of file diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/config.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/config.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8954abd800d4c3ca8d3784155b3fa49425b6bcae --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/config.cmake @@ -0,0 +1,7 @@ +file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#ifndef BOOST_ALL_NO_LIB\n#define BOOST_ALL_NO_LIB\n#endif\n") +file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#undef BOOST_ALL_DYN_LINK\n") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_ALL_DYN_LINK\n") +endif() +file(COPY ${SOURCE_PATH}/checks DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-config) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/predef.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/predef.cmake new file mode 100644 index 0000000000000000000000000000000000000000..392d784548a200776d0fdd0369b424fe60cfb38b --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/predef.cmake @@ -0,0 +1,2 @@ + +file(COPY ${SOURCE_PATH}/tools/check DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-predef) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/test.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/test.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3a7ff8a8bafc8f2b3270196e156ba03328ac32b4 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-build-stubs/test.cmake @@ -0,0 +1,13 @@ +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(GLOB MONITOR_LIBS ${CURRENT_PACKAGES_DIR}/lib/*_exec_monitor*) + file(COPY ${MONITOR_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(REMOVE ${MONITOR_LIBS}) +endif() + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + file(GLOB DEBUG_MONITOR_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*_exec_monitor*) + file(COPY ${DEBUG_MONITOR_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + file(REMOVE ${DEBUG_MONITOR_LIBS}) +endif() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-source-stubs/math.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-source-stubs/math.cmake new file mode 100644 index 0000000000000000000000000000000000000000..52703ec1e96b011ea32bfaf65ee4cca506589c64 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-source-stubs/math.cmake @@ -0,0 +1,5 @@ +vcpkg_replace_string("${SOURCE_PATH}/build/Jamfile.v2" + "import ../../config/checks/config" + "import ../config/checks/config" +) +file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/config") diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-source-stubs/test.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-source-stubs/test.cmake new file mode 100644 index 0000000000000000000000000000000000000000..140230b8be66ff0e52f9d9b92be0419feb99f65b --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/boost/post-source-stubs/test.cmake @@ -0,0 +1,5 @@ +vcpkg_replace_string("${SOURCE_PATH}/build/Jamfile.v2" + "import ../../predef/check/predef" + "import ../predef/check/predef" +) +file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-predef/check" DESTINATION "${SOURCE_PATH}/predef") diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/ifw/maintenance.qs b/cc-multilingual-main/cc_net/vcpkg/scripts/ifw/maintenance.qs new file mode 100644 index 0000000000000000000000000000000000000000..5cdad7225eed54496f26f57ea2f3fa4dfd9a0c14 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/ifw/maintenance.qs @@ -0,0 +1,46 @@ +// constructor +function Component() +{ + installer.installationStarted.connect(this, Component.prototype.onInstallationStarted); +} + +Component.prototype.onInstallationStarted = function() +{ + if (component.updateRequested() || component.installationRequested()) { + if (installer.value("os") == "win") + component.installerbaseBinaryPath = "@TargetDir@/tempmaintenancetool.exe"; + installer.setInstallerBaseBinary(component.installerbaseBinaryPath); + } +} + +Component.prototype.createOperations = function() +{ + // call the base createOperations + component.createOperations(); + + // only for windows online installer + if ( installer.value("os") == "win" && !installer.isOfflineOnly() ) + { + // shortcut to add or remove packages + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Manage vcpkg.lnk", + " --manage-packages"); + // shortcut to update packages + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Update vcpkg.lnk", + " --updater"); + } + + // create uninstall link only for windows + if (installer.value("os") == "win") + { + // shortcut to uninstaller + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Uninstall vcpkg.lnk", + " --uninstall"); + } +} + diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d9154ebc09d6f15cfa302d655ab7087564f1e02e --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/portfile.cmake @@ -0,0 +1,227 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +set(cmake_commands "") +if("cmake-current" IN_LIST FEATURES) + list(APPEND cmake_commands "${CMAKE_COMMAND}") +endif() +if("cmake-3-7" IN_LIST FEATURES) + set(cmake_version 3.7.2) + string(REGEX REPLACE "([^.]*[.][^.]*).*" "\\1" cmake_major_minor "${cmake_version}") + if(VCPKG_HOST_IS_WINDOWS) + set(name "cmake-${cmake_version}-win32-x86") + vcpkg_download_distfile(legacy_cmake_archive + FILENAME "${name}.zip" + URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.zip" + "https://cmake.org/files/v${cmake_major_minor}/${name}.zip" + SHA512 c359a22e2e688da1513db195280d6e8987bc8d570a0c543f1b1dfc8572fe4fd6c23d951ec5d5eae640fcca3bef3ae469083511474796ade8c6319d8bc4e4b38d + ) + set(cmake_bin_dir "/bin") + elseif(VCPKG_HOST_IS_OSX) + set(name "cmake-${cmake_version}-Darwin-x86_64") + vcpkg_download_distfile(legacy_cmake_archive + FILENAME "${name}.tar.gz" + URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.tar.gz" + "https://cmake.org/files/v${cmake_major_minor}/${name}.tar.gz" + SHA512 8e41608f4dd998020acf2bd1b0dab4aec37b3ea9e228f2c4a457cd1c0339d94db38a0548b4b07a9e3605f9beb11a3f6737a72813586c4ad5f730d74038a14c2b + ) + set(cmake_bin_dir "/CMake.app/Contents/bin") + elseif(VCPKG_HOST_IS_LINUX) + set(name "cmake-${cmake_version}-Linux-x86_64") + vcpkg_download_distfile(legacy_cmake_archive + FILENAME "${name}.tar.gz" + URLS "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${name}.tar.gz" + "https://cmake.org/files/v${cmake_major_minor}/${name}.tar.gz" + SHA512 459909fcfb9c74993c3d4ab9db4e31ea940515b670db44d039de611d813099895e695467cc8da24824315486e38e2f3e246aa92d6236c51103822ec8a39e3168 + ) + set(cmake_bin_dir "/bin") + else() + message(FATAL_ERROR "Unable to test feature 'cmake-3-7' for '${HOST_TRIPLET}' host.") + endif() + + vcpkg_extract_source_archive(legacy_cmake + ARCHIVE "${legacy_cmake_archive}" + SOURCE_BASE "${cmake_version}" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/cmake" + ) + list(APPEND cmake_commands "${legacy_cmake}${cmake_bin_dir}/cmake") +endif() + +if(DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) + set(NINJA "ninja") +else() + vcpkg_find_acquire_program(NINJA) +endif() + +function(get_packages out_packages cmake_version) + set(packages "") + if("find-package" IN_LIST FEATURES) + file(READ "${CMAKE_CURRENT_LIST_DIR}/vcpkg.json" vcpkg_json) + string(JSON packages_json GET "${vcpkg_json}" "features" "find-package" "dependencies") + string(JSON packages_count LENGTH "${packages_json}") + if(packages_count GREATER 0) + math(EXPR last "${packages_count} - 1") + foreach(i RANGE 0 ${last}) + # Some ports may be excluded via platform expressions, + # because they don't support particular platforms. + # Using the installed vcpkg_abi_info.txt as an indicator. + string(JSON port GET "${packages_json}" "${i}" "name") + if(NOT EXISTS "${CURRENT_INSTALLED_DIR}/share/${port}/vcpkg_abi_info.txt") + continue() + endif() + string(JSON since ERROR_VARIABLE since_not_found GET "${packages_json}" "${i}" "\$since") + if(since AND cmake_version VERSION_LESS since) + continue() + endif() + if(NOT EXISTS "${CURRENT_INSTALLED_DIR}/share/${port}/vcpkg_abi_info.txt") + continue() + endif() + string(JSON package GET "${packages_json}" "${i}" "\$package") + list(APPEND packages "${package}") + endforeach() + endif() + endif() + if("pkg-check-modules" IN_LIST FEATURES) + list(APPEND packages "ZLIBviaPkgConfig") + endif() + set("${out_packages}" "${packages}" PARENT_SCOPE) +endfunction() + +function(test_cmake_project) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "" "CMAKE_COMMAND;NAME" "OPTIONS") + if(NOT arg_NAME) + message(FATAL_ERROR "The NAME argument is mandatory.") + endif() + if(NOT arg_CMAKE_COMMAND) + set(arg_CMAKE_COMMAND "${CMAKE_COMMAND}") + endif() + + execute_process( + COMMAND "${arg_CMAKE_COMMAND}" --version + OUTPUT_VARIABLE cmake_version_output + RESULT_VARIABLE cmake_version_result + ) + string(REGEX MATCH "[1-9][0-9]*\\.[0-9]*\\.[0-9]*" cmake_version "${cmake_version_output}") + if(cmake_version_result OR NOT cmake_version) + message(FATAL_ERROR "Unable to determine version for '${arg_CMAKE_COMMAND}'.") + endif() + + set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}") + set(base_options + # Interface: CMake + -G "Ninja" + "-DCMAKE_MAKE_PROGRAM=${NINJA}" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DCMAKE_INSTALL_PREFIX=${build_dir}/install" + "-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake" + # Interface: vcpkg.cmake + "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" + "-DVCPKG_HOST_TRIPLET=${HOST_TRIPLET}" + "-DVCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}" + "-DVCPKG_MANIFEST_MODE=OFF" + # Interface: project/CMakeLists.txt + "-DCHECK_CMAKE_VERSION=${cmake_version}" + ) + + if(DEFINED VCPKG_CMAKE_SYSTEM_NAME AND VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + # Interface: CMake + list(APPEND base_options "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") + if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + list(APPEND base_options "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") + endif() + endif() + + if(DEFINED VCPKG_XBOX_CONSOLE_TARGET) + list(APPEND arg_OPTIONS "-DXBOX_CONSOLE_TARGET=${VCPKG_XBOX_CONSOLE_TARGET}") + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND base_options -DBUILD_SHARED_LIBS=ON) + else() + list(APPEND base_options -DBUILD_SHARED_LIBS=OFF) + endif() + + message(STATUS "Running tests with CMake ${cmake_version} for '${arg_NAME}'") + file(REMOVE_RECURSE "${build_dir}") + file(MAKE_DIRECTORY "${build_dir}") + vcpkg_execute_required_process( + COMMAND + "${arg_CMAKE_COMMAND}" "${CMAKE_CURRENT_LIST_DIR}/project" + ${base_options} + ${arg_OPTIONS} + WORKING_DIRECTORY "${build_dir}" + LOGNAME "${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}-config" + ) + vcpkg_execute_required_process( + COMMAND + "${arg_CMAKE_COMMAND}" --build . --target install + WORKING_DIRECTORY "${build_dir}" + LOGNAME "${TARGET_TRIPLET}-${cmake_version}-${arg_NAME}-build" + ) + # To produce better error messages for failing wrappers, + # we run execute_process directly here, for each wrapper. + string(REPLACE " OFF:" ":" message + " CMake ${cmake_version}: @step@ with `find_package(@package@)` failed.\n" + " See logs for more information:\n" + " @log_out@\n" + " @log_err@\n" + ) + if(DEFINED ENV{BUILD_REASON}) # On Azure Pipelines, add extra markup. + string(REPLACE " CMake" "##vso[task.logissue type=error]CMake" message "${message}") + endif() + get_packages(packages "${cmake_version}") + foreach(package IN LISTS packages) + string(MAKE_C_IDENTIFIER "${package}" package_string) + set(find_package_build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}") + set(log_out "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-out.log") + set(log_err "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-err.log") + + message(STATUS " find_package(${package})") + file(REMOVE_RECURSE "${find_package_build_dir}") + file(MAKE_DIRECTORY "${find_package_build_dir}") + execute_process( + COMMAND + "${arg_CMAKE_COMMAND}" "${CMAKE_CURRENT_LIST_DIR}/project" + ${base_options} + ${arg_OPTIONS} + "-DFIND_PACKAGES=${package}" + OUTPUT_FILE "${log_out}" + ERROR_FILE "${log_err}" + RESULT_VARIABLE package_result + WORKING_DIRECTORY "${find_package_build_dir}" + ) + if(package_result) + set(step "configuration") + string(CONFIGURE "${message}" package_message @ONLY) + message(SEND_ERROR "${package_message}") + else() + set(log_out "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-build-out.log") + set(log_err "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${cmake_version}-find-package-${package_string}-${arg_NAME}-build-err.log") + execute_process( + COMMAND + "${arg_CMAKE_COMMAND}" --build . + OUTPUT_FILE "${log_out}" + ERROR_FILE "${log_err}" + RESULT_VARIABLE package_result + WORKING_DIRECTORY "${find_package_build_dir}" + ) + if(package_result) + set(step "build") + string(CONFIGURE "${message}" package_message @ONLY) + message(SEND_ERROR "${package_message}") + endif() + endif() + endforeach() +endfunction() + +foreach(executable IN LISTS cmake_commands) + test_cmake_project(NAME "release" + CMAKE_COMMAND "${executable}" + OPTIONS + "-DCMAKE_BUILD_TYPE=Release" + ) + test_cmake_project(NAME "debug" + CMAKE_COMMAND "${executable}" + OPTIONS + "-DCMAKE_BUILD_TYPE=Debug" + ) +endforeach() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/project/CMakeLists.txt b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/project/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fdb213e5a5460775e29b475f58137bc5da995c3c --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/project/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake-user LANGUAGES C) + +message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}") +set(CHECK_CMAKE_VERSION "NOTFOUND" CACHE STRING "Version of CMake expected to be found") +if(NOT CHECK_CMAKE_VERSION) + message(WARNING "CMake version check: skipped (actual: ${CMAKE_VERSION})") +elseif(NOT CHECK_CMAKE_VERSION VERSION_EQUAL CMAKE_VERSION) + message(SEND_ERROR "CMake version check: failed (actual: ${CMAKE_VERSION} expected: ${CHECK_CMAKE_VERSION})") +else() + message(STATUS "CMake version check: success (actual: ${CMAKE_VERSION})") +endif() + +# add_library overload +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib.c" "int lib_unused() { return 1; }") +add_library(lib "${CMAKE_CURRENT_BINARY_DIR}/lib.c") + +# add_executable overload +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/exe.c" "int main() { return 0; }") +add_executable(exe "${CMAKE_CURRENT_BINARY_DIR}/exe.c") + +# install overload +set(X_VCPKG_APPLOCAL_DEPS_INSTALL 1) +install(TARGETS exe lib + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +# find_package overload and wrapper +set(FIND_PACKAGES "" CACHE STRING "List of packages to be found and used") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") +foreach(package ${FIND_PACKAGES}) + string(TOUPPER "${package}" package_upper) + set(CMAKE_FIND_DEBUG_MODE ON) + find_package("${package}" QUIET) + set(CMAKE_FIND_DEBUG_MODE OFF) + if(NOT ${package}_FOUND AND NOT ${package_upper}_FOUND) + message(SEND_ERROR "find_package(${package}) check: failed") + continue() + endif() + # REQUIRED changes the behaviour find_package_handle_standard_args. + find_package("${package}" REQUIRED) + message(STATUS "find_package(${package}) check: success") + + set(libraries_var "") + if(DEFINED ${package}_LIBRARIES) + set(libraries_var "${package}_LIBRARIES") + elseif(DEFINED ${package_upper}_LIBRARIES) + set(libraries_var "${package_upper}_LIBRARIES") + elseif(DEFINED ${package}_LIBRARY) + set(libraries_var "${package}_LIBRARY") + elseif(DEFINED ${package_upper}_LIBRARY) + set(libraries_var "${package_upper}_LIBRARY") + else() + message(STATUS "${package}_LIBRARY/IES: undefined") + continue() + endif() + set(libraries "${${libraries_var}}") + message(STATUS "${libraries_var}: ${libraries}") + + if(package STREQUAL "Intl" AND NOT Intl_LIBRARY) + continue() # using libintl.h from C runtime library + endif() + target_link_libraries(exe PRIVATE ${libraries}) + + set(last_keyword "") + foreach(item IN LISTS libraries) + if(item STREQUAL "optimized" OR item STREQUAL "debug") + set(last_keyword "${item}") + continue() + endif() + string(FIND "${item}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/" starts_with_release) + string(FIND "${item}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/" starts_with_debug) + if(starts_with_release EQUAL "0") + if(last_keyword STREQUAL "optimized") + # okay + elseif(last_keyword STREQUAL "debug") + message(SEND_ERROR "Release lib for 'debug' keyword: ${item}") + elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") + message(SEND_ERROR "Release lib for 'Debug' build: ${item}") + endif() + elseif(starts_with_debug EQUAL "0") + if(last_keyword STREQUAL "debug") + # okay + elseif(last_keyword STREQUAL "optimized") + message(SEND_ERROR "Debug lib for 'optimized' keyword: ${item}") + elseif(CMAKE_BUILD_TYPE STREQUAL "Release") + message(SEND_ERROR "Debug lib for 'Release' build: ${item}") + endif() + endif() + set(last_keyword "") + continue() + endforeach() +endforeach() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5f46a943d59c66380130b8f2689691b78c559aa1 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake @@ -0,0 +1,11 @@ +# `pkgconf` is not recognized before CMake 3.22 +find_program(PKG_CONFIG_EXECUTABLE NAMES pkgconf REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PC_ZLIB zlib) +if(PC_ZLIB_FOUND) + if(NOT PC_ZLIB_LDFLAGS) + message(SEND_ERROR "ZLIBviaPkgConfig_LIBRARIES is empty") + endif() + set(ZLIBviaPkgConfig_LIBRARIES "${PC_ZLIB_LDFLAGS}") + set(ZLIBviaPkgConfig_FOUND "${PC_ZLIB_FOUND}") +endif() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..e79ee97d8b7bbf0f86cde8e05f0253db43adf236 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake-user/vcpkg.json @@ -0,0 +1,189 @@ +{ + "name": "cmake-user", + "version-date": "2022-11-12", + "description": "Test port to verify the vcpkg toolchain in cmake user projects", + "license": "MIT", + "default-features": [ + "ci" + ], + "features": { + "ci": { + "description": "The CI set of features to test", + "dependencies": [ + { + "name": "cmake-user", + "default-features": false, + "features": [ + "cmake-current", + "find-package", + "pkg-check-modules" + ] + }, + { + "name": "cmake-user", + "default-features": false, + "features": [ + "cmake-3-7" + ], + "platform": "x64 & (windows | linux | osx) & !uwp" + } + ] + }, + "cmake-3-7": { + "description": "Run the tests with CMake 3.7" + }, + "cmake-current": { + "description": "Run the tests with vcpkg's current version of CMake" + }, + "find-package": { + "description": "Ports to be tested via find_package($package)", + "dependencies": [ + { + "$package": "Boost", + "name": "boost", + "platform": "!uwp" + }, + { + "$package": "BZip2", + "name": "bzip2" + }, + { + "$package": "CURL", + "name": "curl", + "default-features": false + }, + { + "$package": "EXPAT", + "name": "expat" + }, + { + "$package": "Fontconfig", + "$since": "3.14", + "name": "fontconfig", + "platform": "!mingw & !uwp" + }, + { + "$comment": "CMake 3.13 for debug postfix support", + "$package": "GLUT", + "$since": "3.13", + "name": "freeglut", + "platform": "!uwp & !osx" + }, + { + "$package": "Freetype", + "name": "freetype", + "default-features": false + }, + { + "$comment": "CMake 3.9 for find_dependency forwarding extra arguments", + "$package": "GDAL", + "$since": "3.9", + "name": "gdal", + "default-features": false, + "platform": "!uwp" + }, + { + "$package": "Intl", + "name": "gettext-libintl" + }, + { + "$package": "GIF", + "name": "giflib" + }, + { + "$package": "ICU", + "name": "icu", + "platform": "!uwp" + }, + { + "$package": "LAPACK", + "name": "lapack", + "platform": "!(uwp & arm)" + }, + { + "$package": "Iconv", + "$since": "3.11", + "name": "libiconv" + }, + { + "$package": "JPEG", + "name": "libjpeg-turbo" + }, + { + "$package": "LibLZMA", + "name": "liblzma" + }, + { + "$package": "PNG", + "name": "libpng" + }, + { + "$package": "PostgreSQL", + "name": "libpq", + "default-features": false, + "platform": "!uwp & !mingw" + }, + { + "$comment": "CMake 3.11 because it needs Iconv", + "$package": "LibXml2", + "$since": "3.11", + "name": "libxml2", + "default-features": false + }, + { + "$comment": "CMake 3.11 because it needs Iconv", + "$package": "LibXslt", + "$since": "3.11", + "name": "libxslt", + "default-features": false, + "platform": "!uwp & !mingw" + }, + { + "$package": "Curses", + "name": "ncurses", + "platform": "!windows | mingw" + }, + { + "$package": "PhysFS", + "name": "physfs" + }, + { + "$package": "SQLite3", + "$since": "3.14", + "name": "sqlite3", + "default-features": false + }, + { + "$package": "TIFF", + "name": "tiff", + "default-features": false, + "features": [ + "lerc", + "libdeflate", + "zstd" + ] + }, + { + "$package": "wxWidgets", + "name": "wxwidgets", + "default-features": false, + "platform": "!uwp" + }, + { + "$package": "ZLIB", + "name": "zlib" + } + ] + }, + "pkg-check-modules": { + "description": "Test `find_package(PkgConfig)` and pkg_check_modules(...)", + "dependencies": [ + { + "name": "pkgconf", + "host": true + }, + "zlib" + ] + } + } +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/fix-dependency-libuv.patch b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/fix-dependency-libuv.patch new file mode 100644 index 0000000000000000000000000000000000000000..e847f6549d1f84c86bfc5ffbfbf0f58fc51a35c7 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/fix-dependency-libuv.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fdfe456..ef2d329 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -647,16 +647,16 @@ macro (CMAKE_BUILD_UTILITIES) + #--------------------------------------------------------------------- + # Build libuv library. + if(CMAKE_USE_SYSTEM_LIBUV) +- if(WIN32) +- find_package(LibUV 1.38.0) +- else() +- find_package(LibUV 1.10.0) +- endif() +- if(NOT LIBUV_FOUND) ++ find_package(libuv CONFIG REQUIRED) ++ if(0) + message(FATAL_ERROR + "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!") + endif() +- set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV) ++ if (TARGET libuv::uv) ++ set(CMAKE_LIBUV_LIBRARIES libuv::uv) ++ else() ++ set(CMAKE_LIBUV_LIBRARIES libuv::uv_a) ++ endif() + else() + set(CMAKE_LIBUV_LIBRARIES cmlibuv) + add_subdirectory(Utilities/cmlibuv) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..cdbd2d6adfafb18efcb7ff78a3a047773b63d3d2 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/portfile.cmake @@ -0,0 +1,80 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.kitware.com/ + OUT_SOURCE_PATH SOURCE_PATH + REPO cmake/cmake + REF + 8428e39ed9cddb3b7f1a6f7a58cb8617503183d2 + SHA512 + 12df5d68aad6bf1bfa34c3a83b428e1ecdc0b2b746e92bf71157eec4b4c114c86f21e91509f26f5da6e8916941563750e63cc3218970eaba33d6de231599de34 + HEAD_REF master + PATCHES fix-dependency-libuv.patch +) +set(OPTIONS) +if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP) + list(APPEND OPTIONS "-DBUILD_CursesDialog=ON") +else() + list(APPEND OPTIONS "-DBUILD_CursesDialog=OFF") +endif() + +if(VCPKG_CROSSCOMPILING) + list(APPEND OPTIONS "-DQt6CoreTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6CoreTools") + list(APPEND OPTIONS "-DQt6WidgetsTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6WidgetsTools") + list(APPEND OPTIONS "-DQt6GuiTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6GuiTools") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64 AND VCPKG_TARGET_IS_WINDOWS) # Remove if PR #16111 is merged + list(APPEND OPTIONS -DCMAKE_CROSSCOMPILING=ON -DCMAKE_SYSTEM_PROCESSOR:STRING=ARM64 -DCMAKE_SYSTEM_NAME:STRING=Windows) + endif() +endif() + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}") + set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}") +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${OPTIONS} + -DBUILD_TESTING=OFF + #-DCMAKE_USE_SYSTEM_LIBRARIES=ON + -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON + -DCMAKE_USE_SYSTEM_CURL=ON + -DCMAKE_USE_SYSTEM_EXPAT=ON + -DCMAKE_USE_SYSTEM_ZLIB=ON + -DCMAKE_USE_SYSTEM_BZIP2=ON + -DCMAKE_USE_SYSTEM_ZSTD=ON + -DCMAKE_USE_SYSTEM_FORM=ON + -DCMAKE_USE_SYSTEM_JSONCPP=ON + -DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG + -DCMAKE_USE_SYSTEM_LIBUV=ON + -DBUILD_QtDialog=ON # Just to test Qt with CMake + -DCMake_QT_MAJOR_VERSION:STRING=6 +) + +vcpkg_cmake_install(ADD_BIN_TO_PATH) +vcpkg_copy_pdbs() + +if(NOT VCPKG_TARGET_IS_OSX) + set(_tools cmake cmake-gui ctest cpack) + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND _tools cmcldeps) + endif() + if(BUILD_CURSES_DIALOG) + list(APPEND _tools ccmake) + endif() + vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN) +else() + # On OSX everything is within a CMake.app folder + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools") + file(RENAME "${CURRENT_PACKAGES_DIR}/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/CMake.app") + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/CMake.app") + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/debug") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/debug/CMake.app") + endif() +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") + +# Handle copyright +configure_file("${SOURCE_PATH}/Copyright.txt" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..f1c6364d902650339a87c08dc8a44b58e3a08387 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/cmake/vcpkg.json @@ -0,0 +1,29 @@ +{ + "name": "cmake", + "version": "3.22.2", + "port-version": 4, + "description": "CMake is an open-source, cross-platform family of tools designed to build, test and package software.", + "homepage": "https://cmake.org/", + "license": "BSD-3-Clause", + "dependencies": [ + "bzip2", + "curl", + "expat", + "jsoncpp", + "libarchive", + "liblzma", + "libuv", + { + "name": "ncurses", + "platform": "!(windows | uwp)" + }, + "nghttp2", + "qtbase", + { + "name": "vcpkg-cmake", + "host": true + }, + "zlib", + "zstd" + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..065116c276adcf960cd9ad806097da3f199e2241 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/llfio-run-tests/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/llfio-run-tests/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..32c0cf4a2ef17cd0cd031620ddbd33003c9ef36a --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/llfio-run-tests/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "llfio-run-tests", + "version-string": "0", + "port-version": 1, + "description": "Ensures that LLFIO built with vcpkg version of dependencies produces working executables.", + "supports": "x64", + "dependencies": [ + { + "name": "llfio", + "features": [ + "run-tests" + ] + }, + { + "name": "llfio", + "features": [ + "run-tests", + "status-code" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_fixup_pkgconfig.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_fixup_pkgconfig.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b60382de2c3d85921b20466dc0bf477be2589971 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_fixup_pkgconfig.cmake @@ -0,0 +1,167 @@ +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig") +set(pc_file_release "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/unit-test-cmake.pc") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") +set(pc_file_debug "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/unit-test-cmake.pc") +set(reload_pc_strings 0) + +function(write_pkgconfig) + file(WRITE "${pc_file_release}" ${ARGN}) + file(WRITE "${pc_file_debug}" ${ARGN}) + file(STRINGS "${pc_file_release}" pc_strings_input) + set(pc_strings_INPUT "${pc_strings_input}" PARENT_SCOPE) + set(reload_pc_strings 1 PARENT_SCOPE) +endfunction() + +function(unit_test_pkgconfig_check_key build_types field value) + if(NOT build_types) + message(SEND_ERROR "The build_type parameter must be list of debug;release.") + endif() + if(reload_pc_strings) + file(STRINGS "${pc_file_release}" pc_strings_release) + file(STRINGS "${pc_file_debug}" pc_strings_debug) + set(pc_strings_release "${pc_strings_release}" PARENT_SCOPE) + set(pc_strings_debug "${pc_strings_debug}" PARENT_SCOPE) + set(reload_pc_strings 0 PARENT_SCOPE) + endif() + foreach(build_type IN LISTS build_types) + set(listname "pc_strings_${build_type}") + set(expected "${field}${value}") + list(FILTER ${listname} INCLUDE REGEX "^${field}") + if(NOT "${${listname}}" STREQUAL "${expected}" AND NOT "${${listname}}_is_empty" STREQUAL "${value}_is_empty") + string(REPLACE "\$" "\\\$" pc_strings_INPUT "${pc_strings_INPUT}") + string(REPLACE "\$" "\\\$" expected "${expected}") + string(REPLACE "\$" "\\\$" "${listname}" "${${listname}}") + message(SEND_ERROR "vcpkg_fixup_pkgconfig() resulted in a wrong value for ${build_type} builds; + input : [[${pc_strings_INPUT}]] + expected: [[${expected}]] + actual : [[${${listname}}]]") + set_has_error() + return() + endif() + endforeach() +endfunction() + +# "Libs:" only +write_pkgconfig([[ +Libs: -L${prefix}/lib -l"aaa" +]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa]]) + +# "Libs:" and "Libs.private:" +write_pkgconfig([[ +Libs: -L"${prefix}/lib" -l"aaa" +Libs.private: -l"bbb ccc" +]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa "-lbbb ccc"]]) + unit_test_pkgconfig_check_key("debug;release" "Libs.private:" "") +else() + unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa]]) +endif() + +# line continuations +write_pkgconfig([[ +Libs.private: \ + -lbbb +Libs: -L"${prefix}/lib" \ + -l"aaa" +]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa -lbbb]]) + unit_test_pkgconfig_check_key("debug;release" "Libs.private:" "") +else() + unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa]]) +endif() + +# Replace ';' with ' ' +write_pkgconfig([[ +Libs: -L${prefix}/lib\;-l"aaa" +Libs.private: -lbbb\;-l"ccc" +]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa -lbbb -lccc]]) + unit_test_pkgconfig_check_key("debug;release" "Libs.private:" "") +else() + unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ "-L${prefix}/lib" -laaa]]) +endif() + +# invalid: ...-NOTFOUND +write_pkgconfig([[Libs: LIB-NOTFOUND]]) +# Only warning: unit_test_ensure_fatal_error([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) # ...-NOTFOUND # ]]) + +# invalid: optimized/debug +write_pkgconfig([[Libs: -laaa -loptimized -lrel -ldebug -ldbg -lbbb]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug" "Libs:" [[ -laaa -ldbg -lbbb]]) +unit_test_pkgconfig_check_key("release" "Libs:" [[ -laaa -lrel -lbbb]]) + +write_pkgconfig([[Libs: -laaa -Loptimized -Lrel -Ldebug -Ldbg -lbbb]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug" "Libs:" [[ -laaa -Ldbg -lbbb]]) +unit_test_pkgconfig_check_key("release" "Libs:" [[ -laaa -Lrel -lbbb]]) + +write_pkgconfig([[Libs: optimized\;librel.a\;debug\;libdbg.a\;aaa.lib]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug" "Libs:" [[ libdbg.a aaa.lib]]) +unit_test_pkgconfig_check_key("release" "Libs:" [[ librel.a aaa.lib]]) + +write_pkgconfig([[Libs: aaa.lib\;optimized\;librel.a\;debug\;libdbg.a]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug" "Libs:" [[ aaa.lib libdbg.a]]) +unit_test_pkgconfig_check_key("release" "Libs:" [[ aaa.lib librel.a]]) + +write_pkgconfig([[Libs: aaa.lib optimized librel.a debug libdbg.a bbb.lib]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug" "Libs:" [[ aaa.lib libdbg.a bbb.lib]]) +unit_test_pkgconfig_check_key("release" "Libs:" [[ aaa.lib librel.a bbb.lib]]) + +# invalid: namespaced targets +write_pkgconfig([[Libs: -lAAA::aaa]]) +# Only warning: unit_test_ensure_fatal_error([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) # namespaced target # ]]) + +# prefix +write_pkgconfig( +"prefix=${CURRENT_PACKAGES_DIR} +execprefix=\${prefix} +libdir=${CURRENT_PACKAGES_DIR}/lib +includedir=${CURRENT_PACKAGES_DIR}/include +datarootdir=${CURRENT_PACKAGES_DIR}/share +datadir=\${datarootdir}/${PORT} +") +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("release" "prefix=" [[${pcfiledir}/../..]]) +unit_test_pkgconfig_check_key("release" "execprefix=" [[${prefix}]]) +unit_test_pkgconfig_check_key("release" "libdir=" [[${prefix}/lib]]) +unit_test_pkgconfig_check_key("release" "includedir=" [[${prefix}/include]]) +unit_test_pkgconfig_check_key("release" "datarootdir=" [[${prefix}/share]]) +unit_test_pkgconfig_check_key("release" "datadir=" [[${datarootdir}/unit-test-cmake]]) + +write_pkgconfig( +"prefix=${CURRENT_PACKAGES_DIR}/debug +execprefix=\${prefix} +libdir=${CURRENT_PACKAGES_DIR}/debug/lib +includedir=${CURRENT_PACKAGES_DIR}/include +datarootdir=${CURRENT_PACKAGES_DIR}/share +datadir=\${datarootdir}/${PORT} +") +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug" "prefix=" [[${pcfiledir}/../..]]) +unit_test_pkgconfig_check_key("debug" "execprefix=" [[${prefix}]]) +unit_test_pkgconfig_check_key("debug" "libdir=" [[${prefix}/lib]]) +unit_test_pkgconfig_check_key("debug" "includedir=" [[${prefix}/../include]]) +unit_test_pkgconfig_check_key("debug" "datarootdir=" [[${prefix}/../share]]) +unit_test_pkgconfig_check_key("debug" "datadir=" [[${datarootdir}/unit-test-cmake]]) + +# -I, -l or -L with ${blah} in variables +write_pkgconfig([[blah_libs=-L${blah}/lib64 -l${blah}/libblah.a -I${blah}/include]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug;release" "blah_libs=" [["-L${blah}/lib64" "-l${blah}/libblah.a" "-I${blah}/include"]]) + +# plain vs. quoted items +write_pkgconfig([[Libs: ${blah} "${quoted}" plain "C:/Program Files/blah.lib"]]) +unit_test_ensure_success([[ vcpkg_fixup_pkgconfig(SKIP_CHECK) ]]) +unit_test_pkgconfig_check_key("debug;release" "Libs:" [[ ${blah} "${quoted}" plain "C:/Program Files/blah.lib"]]) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_minimum_required.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_minimum_required.cmake new file mode 100644 index 0000000000000000000000000000000000000000..93bfbcfaad8780f7022e3bebf89392d54b58d83e --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-vcpkg_minimum_required.cmake @@ -0,0 +1,49 @@ +# -- error cases -- +# VCPKG_BASE_VERSION not set - vcpkg version is too old +set(VCPKG_BASE_VERSION_backup "${VCPKG_BASE_VERSION}") +unset(VCPKG_BASE_VERSION) +unset(VCPKG_BASE_VERSION CACHE) +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-01-01)]]) +unit_test_ensure_fatal_error([[vcpkg_minimum_required()]]) +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "")]]) +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "2021.01.01")]]) + +set(VCPKG_BASE_VERSION 2021-02-02) + +# VERSION not passed +unit_test_ensure_fatal_error([[vcpkg_minimum_required()]]) +# VERSION weird - empty +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "")]]) +# VERSION weird - dotted +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021.01.01)]]) +# VERSION weird - not a valid year +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 3000-01-01)]]) +# VERSION weird - list +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION "2021-01-01;2021-01-02")]]) +# VERSION weird - small year +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 21-01-01)]]) +# VERSION weird - small month +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-1-01)]]) +# VERSION weird - small day +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-01-1)]]) +# VERSION too-new - later year, earlier month, earlier day +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2022-01-01)]]) +# VERSION too-new - same year, later month, earlier day +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-03-01)]]) +# VERSION too-new - same year, same month, later day +unit_test_ensure_fatal_error([[vcpkg_minimum_required(VERSION 2021-02-03)]]) + +# -- successes -- +# same date +unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2021-02-02)]]) + +# VERSION old - earlier year, later month, later day +unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2020-03-03)]]) +# VERSION old - same year, earlier month, later day +unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2021-01-03)]]) +# VERSION old - same year, same month, earlier day +unit_test_ensure_success([[vcpkg_minimum_required(VERSION 2021-02-01)]]) + +# reset to backup +unset(VCPKG_BASE_VERSION) +set(VCPKG_BASE_VERSION "${VCPKG_BASE_VERSION_backup}" CACHE STRING "") diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_cmake_config_fixup_merge.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_cmake_config_fixup_merge.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8809af46ff577d7b67154ebe7e2844fbd1a30e53 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/test-z_vcpkg_cmake_config_fixup_merge.cmake @@ -0,0 +1,56 @@ +# z_vcpkg_cmake_config_fixup_merge( ) +set(release_libs namespace::C++_shared) +set(debug_libs namespace::C++_shared) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged "namespace::C++_shared" +) + +set(release_libs A) +set(debug_libs B) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[\$<\$>:A>;\$<\$:B>]] +) + +set(release_libs A B) +set(debug_libs A ) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[A;\$<\$>:B>]] +) + +set(release_libs A ) +set(debug_libs A B) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[A;\$<\$:B>]] +) + +set(release_libs A C) +set(debug_libs C) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[\$<\$>:A>;\$<\$:C>;\$<\$>:C>]] +) + +set(release_libs [[\$<\$>:A>;\$<\$:B>]]) +set(debug_libs [[\$<\$>:A>;\$<\$:B>]]) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[\$<\$>:A>;\$<\$:B>]] +) + +set(release_libs optimized o1 debug d1) +set(debug_libs optimized o2 debug d2) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[\$<\$>:o1>;\$<\$:d2>]] +) + +set(release_libs debug d1 optimized o1) +set(debug_libs debug d2 optimized o2) +unit_test_check_variable_equal( + [[z_vcpkg_cmake_config_fixup_merge(merged release_libs debug_libs)]] + merged [[\$<\$:d2>;\$<\$>:o1>]] +) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..797a57c1c67446e4f755a4916cae7a8af354fb94 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/unit-test-cmake/vcpkg.json @@ -0,0 +1,49 @@ +{ + "name": "unit-test-cmake", + "version-string": "0", + "description": "Ensures that the CMake scripts are unit tested.", + "license": "MIT", + "supports": "x64", + "default-features": [ + "backup-restore-env-vars", + "fixup-pkgconfig", + "function-arguments", + "host-path-list", + "list", + "merge-libs", + "minimum-required", + "setup-pkgconfig-path" + ], + "features": { + "backup-restore-env-vars": { + "description": "Test the vcpkg_backup/restore_env_vars functions" + }, + "fixup-pkgconfig": { + "description": "Test the vcpkg_fixup_pkgconfig function" + }, + "function-arguments": { + "description": "Test the z_vcpkg_function_arguments function" + }, + "host-path-list": { + "description": "Test the vcpkg_host_path_list function" + }, + "list": { + "description": "Test the vcpkg_list function" + }, + "merge-libs": { + "description": "Test the z_vcpkg_cmake_config_fixup_merge_lists function", + "dependencies": [ + { + "name": "vcpkg-cmake-config", + "host": true + } + ] + }, + "minimum-required": { + "description": "Test the vcpkg_minimum_required function" + }, + "setup-pkgconfig-path": { + "description": "Test the z_vcpkg_setup/restore_pkgconfig_path functions" + } + } +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..7095dc682677c4a92e81deece2fc9786d8f14f72 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake @@ -0,0 +1,3 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_acquire_msys(MSYS_ROOT Z_ALL_PACKAGES) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..808294bbc59ccabc1e5cde16463b73cf9e24d081 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "vcpkg-acquire-msys-test", + "version-string": "0", + "port-version": 1, + "description": "Test port to exercise vcpkg_acquire_msys", + "supports": "x86 & windows" +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..bc785962c8d5de7c5d093e31055e90daf1c47ca3 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/portfile.cmake @@ -0,0 +1,4 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}/project") +vcpkg_cmake_build() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/project/CMakeLists.txt b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/project/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8bbcf70da0828961185a4acab3214d93344a01ac --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/project/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.12) + +project(embedresource-test VERSION 0.0.1) + +set(CMAKE_CXX_STANDARD 17) + +find_package(EmbedResource REQUIRED) + +file(SIZE "${CMAKE_CURRENT_LIST_DIR}/main.cpp" MAIN_CPP_FILE_SIZE) +file(SIZE "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" CMAKELISTS_TXT_FILE_SIZE) + +add_resource_library(sample_test_resources OBJECT RESOURCE_COLLECTION_NAME testdata1 RESOURCES main.cpp GENERATOR_COMMAND echo "CMakeLists.txt" GENERATOR_DEPEND CMakeLists.txt) +add_resource_library(testdata3 OBJECT RESOURCES main.cpp) + +macro(setup_target target) + target_add_resource(${target} RESOURCE_COLLECTION_NAME testdata2 RESOURCES main.cpp) + get_target_property(type ${target} TYPE) + if ("${type}" STREQUAL "STATIC_LIBRARY") + target_link_libraries(${target} PRIVATE $ $) + else() + target_link_libraries(${target} PRIVATE sample_test_resources testdata3) + endif() + + target_compile_definitions(${target} PRIVATE MAIN_CPP_FILE_SIZE=${MAIN_CPP_FILE_SIZE}) + target_compile_definitions(${target} PRIVATE CMAKELISTS_TXT_FILE_SIZE=${CMAKELISTS_TXT_FILE_SIZE}) +endmacro() + +add_executable(sample_test_exe main.cpp) +setup_target(sample_test_exe) + +add_library(sample_test_shlib SHARED main.cpp) +target_compile_features(sample_test_shlib PRIVATE cxx_std_20) +setup_target(sample_test_shlib) + +add_library(sample_test_lib STATIC main.cpp) +setup_target(sample_test_lib) + +install(TARGETS sample_test_shlib EXPORT sample_test_shlib) +install(EXPORT sample_test_shlib FILE sampleTargets.cmake DESTINATION cmake) + +install(TARGETS sample_test_lib EXPORT sample_test_lib) +install(EXPORT sample_test_lib FILE sampleTargets.cmake DESTINATION cmake) + +enable_testing() +add_test(NAME sample_test_exe COMMAND sample_test_exe) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/project/main.cpp b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/project/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39d7a8304f261336b8c2a0cb2432cc144378af2d --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/project/main.cpp @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include + +DECLARE_RESOURCE_COLLECTION(testdata1); +DECLARE_RESOURCE_COLLECTION(testdata2); +DECLARE_RESOURCE_COLLECTION(testdata3); +DECLARE_RESOURCE(testdata3, main_cpp); + +void verify_resource(ResourceLoader const& r) +{ + if (r.name() == L"main.cpp") + { +#ifdef __cpp_lib_span + if (r.template data().size() != MAIN_CPP_FILE_SIZE) { throw std::runtime_error("r.data.len() != MAIN_CPP_FILE_SIZE"); } +#endif +#ifdef __cpp_lib_string_view + if (r.string().size() != MAIN_CPP_FILE_SIZE) { throw std::runtime_error("r.string().size() != MAIN_CPP_FILE_SIZE"); } +#endif + } + else if (r.name() == L"CMakeLists.txt") + { +#ifdef __cpp_lib_span + if (r.template data().size() != CMAKELISTS_TXT_FILE_SIZE) + { + throw std::runtime_error("r.data.len() != CMAKELISTS_TXT_FILE_SIZE"); + } +#endif +#ifdef __cpp_lib_string_view + if (r.string().size() != CMAKELISTS_TXT_FILE_SIZE) { throw std::runtime_error("r.string().size() != CMAKELISTS_TXT_FILE_SIZE"); } +#endif + } + else { throw std::runtime_error("Unknown resource name"); } +} + +int main(int argc, char* argv[]) +try +{ + std::string_view res = LOAD_RESOURCE(testdata3, main_cpp).data; + if (res.size() != MAIN_CPP_FILE_SIZE) { throw std::runtime_error("r.data.len() != MAIN_CPP_FILE_SIZE"); } + + auto resourceCollection1 = LOAD_RESOURCE_COLLECTION(testdata1); + for (auto const r : resourceCollection1) { verify_resource(r); } + + auto resourceCollection2 = LOAD_RESOURCE_COLLECTION(testdata2); + for (auto const r : resourceCollection2) { verify_resource(r); } + + auto resourceCollection3 = LOAD_RESOURCE_COLLECTION(testdata3); + for (auto const r : resourceCollection2) { verify_resource(r); } + + return 0; +} catch (const std::exception& ex) +{ + std::cerr << "Failed: " << ex.what() << std::endl; + return -1; +} \ No newline at end of file diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..1c13e817687ad541422e04aa1300e9c378d1b88a --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-ankurvdev-embedresource/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "vcpkg-ci-ankurvdev-embedresource", + "version-string": "ci", + "description": "Validates ankurvdev-embedresource", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "ankurvdev-embedresource" + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-arrow/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-arrow/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..46a179430135d30897e0a1ca68f950b183ac0ce4 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-arrow/portfile.cmake @@ -0,0 +1,10 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ARROW_LINK_SHARED) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_INSTALLED_DIR}/share/arrow/example" + OPTIONS + -DARROW_LINK_SHARED=${ARROW_LINK_SHARED} +) +vcpkg_cmake_build() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-arrow/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-arrow/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..b5e4ed3458ddb478b9eab1ff2da57c6e3e0685b4 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-arrow/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "vcpkg-ci-arrow", + "version-date": "2022-07-25", + "description": "Builds an example app in order to validate the arrow port.", + "license": "Apache-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "arrow", + "default-features": false, + "features": [ + "csv", + "example" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-boost/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-boost/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0015715fb66c72d00816219213a54ae283d41746 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-boost/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-boost/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-boost/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..472288ac0960a029e935c85487abb80e692ae8e1 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-boost/vcpkg.json @@ -0,0 +1,81 @@ +{ + "name": "vcpkg-ci-boost", + "version": "1", + "description": "Boost features testing within CI.", + "dependencies": [ + { + "name": "boost", + "default-features": false, + "features": [ + "mpi" + ], + "platform": "!staticcrt & !(arm & windows) & !uwp" + }, + { + "name": "boost-asio", + "default-features": false, + "features": [ + "ssl" + ] + }, + { + "name": "boost-fiber", + "default-features": false, + "features": [ + "numa" + ], + "platform": "!uwp & !arm & !emscripten" + }, + { + "name": "boost-locale", + "default-features": false, + "features": [ + "icu" + ], + "platform": "!uwp" + }, + { + "name": "boost-mpi", + "default-features": false, + "features": [ + "python3" + ], + "platform": "!staticcrt & !static & !uwp & !(arm & windows)" + }, + { + "name": "boost-odeint", + "default-features": false + }, + { + "name": "boost-odeint", + "default-features": false, + "features": [ + "mpi" + ], + "platform": "!staticcrt & !uwp & !(windows & arm)" + }, + { + "name": "boost-python", + "default-features": false, + "features": [ + "python3" + ], + "platform": "!emscripten & !ios & !android & !uwp" + }, + { + "name": "boost-python", + "default-features": false, + "features": [ + "python2" + ], + "platform": "!android & !emscripten & !ios & !(arm & osx) & !(arm & windows) & !uwp" + }, + { + "name": "boost-regex", + "default-features": false, + "features": [ + "icu" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-curl/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-curl/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..065116c276adcf960cd9ad806097da3f199e2241 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-curl/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-curl/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-curl/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..87315e1dbaa17378789924601aabb3300e79b593 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-curl/vcpkg.json @@ -0,0 +1,40 @@ +{ + "name": "vcpkg-ci-curl", + "version-date": "2024-03-05", + "description": "Port to force features of certain ports within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "curl", + "features": [ + "http2", + "zstd" + ] + }, + { + "$comment": "Known to break aws-sdk-cpp.", + "name": "curl", + "features": [ + "brotli" + ], + "platform": "!osx" + }, + { + "$comment": "Known to be fixed by libidn2 update.", + "name": "curl", + "features": [ + "idn" + ], + "platform": "!android" + }, + { + "name": "curl", + "features": [ + "ldap", + "tool" + ], + "platform": "!android & !uwp" + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-gdal/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-gdal/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..065116c276adcf960cd9ad806097da3f199e2241 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-gdal/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-gdal/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-gdal/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..65735929715006dcdbe44d0e15792434ec82eac6 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-gdal/vcpkg.json @@ -0,0 +1,45 @@ +{ + "name": "vcpkg-ci-gdal", + "version-date": "2023-12-28", + "description": "Port to force features of certain ports within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "gdal", + "features": [ + "freexl" + ] + }, + { + "name": "gdal", + "features": [ + "postgresql" + ], + "platform": "linux" + }, + { + "name": "gdal", + "features": [ + "cfitsio", + "kea", + "poppler" + ], + "platform": "native" + }, + { + "name": "gdal", + "features": [ + "mysql-libmariadb" + ], + "platform": "windows & x86" + }, + { + "name": "gdal", + "features": [ + "aws-ec2-windows" + ], + "platform": "windows & !mingw" + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-libgit2/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-libgit2/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..065116c276adcf960cd9ad806097da3f199e2241 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-libgit2/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..f4c01aa8ccf62ad504132a8bcdaeb31d6c0cbdea --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "vcpkg-ci-libgit2", + "version-string": "ci", + "description": "Validates libgit2 with ssh and tools.", + "dependencies": [ + { + "name": "libgit2", + "default-features": false, + "features": [ + "ssh", + "tools" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mathgl/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mathgl/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..065116c276adcf960cd9ad806097da3f199e2241 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mathgl/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mathgl/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mathgl/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..a7976a1612665d838750e4473192940ff26d768c --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mathgl/vcpkg.json @@ -0,0 +1,26 @@ +{ + "name": "vcpkg-ci-mathgl", + "version-date": "2022-12-28", + "description": "Ensures that the vcpkg CI build of mathgl tests all features and examples", + "license": "MIT", + "dependencies": [ + { + "name": "mathgl", + "features": [ + "arma", + "examples", + "fltk", + "gif", + "glut", + "gsl", + "hdf5", + "jpeg", + "opengl", + "png", + "qt5", + "wx", + "zlib" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mongo-cxx-driver/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mongo-cxx-driver/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..065116c276adcf960cd9ad806097da3f199e2241 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mongo-cxx-driver/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mongo-cxx-driver/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mongo-cxx-driver/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..3eb7d0392939ce027931234e879eb4b5d383d7a1 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-mongo-cxx-driver/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "vcpkg-ci-mongo-cxx-driver", + "version-date": "2022-11-18", + "description": "Ensures that the vcpkg CI build of mongo-cxx-driver includes feature boost", + "license": "MIT", + "dependencies": [ + { + "name": "mongo-cxx-driver", + "features": [ + "boost" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-msys2/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-msys2/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fe2753e7c2079c851544c41c868953ac0a15c7f6 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-msys2/portfile.cmake @@ -0,0 +1,364 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +set(msys_repo_url "https://mirror.msys2.org/msys/x86_64") +set(mingw64_repo_url "https://mirror.msys2.org/mingw/mingw64") +set(mingw32_repo_url "https://mirror.msys2.org/mingw/mingw32") +set(clangarm64_repo_url "https://mirror.msys2.org/mingw/clangarm64") + +# Ignore these updates (e.g. for known problems) +vcpkg_list(SET ignored_updates + https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-ca-certificates-20211016-3-any.pkg.tar.zst +) + +# Known removals that shall not be reported as errors +# (Packages to be removed from vcpkg scripts ASAP.) +vcpkg_list(SET known_delisted + libcrypt +) + +# Ignore these dependencies (e.g. interactive or effectively optional) +vcpkg_list(SET ignored_dependencies + autoconf2.13 autoconf2.69 autoconf2.71 + automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 + db + gdbm + info + less + libiconv-devel + libltdl + mingw-w64-x86_64-tzdata +) + +# Ignore these provides (e.g. effectively optional) +vcpkg_list(SET ignored_provides + gnome-common + perl-Archive-Tar perl-Attribute-Handlers perl-AutoLoader perl-CPAN-Meta-Requirements perl-CPAN-Meta-YAML perl-CPAN-Meta perl-CPAN perl-Carp perl-Compress-Raw-Bzip2 perl-Compress-Raw-Zlib perl-Config-Perl-V perl-DB_File perl-Data-Dumper perl-Devel-PPPort perl-Devel-SelfStubber perl-Digest-MD5 perl-Digest-SHA perl-Digest perl-Dumpvalue perl-Encode perl-Env perl-Exporter perl-ExtUtils-CBuilder perl-ExtUtils-Constant perl-ExtUtils-Install perl-ExtUtils-MakeMaker perl-ExtUtils-Manifest perl-ExtUtils-PL2Bat perl-ExtUtils-ParseXS perl-File-Fetch perl-File-Path perl-File-Temp perl-Filter-Simple perl-Filter-Util-Call perl-FindBin perl-Getopt-Long perl-HTTP-Tiny perl-I18N-Collate perl-I18N-LangTags perl-IO-Compress perl-IO-Socket-IP perl-IO-Zlib perl-IO perl-IPC-Cmd perl-IPC-SysV perl-JSON-PP perl-Locale-Maketext-Simple perl-Locale-Maketext perl-MIME-Base64 perl-Math-BigInt-FastCalc perl-Math-BigInt perl-Math-BigRat perl-Math-Complex perl-Memoize perl-Module-CoreList perl-Module-Load-Conditional perl-Module-Load perl-Module-Loaded perl-Module-Metadata perl-NEXT perl-Net-Ping perl-Params-Check perl-PathTools perl-Perl-OSType perl-PerlIO-via-QuotedPrint perl-Pod-Checker perl-Pod-Escapes perl-Pod-Perldoc perl-Pod-Simple perl-Pod-Usage perl-Safe perl-Scalar-List-Utils perl-Search-Dict perl-SelfLoader perl-Socket perl-Storable perl-Sys-Syslog perl-Term-ANSIColor perl-Term-Cap perl-Term-Complete perl-Term-ReadLine perl-Test-Harness perl-Test-Simple perl-Test perl-Text-Abbrev perl-Text-Balanced perl-Text-ParseWords perl-Text-Tabs perl-Thread-Queue perl-Thread-Semaphore perl-Tie-File perl-Tie-RefHash perl-Time-HiRes perl-Time-Local perl-Time-Piece perl-Unicode-Collate perl-Unicode-Normalize perl-Win32 perl-Win32API-File perl-XSLoader perl-autodie perl-autouse perl-base perl-bignum perl-constant perl-encoding-warnings perl-experimental perl-if perl-lib perl-libnet perl-parent perl-perlfaq perl-podlators perl-threads-shared perl-threads perl-version +) + + +string(TIMESTAMP now "%s" UTC) + +function(age_in_days out_var timestamp) + set(age "") + if(timestamp) + math(EXPR age "(${now} - ${timestamp}) / 3600 / 24") + endif() + set(${out_var} "${age}" PARENT_SCOPE) +endfunction() + +function(pretty_age out_var age_in_days) + if(age_in_days STREQUAL "") + set(${out_var} "(timestamp unknown)" PARENT_SCOPE) + else() + set(${out_var} "(${age_in_days} days ago)" PARENT_SCOPE) + endif() +endfunction() + +function(get_vcpkg_builddate out_var name) + if(NOT DEFINED Z_VCPKG_MSYS_${name}_ARCHIVE) + z_vcpkg_acquire_msys_download_package(Z_VCPKG_MSYS_${name}_ARCHIVE + URL "${Z_VCPKG_MSYS_${name}_URL}" + SHA512 "${Z_VCPKG_MSYS_${name}_SHA512}" + FILENAME "${Z_VCPKG_MSYS_${name}_FILENAME}" + ) + set(Z_VCPKG_MSYS_${name}_ARCHIVE "${Z_VCPKG_MSYS_${name}_ARCHIVE}" PARENT_SCOPE) + endif() + set(pkginfo_dir "${CURRENT_BUILDTREES_DIR}/vcpkg") + file(REMOVE_RECURSE "${pkginfo_dir}/${name}.txt" "${pkginfo_dir}/_tmp") + file(MAKE_DIRECTORY "${pkginfo_dir}/_tmp") + execute_process( + COMMAND "${CMAKE_COMMAND}" -E tar xzf "${Z_VCPKG_MSYS_${name}_ARCHIVE}" .PKGINFO + WORKING_DIRECTORY "${pkginfo_dir}/_tmp" + ) + file(RENAME "${pkginfo_dir}/_tmp/.PKGINFO" "${pkginfo_dir}/${name}.txt") + file(STRINGS "${pkginfo_dir}/${name}.txt" builddate REGEX "builddate = [0-9]+") + string(REPLACE "builddate = " "" builddate "${builddate}") + set(${out_var} "${builddate}" PARENT_SCOPE) +endfunction() + +function(get_vcpkg_provides out_var name) + if(NOT DEFINED Z_VCPKG_MSYS_${name}_ARCHIVE) + z_vcpkg_acquire_msys_download_package(Z_VCPKG_MSYS_${name}_ARCHIVE + URL "${Z_VCPKG_MSYS_${name}_URL}" + SHA512 "${Z_VCPKG_MSYS_${name}_SHA512}" + FILENAME "${Z_VCPKG_MSYS_${name}_FILENAME}" + ) + set(Z_VCPKG_MSYS_${name}_ARCHIVE "${Z_VCPKG_MSYS_${name}_ARCHIVE}" PARENT_SCOPE) + endif() + set(pkginfo_dir "${CURRENT_BUILDTREES_DIR}/vcpkg") + file(REMOVE_RECURSE "${pkginfo_dir}/${name}.txt" "${pkginfo_dir}/_tmp") + file(MAKE_DIRECTORY "${pkginfo_dir}/_tmp") + execute_process( + COMMAND "${CMAKE_COMMAND}" -E tar xzf "${Z_VCPKG_MSYS_${name}_ARCHIVE}" .PKGINFO + WORKING_DIRECTORY "${pkginfo_dir}/_tmp" + ) + file(RENAME "${pkginfo_dir}/_tmp/.PKGINFO" "${pkginfo_dir}/${name}.txt") + file(STRINGS "${pkginfo_dir}/${name}.txt" provides REGEX "provides = .+") + string(REPLACE "provides = " "" provides "${provides}") + set(${out_var} "${provides}" PARENT_SCOPE) +endfunction() + +function(update_vcpkg_download script_file name new_url) + message(STATUS "- Updating vcpkg...") + if(NOT new_url MATCHES [[^https://mirror\.msys2\.org/.*/(([^/]*)-[^-/]+-[^-/]+-[^-/]+\.pkg\.tar\.(xz|zst))$]]) + message(FATAL_ERROR "Supplied URL does not match the expected pattern: ${arg_URL}") + endif() + set(filename "msys2-${CMAKE_MATCH_1}") + vcpkg_download_distfile(archive + URLS "${new_url}" + FILENAME "${filename}" + SKIP_SHA512 + ) + execute_process( + COMMAND "${CMAKE_COMMAND}" -E sha512sum "${archive}" + OUTPUT_VARIABLE sha512 + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX REPLACE " .*" "" sha512 "${sha512}") + vcpkg_replace_string("${SCRIPTS}/cmake/${script_file}" "${Z_VCPKG_MSYS_${name}_URL}" "${new_url}") + vcpkg_replace_string("${SCRIPTS}/cmake/${script_file}" "${Z_VCPKG_MSYS_${name}_SHA512}" "${sha512}") +endfunction() + +function(pretty_dependencies out_var list_name) + foreach(dependency IN LISTS ignored_dependencies) + list(TRANSFORM ${list_name} REPLACE "^${dependency}\$" "(${dependency})") + endforeach() + list(JOIN ${list_name} " " list_string) + set(${out_var} "${list_string}" PARENT_SCOPE) +endfunction() + +function(analyze_package_list list_var script) + message(STATUS "*** Analyzing packages in '${script}'") + vcpkg_list(SET critical) # Packages which can be upgraded and are fairly old in vcpkg + vcpkg_list(SET mismatched_deps) # Packages which have vcpkg deps different from msys2 deps + vcpkg_list(SET missing) # Packages used in (new) deps but not declared + vcpkg_list(SET upgradable) # Packages which can be upgrade but are fairly fresh in vcpkg + vcpkg_list(SET vanished) # Packages which vanished from the msys2 database + + # Preload details from direct packages + foreach(name IN LISTS ${list_var}) + if(NOT Z_VCPKG_MSYS_${name}_DIRECT) + continue() + endif() + get_vcpkg_provides(vcpkg_provides "${name}") + set(Z_VCPKG_MSYS_${name}_PROVIDES "${vcpkg_provides}") + foreach(provided IN LISTS vcpkg_provides) + set(Z_VCPKG_MSYS_${provided}_PROVIDED_BY "${name}") + endforeach() + endforeach() + + # msys2.org removes packages 1.75 years after it was removed from the active database, + # cf. https://www.msys2.org/docs/faq/#how-long-are-old-packages-kept-on-repomsys2org + # We don't know the date of that replacement, and mirrors might use a shorter time. + # But we can compare the build date of the package currently downloaded by vcpkg + # and the build date of the package in the msys2 database. + # If this time span exceeds 'max_age', an update is marked as critical. + set(max_age 365) # days + math(EXPR minimum_builddate "${now} - 6 * 30 * 24 * 3600") + foreach(name IN LISTS ${list_var}) + if(Z_VCPKG_MSYS_${name}_DIRECT) + message(STATUS "${name} (DIRECT)") + elseif("DIRECT_ONLY" IN_LIST ARGN) + continue() + else() + message(STATUS "${name}") + endif() + set(vcpkg_url "${Z_VCPKG_MSYS_${name}_URL}") + set(vcpkg_deps "${Z_VCPKG_MSYS_${name}_DEPS}") + set(vcpkg_provides "${Z_VCPKG_MSYS_${name}_PROVIDES}") + + set(repo "msys") + if(name MATCHES "^mingw-w64-x86_64") + set(repo "mingw64") + elseif(name MATCHES "^mingw-w64-i686") + set(repo "mingw32") + elseif(name MATCHES "^mingw-w64-clang-aarch64") + set(repo "clangarm64") + endif() + + file(GLOB files "${${repo}_repo_files}/${name}-*/desc") + set(found 0) + foreach(file IN LISTS files) + # Find the package + file(STRINGS "${file}" desc) + if(NOT desc MATCHES "%NAME%;${name};") + continue() + elseif(NOT desc MATCHES "%FILENAME%;([^;]+)") + continue() + endif() + set(found 1) + set(current_url "${${repo}_repo_url}/${CMAKE_MATCH_1}") + # Check the URL + if(NOT vcpkg_url STREQUAL current_url AND NOT current_url IN_LIST ignored_updates) + get_vcpkg_builddate(vcpkg_builddate "${name}") + age_in_days(vcpkg_age "${vcpkg_builddate}") + pretty_age(vcpkg_age_pretty "${vcpkg_age}") + set(current_age "") + if(desc MATCHES "%BUILDDATE%;([0-9]+)") + age_in_days(current_age "${CMAKE_MATCH_1}") + endif() + pretty_age(current_age_string "${current_age}") + message(STATUS "- vcpkg: ${vcpkg_url} ${vcpkg_age_pretty}") + message(STATUS "+ msys2: ${current_url} ${current_age_string}") + + set(age_diff "0") + if(NOT vcpkg_age STREQUAL "" AND NOT current_age STREQUAL "") + math(EXPR age_diff "${current_age} - ${vcpkg_age}") + endif() + if(age_diff GREATER max_age) + if("update-all" IN_LIST FEATURES) + update_vcpkg_download("${script}" "${name}" "${current_url}") + else() + vcpkg_list(APPEND critical "${name}") + endif() + elseif(NOT vcpkg_url STREQUAL current_url) + if("update-all" IN_LIST FEATURES) + update_vcpkg_download("${script}" "${name}" "${current_url}") + else() + vcpkg_list(APPEND upgradable "${name}") + endif() + endif() + endif() + # Check the dependencies + if(desc MATCHES "%DEPENDS%;([^%]*)" OR vcpkg_deps) + list(JOIN CMAKE_MATCH_1 " " current_deps) + separate_arguments(current_deps UNIX_COMMAND "${current_deps}") + list(TRANSFORM current_deps REPLACE "[<=>].*" "") + list(SORT current_deps) + list(SORT vcpkg_deps) + pretty_dependencies(current_deps_string current_deps) + if(Z_VCPKG_MSYS_${name}_DIRECT AND NOT current_deps STREQUAL "") + message(STATUS "* msys2 dependencies: ${current_deps_string}") + elseif(NOT vcpkg_deps STREQUAL current_deps) + pretty_dependencies(vcpkg_deps_string vcpkg_deps) + message(STATUS "- vcpkg dependencies: ${vcpkg_deps_string}") + message(STATUS "+ msys2 dependencies: ${current_deps_string}") + list(REMOVE_ITEM current_deps ${ignored_dependencies}) + if(NOT vcpkg_deps STREQUAL current_deps) + vcpkg_list(APPEND mismatched_deps "${name}") + endif() + list(REMOVE_ITEM current_deps ${known_packages} ${${list_var}} ${ignored_dependencies}) + set(missing_deps "") + foreach(dep IN LISTS current_deps) + if(NOT DEFINED Z_VCPKG_MSYS_${dep}_PROVIDED_BY) + list(APPEND missing_deps "${dep}") + endif() + endforeach() + if(missing_deps) + list(JOIN missing_deps " " missing_deps_string) + message(STATUS "! unknown dependencies: ${missing_deps_string}") + vcpkg_list(APPEND missing ${missing_deps}) + endif() + endif() + endif() + # Check the "provides" + if(desc MATCHES "%PROVIDES%;([^%]*)" OR vcpkg_provides) + list(JOIN CMAKE_MATCH_1 " " current_provides) + separate_arguments(current_provides UNIX_COMMAND "${current_provides}") + list(TRANSFORM current_provides REPLACE "[<=>].*" "") + list(REMOVE_ITEM current_provides ${ignored_provides}) + list(JOIN vcpkg_provides " " vcpkg_provides_string) + if(NOT vcpkg_provides STREQUAL current_provides) + list(JOIN vcpkg_provides " " vcpkg_provides_string) + list(JOIN current_provides " " current_provides_string) + message(STATUS "- vcpkg provides: ${vcpkg_provides_string}") + message(STATUS "+ msys2 provides: ${current_provides_string}") + elseif(NOT vcpkg_provides STREQUAL "") + message(STATUS "* provides: ${vcpkg_provides_string}") + endif() + endif() + endforeach() + if(NOT found AND NOT name IN_LIST known_delisted) + vcpkg_list(APPEND vanished "${name}") + get_vcpkg_builddate(vcpkg_builddate "${name}") + age_in_days(vcpkg_age "${vcpkg_builddate}") + pretty_age(vcpkg_age_pretty "${vcpkg_age}") + message(STATUS "- vcpkg: ${vcpkg_url} ${vcpkg_age_pretty}") + message(STATUS "! msys2: no match for ${name}") + + age_in_days(current_age "${now}") + set(age_diff "0") + if(NOT vcpkg_age STREQUAL "" AND NOT current_age STREQUAL "") + math(EXPR age_diff "${current_age} - ${vcpkg_age}") + endif() + if(age_diff GREATER max_age) + vcpkg_list(APPEND critical "${name}") + endif() + endif() + endforeach() + + if(mismatched_deps) + list(JOIN mismatched_deps " " mismatched_deps) + message(WARNING "The following msys2 packages have changed dependencies: ${mismatched_deps}") + endif() + if(missing) + list(SORT missing) + list(REMOVE_DUPLICATES missing) + list(JOIN missing " " missing) + message(WARNING "The following msys2 packages would be needed to update all dependencies: ${missing}") + endif() + if(upgradable) + list(JOIN upgradable " " upgradable) + message(WARNING "The following msys2 packages could be updated: ${upgradable}") + endif() + if(critical) + list(JOIN critical " " critical) + message(SEND_ERROR "The following msys2 packages were build more than 6 months ago and should be updated: ${critical}") + endif() + if(vanished) + list(JOIN vanished " " vanished) + message(SEND_ERROR "The following msys2 packages are no longer in the database: ${vanished}") + endif() + message(STATUS "*** Analyzing packages in '${script}' done") +endfunction() + +message(STATUS "*** Downloading current msys2 package lists") +string(TIMESTAMP stamp "%Y-%m-%d" UTC) +foreach(repo IN ITEMS msys mingw32 mingw64 clangarm64) + string(REPLACE "/" "-" local_file "msys2-${stamp}-${repo}.files") + set(archive "${DOWNLOADS}/${local_file}") + vcpkg_download_distfile(repo_files_archive + URLS "${${repo}_repo_url}/${repo}.files" + FILENAME "${local_file}" + SKIP_SHA512 + ) + vcpkg_extract_source_archive(repo_files + ARCHIVE "${repo_files_archive}" + NO_REMOVE_ONE_LEVEL + ) + set(${repo}_repo_files "${repo_files}") +endforeach() +message(STATUS "*** Downloading current msys2 package lists done") + +set(Z_VCPKG_MSYS_PACKAGES_RESOLVED "" CACHE INTERNAL "") +vcpkg_acquire_msys(msys_root Z_ALL_PACKAGES) +analyze_package_list(Z_VCPKG_MSYS_PACKAGES_RESOLVED "vcpkg_acquire_msys.cmake") +set(known_packages "${Z_VCPKG_MSYS_PACKAGES_RESOLVED}") + +set(Z_VCPKG_MSYS_PACKAGES_RESOLVED "" CACHE INTERNAL "") +vcpkg_find_acquire_program(PKGCONFIG) +vcpkg_acquire_msys(msys_root + NO_DEFAULT_PACKAGES + Z_DECLARE_EXTRA_PACKAGES_COMMAND "z_vcpkg_find_acquire_pkgconfig_msys_declare_packages" + PACKAGES + mingw-w64-clang-aarch64-pkgconf + mingw-w64-x86_64-pkgconf + mingw-w64-i686-pkgconf +) +analyze_package_list(Z_VCPKG_MSYS_PACKAGES_RESOLVED "vcpkg_find_acquire_program(PKGCONFIG).cmake") + +set(CMAKE_Fortran_COMPILER "") +if(NOT VCPKG_TARGET_IS_WINDOWS) + set(CMAKE_Fortran_COMPILER "true") +endif() +set(Z_VCPKG_MSYS_PACKAGES_RESOLVED "" CACHE INTERNAL "") +include("${SCRIPTS}/cmake/vcpkg_find_fortran.cmake") +vcpkg_find_fortran(FORTRAN) +vcpkg_acquire_msys(msys_root + NO_DEFAULT_PACKAGES + Z_DECLARE_EXTRA_PACKAGES_COMMAND "z_vcpkg_find_fortran_msys_declare_packages" + PACKAGES + mingw-w64-x86_64-gcc-fortran + mingw-w64-i686-gcc-fortran +) +analyze_package_list(Z_VCPKG_MSYS_PACKAGES_RESOLVED "vcpkg_find_fortran.cmake") diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-msys2/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-msys2/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..039d3df819996a3afdfbf2221643d1cc6279fed1 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-msys2/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "vcpkg-ci-msys2", + "version": "1", + "description": "Test vcpkg msys2 freshness", + "license": "MIT", + "supports": "(windows | mingw) & native", + "features": { + "update-all": { + "description": "Update all outdated packages in vcpkg_acquire_msys.cmake" + } + } +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-nanobind/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-nanobind/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c8d43663ddbb320c6a4d0e1e36b402b1137af514 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-nanobind/portfile.cmake @@ -0,0 +1,25 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +# This test does not support cross-compilation due to nanobind's usage of the +# Python interpreter to figure out Python module suffix. +if(VCPKG_CROSSCOMPILING) + message(WARNING "Skipping vcpkg-ci-nanobind because it is not expected to work when cross-compiling") + return() +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO wjakob/nanobind_example + REF 4b5c9bd484dec77e085a188dcefc536aed69aae9 + SHA512 ec7eeb25b5c5ee2e8bbcc48e78719dc6e5211cf54794dd3c370ad3e8d685fbc8b79435890da3b9481656169efaa87b77e3ea55ce864efd670dd9ea0600dee77d + HEAD_REF master +) + +# This is needed to correctly build/link against a debug build of Python on +# Windows +string(APPEND VCPKG_CXX_FLAGS_DEBUG " -DPy_DEBUG") +string(APPEND VCPKG_C_FLAGS_DEBUG " -DPy_DEBUG") + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}") + +vcpkg_cmake_build() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-nanobind/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-nanobind/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..5cd7db5522cd97d7daf0de7443af7e2341123397 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-nanobind/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "vcpkg-ci-nanobind", + "version": "0.0.1", + "description": "A nanobind example project", + "homepage": "https://nanobind.readthedocs.io/en/latest/", + "license": "BSD-3-Clause", + "dependencies": [ + "nanobind", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} + diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-openimageio/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-openimageio/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0015715fb66c72d00816219213a54ae283d41746 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-openimageio/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-openimageio/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-openimageio/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..0d449b94a5578d00ce951619699bfd3adf8b8afd --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-openimageio/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "vcpkg-ci-openimageio", + "version": "1", + "description": "OpenImageIO features testing within CI.", + "license": "MIT", + "dependencies": [ + { + "name": "openimageio", + "features": [ + "ffmpeg", + "freetype", + "gif", + "libraw", + "opencv", + "openjpeg", + "pybind11", + "tools", + "webp" + ] + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0015715fb66c72d00816219213a54ae283d41746 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-paraview/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-paraview/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..d0c7c1bcc24fbd170aa8dd28e753b23a88d7bb67 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-paraview/vcpkg.json @@ -0,0 +1,52 @@ +{ + "name": "vcpkg-ci-paraview", + "version-date": "2022-12-01", + "description": "Port to force features of certain ports within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "paraview", + "default-features": false, + "features": [ + "tools" + ], + "platform": "x86 & windows" + }, + { + "name": "paraview", + "default-features": false, + "features": [ + "python", + "mpi" + ], + "platform": "!(windows & static) & !x86" + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "gdal", + "utf8" + ], + "platform": "!x86" + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "openvr" + ], + "platform": "!osx & !(windows & staticcrt)" + }, + { + "name": "paraview", + "default-features": false, + "features": [ + "tools", + "vtkm" + ], + "platform": "!(x86 & windows)" + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-skia/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-skia/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b9d37ddd6cdf0680e6fd2f33103966982aa5dab3 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-skia/portfile.cmake @@ -0,0 +1,6 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_INSTALLED_DIR}/share/skia/example" +) +vcpkg_cmake_build() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-skia/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-skia/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..aa54a4d263574f4dc56f7479555ce21a49e267c2 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-skia/vcpkg.json @@ -0,0 +1,48 @@ +{ + "name": "vcpkg-ci-skia", + "version-date": "2023-12-22", + "description": "Builds an app in order to validate the skia port.", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "skia", + "default-features": false + }, + { + "name": "skia", + "default-features": false, + "features": [ + "metal" + ], + "platform": "osx" + }, + { + "name": "skia", + "default-features": false, + "features": [ + "dawn" + ], + "platform": "linux" + }, + { + "name": "skia", + "default-features": false, + "features": [ + "graphite" + ], + "platform": "windows & !uwp" + }, + { + "name": "skia", + "default-features": false, + "features": [ + "vulkan" + ], + "platform": "linux | osx | (windows & !uwp)" + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..bc785962c8d5de7c5d093e31055e90daf1c47ca3 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/portfile.cmake @@ -0,0 +1,4 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}/project") +vcpkg_cmake_build() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/project/CMakeLists.txt b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/project/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..31535c1b8f0eed7256b897ae0c40c4b8825dbbd0 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/project/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.7) +project(soci-test CXX) + +if(APPLE) + set(CMAKE_CXX_STANDARD 11) +endif() + +add_executable(main main.cpp) + +find_package(SOCI CONFIG REQUIRED) +target_link_libraries(main PRIVATE $,SOCI::soci_mysql,SOCI::soci_mysql_static>) +target_link_libraries(main PRIVATE $,SOCI::soci_postgresql,SOCI::soci_postgresql_static>) +target_link_libraries(main PRIVATE $,SOCI::soci_sqlite3,SOCI::soci_sqlite3_static>) diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/project/main.cpp b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/project/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..86377acc547a1dc30e322a5a330058609c299fbe --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/project/main.cpp @@ -0,0 +1,11 @@ +#include +#include +#include +#include + +int main() +{ + soci::session mysql_db(soci::mysql, "test:mysql"); + soci::session pgsql_db(soci::postgresql, "test:postgresql"); + soci::session sqlite3_db(soci::sqlite3, "test.db"); +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..8ff0c2916013b099997ebb7988afe0343ce21e06 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-ci-soci/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "vcpkg-ci-soci", + "version-string": "ci", + "description": "Validates soci", + "supports": "x64 & (linux | osx | windows) & !uwp", + "dependencies": [ + { + "name": "soci", + "features": [ + "mysql", + "postgresql", + "sqlite3" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-fix-rpath/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-fix-rpath/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..532c247d881a29c64854025857d00a677a8ceca7 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-fix-rpath/portfile.cmake @@ -0,0 +1,122 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +# Test for empty string +set(elf_dir "${CURRENT_PACKAGES_DIR}/lib") +set(test_rpath "") +set(expected "$ORIGIN") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() + +# Test for empty string in the tools directory +set(elf_dir "${CURRENT_PACKAGES_DIR}/tools/hdf5") +set(test_rpath "") +set(expected "$ORIGIN:$ORIGIN/../../lib") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() + +# Simple replacement and outside path test +set(elf_dir "${CURRENT_PACKAGES_DIR}/lib") +set(test_rpath "${CURRENT_PACKAGES_DIR}/lib:/usr/lib/") +set(expected "$ORIGIN") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() + +# Simple pkgconfig path and outside path test +set(elf_dir "${CURRENT_PACKAGES_DIR}/lib/") +set(test_rpath "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/../../lib:/usr/lib/") +set(expected "$ORIGIN") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() + +# elf dir in subdir +set(elf_dir "${CURRENT_PACKAGES_DIR}/lib/somesubdir") +set(test_rpath "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/../../lib:/usr/lib/") +set(expected "$ORIGIN:$ORIGIN/..") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() + +# Getting more complex +set(elf_dir "${CURRENT_PACKAGES_DIR}/plugins/notlib/extrasubdir") +set(test_rpath "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib/someotherdir2:${CURRENT_INSTALLED_DIR}/lib/pkgconfig/../../someotherdir1:/usr/lib/") +set(expected "$ORIGIN:$ORIGIN/../../../lib:$ORIGIN/../../../lib/someotherdir2:$ORIGIN/../../../someotherdir1") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() + + +set(X_VCPKG_RPATH_KEEP_SYSTEM_PATHS ON) +# Simple replacement and outside path test +set(elf_dir "${CURRENT_PACKAGES_DIR}/lib") +set(test_rpath "${CURRENT_PACKAGES_DIR}/lib:/usr/lib/") +set(expected "$ORIGIN:/usr/lib") + +z_vcpkg_calculate_corrected_rpath( + ELF_FILE_DIR "${elf_dir}" + ORG_RPATH "${test_rpath}" + OUT_NEW_RPATH_VAR new_rpath +) + +if(NOT "x${new_rpath}x" STREQUAL "x${expected}x") + message(FATAL_ERROR "--- Calculated rpath does not agree with expected rpath: '${new_rpath}' != '${expected}' ") +else() + message(STATUS "--- Calculated rpath agrees with expected rpath: '${new_rpath}' ") +endif() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-fix-rpath/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-fix-rpath/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..c39dc3920311bd94f5b4fa36045fab958534fbea --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-fix-rpath/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "vcpkg-fix-rpath", + "version-date": "2024-02-10", + "description": "Test port to check the string replacement in z_vcpkg_fixup_rpath", + "supports": "native & linux" +} diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-from-git-test/portfile.cmake b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-from-git-test/portfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..841a6e2208ed3e722158c640c6d42d9cb7753ebf --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-from-git-test/portfile.cmake @@ -0,0 +1,378 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +set(git_test_repo "${CURRENT_BUILDTREES_DIR}/test-git-repo") +file(REMOVE_RECURSE "${git_test_repo}") + +# LFS expects a URL for a local repository +set(git_remote "file:///${git_test_repo}") + +message(STATUS "Creating test git repository") +vcpkg_find_acquire_program(GIT) +vcpkg_list(SET git_config + -c core.autocrlf=false + -c user.email=vcpkg@example.com + -c user.name=vcpkg +) + +vcpkg_list(SET git ${GIT} ${git_config}) + +vcpkg_execute_required_process( + COMMAND ${git} init "test-git-repo" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + LOGNAME "git-init" +) +vcpkg_execute_required_process( + COMMAND ${git} config uploadpack.allowReachableSHA1InWant true + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-config" +) +vcpkg_execute_required_process( + COMMAND ${git} checkout -b main + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-new-branch" +) + +file(WRITE "${git_test_repo}/README.txt" "first commit") +vcpkg_execute_required_process( + COMMAND ${git} add "README.txt" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-add.1" +) +vcpkg_execute_required_process( + COMMAND ${git} commit -m "first commit" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-commit.1" +) +vcpkg_execute_in_download_mode( + COMMAND ${git} rev-parse HEAD + OUTPUT_VARIABLE ref + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" +) +if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}") +endif() +string(STRIP "${ref}" ref) + +file(WRITE "${git_test_repo}/README.txt" "second commit") +vcpkg_execute_required_process( + COMMAND ${git} add "README.txt" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-add.2" +) +vcpkg_execute_required_process( + COMMAND ${git} commit -m "second commit" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-commit.2" +) +vcpkg_execute_in_download_mode( + COMMAND ${git} rev-parse HEAD + OUTPUT_VARIABLE head_ref + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" +) +if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}") +endif() +string(STRIP "${head_ref}" head_ref) + +message(STATUS "Testing regular mode") +set(VCPKG_USE_HEAD_VERSION OFF) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" + HEAD_REF main +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "first commit") + message(FATAL_ERROR "Failed to checkout the first commit. Contents were: +${contents} +") +endif() + +message(STATUS "Testing regular mode that happens to match HEAD") +set(VCPKG_USE_HEAD_VERSION OFF) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${head_ref}" + HEAD_REF main +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "second commit") + message(FATAL_ERROR "Failed to checkout the second commit. Contents were: +${contents} +") +endif() + +message(STATUS "Testing regular mode with FETCH_REF") +vcpkg_execute_required_process( + COMMAND ${git} config uploadpack.allowReachableSHA1InWant false + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-config" +) +set(VCPKG_USE_HEAD_VERSION OFF) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" + FETCH_REF main + HEAD_REF main +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "first commit") + message(FATAL_ERROR "Failed to checkout the first commit. Contents were: +${contents} +") +endif() + +message(STATUS "Testing regular mode with FETCH_REF that happens to match HEAD") +set(VCPKG_USE_HEAD_VERSION OFF) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${head_ref}" + FETCH_REF main + HEAD_REF main +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "second commit") + message(FATAL_ERROR "Failed to checkout the second commit. Contents were: +${contents} +") +endif() + +vcpkg_execute_required_process( + COMMAND ${git} config uploadpack.allowReachableSHA1InWant true + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-config" +) + +message(STATUS "Testing head mode") +set(VCPKG_USE_HEAD_VERSION ON) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" + HEAD_REF main +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "second commit") + message(FATAL_ERROR "Failed to checkout the HEAD commit. Contents were: +${contents} +") +endif() +if(NOT "${VCPKG_HEAD_VERSION}" STREQUAL "${head_ref}") + message(FATAL_ERROR "Failed to checkout the right HEAD commit. + Expected: ${head_ref} + Actual : ${VCPKG_HEAD_VERSION} +") +endif() + +message(STATUS "Testing head mode + no HEAD_REF -> just uses REF") +set(VCPKG_USE_HEAD_VERSION ON) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "first commit") + message(FATAL_ERROR "Failed to checkout the regular commit. Contents were: +${contents} +") +endif() + +message(STATUS "Testing new head ref") +file(WRITE "${git_test_repo}/README.txt" "third commit") +vcpkg_execute_required_process( + COMMAND ${git} add "README.txt" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git.7" +) +vcpkg_execute_required_process( + COMMAND ${git} commit -m "second commit" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git.8" +) +vcpkg_execute_in_download_mode( + COMMAND ${git} rev-parse HEAD + OUTPUT_VARIABLE new_head_ref + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" +) +if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}") +endif() +string(STRIP "${new_head_ref}" new_head_ref) + +set(VCPKG_USE_HEAD_VERSION ON) +vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" + HEAD_REF main +) +file(READ "${source_path}/README.txt" contents) +if(NOT "${contents}" STREQUAL "third commit") + message(FATAL_ERROR "Failed to checkout the right HEAD commit. Contents were: +${contents} +") +endif() +if(NOT "${VCPKG_HEAD_VERSION}" STREQUAL "${new_head_ref}") + message(FATAL_ERROR "Failed to checkout the right HEAD commit. + Expected: ${new_head_ref} + Actual : ${VCPKG_HEAD_VERSION} +") +endif() + +message(STATUS "Testing LFS support") +vcpkg_execute_in_download_mode( + COMMAND "${GIT}" lfs --version + OUTPUT_VARIABLE lfs_version_output + ERROR_VARIABLE lfs_version_error + RESULT_VARIABLE lfs_version_result + WORKING_DIRECTORY "${git_test_repo}" +) +if(NOT lfs_version_result) + vcpkg_execute_required_process( + COMMAND ${git} lfs install --local + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-lfs-install" + ) + file(WRITE "${git_test_repo}/.gitattributes" "* text=auto\n*.bin filter=lfs diff=lfs merge=lfs -text\n") + + message(STATUS "Testing fetching with the same Git and LFS urls") + file(WRITE "${git_test_repo}/lfs_file.bin" "fourth commit") + vcpkg_execute_required_process( + COMMAND ${git} add ".gitattributes" "lfs_file.bin" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-lfs-add" + ) + vcpkg_execute_required_process( + COMMAND ${git} commit -m "fourth commit" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-lfs-commit" + ) + vcpkg_execute_in_download_mode( + COMMAND ${git} rev-parse HEAD + OUTPUT_VARIABLE ref + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" + ) + if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}") + endif() + string(STRIP "${ref}" ref) + + vcpkg_execute_in_download_mode( + COMMAND ${git} lfs ls-files --name-only + OUTPUT_VARIABLE lfs_files + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" + ) + if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed lfs ls-files: ${error_code}") + endif() + string(STRIP "${lfs_files}" lfs_files) + if(NOT "${lfs_files}" MATCHES [[lfs_file\.bin]]) + message(FATAL_ERROR "File was not added to LFS") + endif() + + set(VCPKG_USE_HEAD_VERSION OFF) + vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" + HEAD_REF main + LFS + ) + file(READ "${source_path}/lfs_file.bin" contents) + if(NOT "${contents}" STREQUAL "fourth commit") + message(FATAL_ERROR "Failed to checkout the fourth commit. Contents were: +${contents} + ") + endif() + + message(STATUS "Testing fetching from different Git and LFS urls") + # requires LFS 3.0.0 or later for "--force" on prune + string(REGEX MATCH "git-lfs/([0-9\\.]+) " lfs_version "${lfs_version_output}") + set(lfs_version "${CMAKE_MATCH_1}") + if(lfs_version VERSION_GREATER_EQUAL "3.0.0") + file(WRITE "${git_test_repo}/lfs_file2.bin" "fifth commit") + vcpkg_execute_required_process( + COMMAND ${git} add "lfs_file2.bin" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-lfs-add.2" + ) + vcpkg_execute_required_process( + COMMAND ${git} commit -m "fifth commit" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-lfs-commit.2" + ) + vcpkg_execute_in_download_mode( + COMMAND ${git} rev-parse HEAD + OUTPUT_VARIABLE ref + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" + ) + if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed to rev-parse HEAD: ${error_code}") + endif() + string(STRIP "${ref}" ref) + + set(git_test_repo_2 "${CURRENT_BUILDTREES_DIR}/test-git-repo-2") + file(REMOVE_RECURSE "${git_test_repo_2}") + set(git_remote_2 "file:///${git_test_repo_2}") + vcpkg_execute_required_process( + COMMAND ${git} init --bare "test-git-repo-2" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + LOGNAME "git-init.2" + ) + # note: LFS won't prune "unpushed" files, which is checked using the "origin" remote by default. + # If there is no remote then files are never considered to be "pushed", and so are never pruned. + vcpkg_execute_required_process( + COMMAND ${git} remote add origin "${git_remote_2}" + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-remote-add" + ) + vcpkg_execute_required_process( + COMMAND ${git} push --all origin + WORKING_DIRECTORY "${git_test_repo}" + LOGNAME "git-push" + ) + + vcpkg_execute_in_download_mode( + COMMAND ${git} lfs prune --force --verbose + OUTPUT_VARIABLE lfs_prune + RESULT_VARIABLE error_code + WORKING_DIRECTORY "${git_test_repo}" + ) + if(NOT "${error_code}" EQUAL "0") + message(FATAL_ERROR "Failed to prune LFS files: ${error_code}") + endif() + if(NOT "${lfs_prune}" MATCHES "0 retained") + message(FATAL_ERROR "LFS prune did not delete all files:\n${lfs_prune}") + endif() + + set(VCPKG_USE_HEAD_VERSION OFF) + vcpkg_from_git( + OUT_SOURCE_PATH source_path + URL "${git_remote}" + REF "${ref}" + HEAD_REF main + LFS "${git_remote_2}" + ) + file(READ "${source_path}/lfs_file2.bin" contents) + if(NOT "${contents}" STREQUAL "fifth commit") + message(FATAL_ERROR "Failed to checkout the fifth commit. Contents were: + ${contents} + ") + endif() + else() + message(NOTICE "Git LFS version is older than 3.0.0: some tests were skipped") + endif() +else() + message(NOTICE "Git LFS is not available: some tests were skipped") +endif() diff --git a/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-from-git-test/vcpkg.json b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-from-git-test/vcpkg.json new file mode 100644 index 0000000000000000000000000000000000000000..609e7f3e42d891dce071ba920153bccb36a13b74 --- /dev/null +++ b/cc-multilingual-main/cc_net/vcpkg/scripts/test_ports/vcpkg-from-git-test/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "vcpkg-from-git-test", + "version": "0" +}