Cabal在尝试安装pango时失败,抱怨它无法找到pkg-config。
peauters:~ $ sudo cabal install pango -v
Password:
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Extracting
/Users/chris/Library/Haskell/repo-cache/hackage.haskell.org/pango/0.12.3/pango-0.12.3.tar.gz
to /tmp/pango-0.12.3-76116...
creating /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup
creating /tmp/pango-0.12.3-76116/pango-0.12.3/dist
creating /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup
/usr/bin/ghc --make /tmp/pango-0.12.3-76116/pango-0.12.3/Setup.hs -o /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/setup -odir /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup -hidir /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup -i -i/tmp/pango-0.12.3-76116/pango-0.12.3 -package Cabal-1.14.0
[1 of 2] Compiling SetupWrapper ( /tmp/pango-0.12.3-76116/pango-0.12.3/SetupWrapper.hs, /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/pango-0.12.3-76116/pango-0.12.3/Setup.hs, /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/Main.o )
Linking /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/setup ...
/tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/setup configure --verbose=2
--ghc --prefix=/Library/Haskell/$compiler/lib/$pkgid --libsubdir=
--datasubdir= --docdir=$prefix/doc --enable-library-profiling --global
--flags=new-exception --constraint=process ==1.1.0.1 --constraint=pretty
==1.1.1.0 --constraint=mtl ==2.1.1 --constraint=glib ==0.12.3.1
--constraint=directory ==1.1.0.2 --constraint=containers ==0.4.2.1
--constraint=cairo ==0.12.3.1 --constraint=base ==4.5.0.0 --constraint=array
==0.4.0.0 --disable-tests --disable-benchmarks
[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 pango-0.12.3...
Flags chosen: new-exception=True
Dependency array ==0.4.0.0: using array-0.4.0.0
Dependency base ==4.5.0.0: using base-4.5.0.0
Dependency cairo ==0.12.3.1: using cairo-0.12.3.1
Dependency containers ==0.4.2.1: using containers-0.4.2.1
Dependency directory ==1.1.0.2: using directory-1.1.0.2
Dependency glib ==0.12.3.1: using glib-0.12.3.1
Dependency mtl ==2.1.1: using mtl-2.1.1
Dependency pretty ==1.1.1.0: using pretty-1.1.1.0
Dependency process ==1.1.0.1: using process-1.1.0.1
setup: The pkg-config package pango version <1.26.0 || >1.26.2 is required but
it could not be found.
World file is already up to date.
cabal: Error: some packages failed to install:
pango-0.12.3 failed during the configure step. The exception was:
ExitFailure 1
pkg-config通过Homebrew安装:
peauters:~ $ which pkg-config
/usr/local/bin/pkg-config
peauters:~ $ pkg-config --version
0.25
关于这个问题的想法?
答案 0 :(得分:5)
这个错误有点令人困惑。
这就是说你需要安装非阴谋包“pango”。
我用brew install pango做了这个并解决了这个问题。
答案 1 :(得分:4)
对于ubuntu,请参阅http://www.haskell.org/haskellwiki/Gtk2Hs/Linux,其中包含
sudo apt-get install libgtk2.0-dev libpango1.0-dev libglib2.0-dev libcairo2-dev