如何将 MacPort 的 libiconv 替换为 Mac 默认的 64 位版本?
MacPorts 安装了“libiconv @1.14_0+universal”作为我系统的依赖项。这恰好是 32 位版本,当我尝试编译名为 Simon Listens 的语音识别软件时,它开始引起问题。 在谷歌搜索时,我发现 Mac 实际上附带了 默认情况下为 64 位 libiconv,我能够在我的系统上找到上述文件:
$ find /usr/lib -name libiconv*
/usr/lib/libiconv.2.4.0.dylib
/usr/lib/libiconv.2.dylib
/usr/lib/libiconv.dylib
为了使用系统库,我可以采用的最快方法想到的方法是卸载 MacPort 的 libiconv 版本,以便系统的库最终会被选为后备库,因为它必须已经在 PATH 楼下的某个位置出现(我的猜测)。
但由于依赖关系而失败了:
$ sudo port uninstall libiconv @1.14_0+universal
Unable to uninstall libiconv @1.14_0+universal, the following ports depend on it:
...
所以现在我的问题是如何告诉 MacPort 替换其依赖关系图以指向并使用我系统上已有的库?
MacPorts installed "libiconv @1.14_0+universal" as a dependency on my system. This happens to be a 32-bit flavor and it started causing issue when I tried to compile a voice recognition software called Simon Listens.
While googling I found out that that Mac actually ships with a 64-bit flavor of libiconv by default and I was able to locate the said files on my system:
$ find /usr/lib -name libiconv*
/usr/lib/libiconv.2.4.0.dylib
/usr/lib/libiconv.2.dylib
/usr/lib/libiconv.dylib
In order to use the system library, the quickest way I could think of was to uninstall MacPort's version of libiconv so that the system's library would end up getting selected as a fallback as it has to present (my guess) somewhere downstairs on the PATH already.
But that failed due to dependecies:
$ sudo port uninstall libiconv @1.14_0+universal
Unable to uninstall libiconv @1.14_0+universal, the following ports depend on it:
...
So now my question is how can I tell MacPort to replace its dependency graph to point to and use the library already on my system?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
避免 MacPorts
libiconv
问题的另一种方法是针对新的版本构建 simon MacPorts 系统加上自定义的必要软件包,例如 cyrus-sasl2、zlib、portaudio 和 kdesdk4位置,例如/opt/macports-simon
。以下代码在运行 Mac OS X 10.6.8 的计算机上适用于我:
Another approach to avoid MacPorts
libiconv
issues would be to build simon against a fresh MacPorts system plus the necessary packages such ascyrus-sasl2
,zlib
,portaudio
andkdesdk4
in a custom location, e. g./opt/macports-simon
.The following code worked for me on my machine running Mac OS X 10.6.8: