【问题标题】:Install git2go libgit2 dependency on windows through vcpkg通过vcpkg在windows上安装git2go libgit2依赖
【发布时间】:2020-11-28 00:09:28
【问题描述】:

为了使用 git2go,我通过 vcpkg vcpkg.exe install libgit2:x64-windows --recurse 安装 libgit2 并成功安装。 不幸的是,vcpkg 没有为 pkg-config 提供 openssl.pc,因此 git2go 在运行任何代码时都会失败

# pkg-config --cflags  -- libgit2
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'libgit2', not found
pkg-config: exit status 1

如果我无法通过 vcpkg 安装 libgit2,如何使其与 git2go 一起使用?有没有办法告诉 vcpkg 提供 openssl.pc?运行 vcpkg.exe install openssl:x64-windows 表明该软件包已安装。运行 vcpkg.exe integrate install 也无济于事。

【问题讨论】:

    标签: go libgit2 vcpkg


    【解决方案1】:
    1. 向 libgit2 的 portfile.cmake 添加一个 vcpkg_fixup_pkgconfig() 调用
    2. openssl.pc 文件添加到vcpkg 中的openssl 端口。如果您愿意,请打开一个问题。不幸的是,openssl 源似乎没有模板 (openssl.pc.in),因此它可能需要手动创建。 (也许你很幸运,linux 构建创建了一个可以使用并适应 Windows 的版本。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-04
      • 2022-01-12
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 2020-06-27
      • 2019-05-17
      • 1970-01-01
      相关资源
      最近更新 更多