如何利用vcpkg 出openssl 1.1.1t的库

背景

更新vcpkg发现,vcpkg没有更新openssl 1.1.1系列的port,只更新3.x系列的了。

那如何利用vcpkg出openssl 1.1.1t的包呢?

参考:如何下载老版本的openssl

https://stackoverflow.com/questions/53805917/install-older-version-of-protobuf-via-vcpkg

answer1

To have a specific version of a package in vcpkg, you need to checkout at the appropriate point in time in the vcpk repo.

  1. Go to your git installed vcpk folder.
  2. Identify the commit matching the version of protobuf you’re looking for.

The following line color-codes the commit history to make it more readable and pipe it with grep to identify protobuf related commits.

git log --color=always --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad)' --date=short | grep --color=never protobuf

You’ll find a line like b1fea4588 - [protobuf] update to 3.5.1 (2018-01-31). (The commit hash/message may have changed if the history has been rewritten.)

  1. Checkout the commit of interest : git checkout b1fea4588
  2. Run vcpkg install protobuf

The issue of package version management is very active on vcpkg repo. Check Issue #3592

answer2

Use a new feature (June 2019): ports overlay https://github.com/microsoft/vcpkg/blob/master/docs/specifications/ports-overlay.md

Here is an example. The version of packet is hardcoded in file:

/ports//CONTROL

Thus it’s bound to the commit of vckpg. But you can override packet version with the following command

vcpkg --overlay-ports="/some/path/to/the_versions" install protobuf:x64-windows

The directory should contain packet specs:

/some/path/to/the_versions/protobuf/CONTROL
/some/path/to/the_versions//CONTROL
/some/path/to/the_versions//CONTROL

Usually, I just copy packet specs from the commit I was initially developing my project for. Hope this helps!

Note:新的版本好像也不支持这个ports overlay了。

步骤

回退节点

git log --color=always --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad)' --date=short | grep --color=never openssl

执行上述git 命令发现,vcpkg支持的1.1.1系列最新的是1.1.1n.

a69b65229 - [openssl] update to 1.1.1n (#23589) (2022-03-17)
git reset a69b65229

将vcpkg 回到 a69b65229 节点。

修改版本

modified:   ports/openssl/portfile.cmake
modified:   ports/openssl/vcpkg.json
modified:   versions/baseline.json
modified:   versions/o-/openssl.json

如何利用vcpkg 出openssl 1.1.1t的库_第1张图片

修改 1.1.1n to 1.1.1t

install and export openssl

./vcpkg install openssl:x64-windows
./vcpkg export openssl:x64-windows --zip

Reference

vcpkg getstarted:https://vcpkg.io/en/getting-started.html

vcpkg支持的库:https://vcpkg.io/en/packages.html

vcpkg中文快速入门: https://www.cnblogs.com/flyinggod/p/10786243.html

你可能感兴趣的:(git,github,vcpkg,openssl)