haskell / text-icu

This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text.
BSD 2-Clause "Simplified" License
47 stars 41 forks source link

Installation os osx/darwin is a bit tricky. Here's instructions which maybe could be extracted to a wiki. #10

Closed suvash closed 9 years ago

suvash commented 9 years ago

So, I failed while trying to use text-icu via cabal on osx/darwin.

After some good search, I found the following instructions to be quite helpful. Not sure where to document it as , but I'm just putting it up here so that it may help people who might run into the same issue.

Maybe this can eventually be pulled out to the project wiki once set up.

# Make sure the external lib (icu4c) is installed and available via homebrew
brew install icu4c

# If installing in a cabal sandbox which is mostly what i do
# Just add the package to the <project>.cabal file and then run cabal install with additional parameters
cabal install --only-dependencies  --extra-lib-dirs=/usr/local/opt/icu4c/lib/ --extra-include-dirs=/usr/local/opt/icu4c/include

# If not using sandbox, just cabal install with additional parameters to the homebrew install
cabal install text-icu --extra-lib-dirs=/usr/local/opt/icu4c/lib/ --extra-include-dirs=/usr/local/opt/icu4c/include
ygale commented 9 years ago

This is not the end of the story. Because then, your program will only work on Macs that have the ICU dylibs in exactly the same locations as you, i.e., they need to have homebrew and they also need to have run brew install icu4c before running your program.

One direction is to modify the dylibs so that they can be distributed together with your executable and placed in the same directory, e.g., as part of an app bundle. There is an SO thread with instructions about how to modify the dylibs. But I haven't been successful at getting that to work yet.

gitfoxi commented 9 years ago

Thanks. That was tricky. I had tried using CPPFLAGS and LDFLAGS and PKG_CONFIG_PATH to no avail.

FranklinChen commented 9 years ago

I just ran into this, agree that it should somehow be documented.