Skip to contentSkip to conversation

vcpkg: switch to manifest

PATCH In review Lev Stipakov 2 participants 2 messages May 5, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vcpkg: switch to manifest

From: Lev Stipakov <[email protected]...>

Add vcpkg manifest file which lists
dependencies and enable manifest usage in
project file.

This simplifies build process by eliminating separate "vcpkg install" step to install dependencies.

Since vcpkg added openssl3 port, remove ours.

---
 .github/workflows/build.yaml                  |  16 +-
 .gitignore                                    |   1 +
 contrib/vcpkg-ports/openssl3/portfile.cmake   | 166 ------------------
 contrib/vcpkg-ports/openssl3/usage            |   4 -
 contrib/vcpkg-ports/openssl3/vcpkg.json       |   7 -
 .../vcpkg-ports/pkcs11-helper/portfile.cmake  |   2 +-
 src/openvpn/openvpn.vcxproj                   |   9 +
 src/openvpn/vcpkg.json                        |  13 ++
 8 files changed, 31 insertions(+), 187 deletions(-)
 delete mode 100644 contrib/vcpkg-ports/openssl3/portfile.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl3/usage
 delete mode 100644 contrib/vcpkg-ports/openssl3/vcpkg.json
 create mode 100644 src/openvpn/vcpkg.json
.github/workflows/build.yaml +7 -9
index 34a9d9b9..ac46a72c 100644
@@ -290,19 +290,17 @@ jobs:
       - name: Install rst2html
         run: python -m pip install --upgrade pip rst2html
 
-      - name: Restore artifacts, or run vcpkg, build and cache artifacts
-        uses: lukka/[email protected]...
+      - name: Restore artifacts, or setup vcpkg (do not install any package)
+        uses: lukka/[email protected]...
         with:
-          vcpkgGitCommitId: 'a69b65229b3956b7f45abd81671b7330114bcaad'
-          vcpkgArguments: 'openssl3 lz4 lzo pkcs11-helper tap-windows6'
-          vcpkgTriplet: '${{ matrix.triplet }}-windows-ovpn'
-          cleanAfterBuild: false
+          vcpkgGitCommitId: '4b766c1cd17205e1b768c4fadfd5f867c1d0510e'
+          appendedCacheKey: '${{matrix.triplet}}'
 
-      - name: Build
+      - name: Run MSBuild consuming vcpkg.json
         working-directory: ${{env.GITHUB_WORKSPACE}}
         run: |
-          vcpkg integrate install
-          msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform="${{ matrix.plat }}" .
+            vcpkg integrate install
+            msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform="${{ matrix.plat }}" .
 
       - name: Archive artifacts
         uses: actions/[email protected]...
.gitignore +1 -0
index 178076ed..7335154f 100644
@@ -44,6 +44,7 @@ m4/ltoptions.m4
 m4/ltsugar.m4
 m4/ltversion.m4
 m4/lt~obsolete.m4
+vcpkg_installed
 
 version.sh
 msvc-env-local.bat
contrib/vcpkg-ports/openssl3/portfile.cmake deleted +0 -166

166 lines not on this page · raw message

contrib/vcpkg-ports/openssl3/usage deleted +0 -4
deleted file mode 100644
index 97e7760e..00000000
@@ -1,4 +0,0 @@
-The package openssl3 is compatible with built-in CMake targets:
-
-    find_package(OpenSSL REQUIRED)
-    target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)
contrib/vcpkg-ports/openssl3/vcpkg.json deleted +0 -7
deleted file mode 100644
index ecf7a8d0..00000000
@@ -1,7 +0,0 @@
-{
-  "name": "openssl3",
-  "version-semver": "3.0.2",
-  "description": "TLS/SSL and crypto library",
-  "homepage": "https://www.openssl.org/",
-  "license": "Apache-2.0"
-}
contrib/vcpkg-ports/pkcs11-helper/portfile.cmake +1 -1
index a19ea254..4432b550 100644
@@ -22,7 +22,7 @@ vcpkg_build_nmake(
     PROJECT_NAME Makefile.w32-vc
     OPTIONS
         OPENSSL=1
-        OPENSSL_HOME=${CURRENT_PACKAGES_DIR}/../openssl3_${TARGET_TRIPLET}
+        OPENSSL_HOME=${CURRENT_PACKAGES_DIR}/../openssl_${TARGET_TRIPLET}
 )
 
 file(INSTALL ${SOURCE_PATH}/include/pkcs11-helper-1.0 DESTINATION ${CURRENT_PACKAGES_DIR}/include/)
