Homebrew软件包安装和Homebrew安装的仅桶式库一起安装?怎么做?

时间:2018-07-20 00:42:31

标签: macos curl openssl homebrew

我想通过自制软件在openssl中安装curl。我这样做

brew install curl --with-openssl

在安装自制的openssl之前,它是当前的1.0.2版本。由于此openssl仅适用于小桶,并且Apple还提供了opensl的​​过时系统版本,因此Homebrew建议设置PKG_CONFIG_PATH环境变量,例如export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig",我这样做了。然后,如果我运行pkg-config --list-all |## Heading ##grep openssl,它将找到openssl。我的问题是,当我随后运行brew install curl --with-opensslcurl -V时,它仍未安装openssl进行安装,而是使用安全传输。可能是什么原因?

curl 7.61.0 (x86_64-apple-darwin15.6.0) libcurl/7.61.0 SecureTransport zlib/1.2.5
Release-Date: 2018-07-11 
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets

谢谢!

1 个答案:

答案 0 :(得分:0)

尽管您已经解决了该问题,但我在此处添加了一些可能对您有所帮助的信息。

brew formula for curl很容易阅读。您也可以通过brew formula curl在本地找到它。关于openssl,它向您显示以下内容:

    # cURL has a new firm desire to find ssl with PKG_CONFIG_PATH instead of using
    # "--with-ssl" any more. "when possible, set the PKG_CONFIG_PATH environment
    # variable instead of using this option". Multi-SSL choice breaks w/o using it.
    if MacOS.version < :mountain_lion || build.with?("openssl") || build.with?("nghttp2")
      ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["openssl"].opt_lib}/pkgconfig"
      args << "--with-ssl=#{Formula["openssl"].opt_prefix}"
      args << "--with-ca-bundle=#{etc}/openssl/cert.pem"
      args << "--with-ca-path=#{etc}/openssl/certs"
    else
      args << "--with-darwinssl"
      args << "--without-ca-bundle"
      args << "--without-ca-path"
    end

因此,无需亲自手动调整PKG_CONFIG_PATH,该公式将通过指向openssl的现成安装版本来为您完成调整。 (尽管注释行中引述,PKG_CONFIG_PATH似乎更喜欢前者,但我为什么还同时设置了--with-sslcurl仍然不清楚。)

当您按如下方式运行args时,此处提到的brew install应该会显示(删除一些无用的输出并重新格式化以使相关的args重新开始):

$ brew install curl --with-openssl
==> Downloading https://curl.haxx.se/download/curl-7.61.0.tar.bz2
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/curl/7.61.0
        --with-ssl=/usr/local/opt/openssl --with-ca-bundle=/usr/local/etc/openssl/cert.pem --with-ca-path=/usr/local/etc/open
==> make install

--with-ssl参数应指向您的openssl的brew安装。如果这不是您想要的样子,则可以开始调试公式...

显然使用brew reinstall可以帮到您。

相关问题