使用cabal在Mac OSX上安装text-icu

7st*_*tud 9 haskell

我想用haskell尝试unicode,而Data.Text文档说我需要text-icu.这是我试过的:

Mac OS X 10.6.8

~/haskell_programs$ cabal update
Downloading the latest package list from hackage.haskell.org

~/haskell_programs$ cabal install text-icu
Resolving dependencies...
Downloading text-icu-0.6.3.5...
Configuring text-icu-0.6.3.5...
cabal: Missing dependencies on foreign libraries:
* Missing C libraries: icui18n, icudata, icuuc
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
Failed to install text-icu-0.6.3.5
cabal: Error: some packages failed to install:
text-icu-0.6.3.5 failed during the configure step. The exception was:
ExitFailure 1
Run Code Online (Sandbox Code Playgroud)

我找到了一个有相同问题的Windows用户的帖子.我真的需要出去安装那些C库吗?或者他们在我的系统某处'错位'了?

谢谢.

Joh*_*ley 18

如果您使用的是Homebrew,那么这就是我使用的命令:

    DYLD_LIBRARY_PATH=/usr/local/opt/icu4c/lib                      \
        cabal install text-icu                                      \
            --extra-include-dirs=/usr/local/opt/icu4c/include       \
            --extra-lib-dirs=/usr/local/opt/icu4c/lib
Run Code Online (Sandbox Code Playgroud)