src/openvpn/openvpn.vcxproj +9 -0
index 5e7d94d9..860ef892 100644
@@ -124,26 +124,35 @@
   <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
     <VcpkgEnabled>true</VcpkgEnabled>
     <VcpkgTriplet>arm64-windows-ovpn</VcpkgTriplet>
+    <VcpkgAdditionalInstallOptions>--overlay-triplets=$(SolutionDir)contrib\vcpkg-triplets --overlay-ports=$(SolutionDir)contrib\vcpkg-ports</VcpkgAdditionalInstallOptions>
   </PropertyGroup>
   <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
     <VcpkgEnabled>true</VcpkgEnabled>
     <VcpkgTriplet>arm64-windows-ovpn</VcpkgTriplet>
+    <VcpkgAdditionalInstallOptions>--overlay-triplets=$(SolutionDir)contrib\vcpkg-triplets --overlay-ports=$(SolutionDir)contrib\vcpkg-ports</VcpkgAdditionalInstallOptions>
   </PropertyGroup>
   <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <VcpkgEnabled>true</VcpkgEnabled>
     <VcpkgTriplet>x86-windows-ovpn</VcpkgTriplet>
+    <VcpkgAdditionalInstallOptions>--overlay-triplets=$(SolutionDir)contrib\vcpkg-triplets --overlay-ports=$(SolutionDir)contrib\vcpkg-ports</VcpkgAdditionalInstallOptions>
   </PropertyGroup>
   <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <VcpkgEnabled>true</VcpkgEnabled>
     <VcpkgTriplet>x86-windows-ovpn</VcpkgTriplet>
+    <VcpkgAdditionalInstallOptions>--overlay-triplets=$(SolutionDir)contrib\vcpkg-triplets --overlay-ports=$(SolutionDir)contrib\vcpkg-ports</VcpkgAdditionalInstallOptions>
   </PropertyGroup>
   <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <VcpkgEnabled>true</VcpkgEnabled>
     <VcpkgTriplet>x64-windows-ovpn</VcpkgTriplet>
+    <VcpkgAdditionalInstallOptions>--overlay-triplets=$(SolutionDir)contrib\vcpkg-triplets --overlay-ports=$(SolutionDir)contrib\vcpkg-ports</VcpkgAdditionalInstallOptions>
   </PropertyGroup>
   <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <VcpkgEnabled>true</VcpkgEnabled>
     <VcpkgTriplet>x64-windows-ovpn</VcpkgTriplet>
+    <VcpkgAdditionalInstallOptions>--overlay-triplets=$(SolutionDir)contrib\vcpkg-triplets --overlay-ports=$(SolutionDir)contrib\vcpkg-ports</VcpkgAdditionalInstallOptions>
+  </PropertyGroup>
+  <PropertyGroup Label="Vcpkg">
+    <VcpkgEnableManifest>true</VcpkgEnableManifest>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
src/openvpn/vcpkg.json new file +13 -0
new file mode 100644
index 00000000..5489d146
@@ -0,0 +1,13 @@
+{
+  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
+  "name": "openvpn",
+  "version": "2.6",
+  "dependencies": [
+    "openssl",
+    "tap-windows6",
+    "lzo",
+    "lz4",
+    "pkcs11-helper"
+  ],
+  "builtin-baseline": "4b766c1cd17205e1b768c4fadfd5f867c1d0510e"
+}
Signature · 1 line
2.23.0.windows.1
Acked-by on v1 1/1
#1 lore raw

"Again, I have no idea, but it looks reasonable and github builds nice things from it..."

Your patch has been applied to the master branch.

commit f6d80493a965d08c6b9beb67e25e2762b8aa94d9

Author: Lev Stipakov
Date:   Thu May 5 15:14:49 2022 +0300
     vcpkg: switch to manifest

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24285.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering