无法安装&#i; ihaskell-diagram'使用Cabal

时间:2015-10-04 19:45:07

标签: haskell glib cabal-install ihaskell

当我尝试

cabal install ihaskell-diagrams

我收到错误

  

pkg-config软件包' glib-2.0'是必需的,但它不可能   找到。

什么是glib,如何安装它以便Cabal可用?

Resolving dependencies...
Configuring cairo-0.13.1.0...
Configuring glib-0.13.2.1...
Failed to install cairo-0.13.1.0
Build log ( /Users/Rax/.cabal/logs/cairo-0.13.1.0.log ):
[1 of 2] Compiling SetupWrapper     ( /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57646/cairo-0.13.1.0/SetupWrapper.hs, /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57646/cairo-0.13.1.0/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57646/cairo-0.13.1.0/dist/setup/setup.hs, /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57646/cairo-0.13.1.0/dist/setup/Main.o )
Linking /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57646/cairo-0.13.1.0/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring cairo-0.13.1.0...
setup: The pkg-config package 'cairo' version >=1.2.0 is required but it could
not be found.
Failed to install glib-0.13.2.1
Build log ( /Users/Rax/.cabal/logs/glib-0.13.2.1.log ):
[1 of 2] Compiling SetupWrapper     ( /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57647/glib-0.13.2.1/SetupWrapper.hs, /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57647/glib-0.13.2.1/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57647/glib-0.13.2.1/dist/setup/setup.hs, /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57647/glib-0.13.2.1/dist/setup/Main.o )

Linking /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/cabal-tmp-57647/glib-0.13.2.1/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring glib-0.13.2.1...
setup: The pkg-config package 'glib-2.0' is required but it could not be
found.
cabal: Error: some packages failed to install:
cairo-0.13.1.0 failed during the configure step. The exception was:
ExitFailure 1
diagrams-cairo-1.3.0.5 depends on glib-0.13.2.1 which failed to install.
glib-0.13.2.1 failed during the configure step. The exception was:
ExitFailure 1
ihaskell-diagrams-0.3.1.0 depends on glib-0.13.2.1 which failed to install.
pango-0.13.1.0 depends on glib-0.13.2.1 which failed to install.

1 个答案:

答案 0 :(得分:1)

这里的混淆源于可能不清楚的错误消息:缺少的组件是 Cabal包,但需要单独安装的库。

其中一些库有自己的依赖项,或者安装它们可能会显示其他缺失的软件包,因此您系统的具体要求会有所不同;但一般来说,当您收到错误的“pig-config软件包”缺失时,您需要将其与软件包管理器(而不是Cabal)一起安装。

例如,

brew install glib
brew install cairo
brew install pango

为我工作并允许我

cabal install ihaskell-diagrams

没有其他错误。