pkg-config:找不到命令,但仅在通过 Homebrew 安装时

pkg-config: command not found, but ONLY when installing via Homebrew

我正在尝试通过 Homebrew 在 Mac (El Capitan) 上安装支持 ECMAScript 的 elinks。

为了确保一切都能正确编译,我首先自己手动将软件包下载到 ./configure,然后 make。在我设置以下环境变量之前,它无法识别我的 SpiderMonkey 安装:

export PKG_CONFIG=pkg-config
export PKG_CONFIG_PATH=/usr/local/Cellar/nspr/4.12/lib/pkgconfig:/usr/local/Cellar/spidermonkey/1.8.5_1/lib/pkgconfig

至此,手动配置就顺利进行了。相关地,

checking pkg-config is at least version 0.9.0... yes
...
checking for SpiderMonkey (1.8.5 or later) in pkg-config mozjs185... yes

但是当我转到 brew install --devel -v elinks 时,我得到以下输出:

checking pkg-config is at least version 0.9.0... ./configure: line 4211: pkg-config: command not found
no
...
checking for SpiderMonkey (1.8.5 or later) in pkg-config mozjs185... no

什么给了?

(我不确定这是否相关,但我在 brew edit elinks 中做了一些调整以使其下载最新的实验版本,0.13 – 0.12pre6 是可用的。)

Per the dev team:

Homebrew is designed not to allow packages to find other software that wasn't specified as a dependency; you'll need to add these lines to the dependencies for it to work:

depends_on "pkg-config" => :build
depends_on "spidermonkey"