在 Mac 中安装 Ubuntu 个等效库,例如 libssl-dev

Install Ubuntu equivalent libraries in Macos e.g libssl-dev

我想在 macOS 中安装 ubuntu 下面列出的库。请问有人知道 macos 终端中的等效命令是什么吗?我已经搜索过 homebrew,那里没有。

apt-get install -y build-essential libssl-dev libnet-ssleay-perl libcrypt-ssleay-perl libidn11-dev

任何正确方向的指示将不胜感激。

  • 在 macOS 上没有与 build-essential 等效的工具,因为这些基本工具已经安装。
  • libssl-dev 是 OpenSSL:brew install openssl
  • libnet-ssleay-perllibcrypt-ssleay-perl 只是 Perl 模块 Net::SSLeay and Crypt::SSLeay。您应该可以使用 cpan.
  • 安装它们
  • libidn11-dev可以用brew install libidn安装。 Debian 软件包安装版本 1.29,而 Homebrew 安装版本 1.33。

对于更通用的方法,您可以尝试将 Debian 包名称 "convert" 转换为 Homebrew 包名称:

  1. 去除任何 -dev 后缀和 brew search 结果名称;例如libidn11-dev -> brew search libidn11.
  2. 尝试不带任何版本后缀:brew search libidn。如果找到匹配项,运行 brew info <formula> 检查其版本。注意 Homebrew 有时有固定版本的包,比如 openssl@1.1 for openssl version 1.1.
  3. packages.debian.org to see what it installs. For example, libssl-dev’s description 上搜索包裹说:

    This package is part of the OpenSSL project's implementation of the SSL and TLS cryptographic protocols for secure communication over the Internet.

    然后我们可以brew search openssl查看是否有与此完全匹配的包。