如何利用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:

<VCPKG_ROOT>/ports/<packet_name>/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/<packet_2_name>/CONTROL
/some/path/to/the_versions/<packet_3_name>/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

在这里插入图片描述

修改 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值