Configuring cabal install readline on Snow Leopard with MacPorts

I've tried to do cabal install readline on Snow Leopard with MacPorts and it fails with the infamous: $ cabal install readline ... checking for GNUreadline.framework... checking for readline... no checking for tputs in -lncurses... yes checking for readline in -lreadline... yes checking for rl_readline_version... yes checking for rl_begin_undo_group... no configure: error: readline not found, so this package cannot be built See `config.log' for more details. cabal: Error: some packages failed to install: readline-1.0.1.0 failed during the configure step. The exception was: exit: ExitFailure 1 Googilng shows the usual explanation that Mac'y broken clone interferes; yet I do have MacPorts and readline 6 there. So I try, per fixes recommended, $ cabal install readline --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib ... checking for rl_readline_version... yes checking for rl_begin_undo_group... no ... -- same result. Downloaded the package and do configure manually: ./configure --with-readline-includes=/opt/local/include --with-readline-libraries=/opt/local/lib ... checking for readline in -lreadline... no checking for rl_readline_version... no ... Huh? $ port contents readline ... /opt/local/include/readline/readline.h ... /opt/local/lib/libreadline.5.0.dylib /opt/local/lib/libreadline.5.1.dylib /opt/local/lib/libreadline.5.2.dylib /opt/local/lib/libreadline.6.0.dylib /opt/local/lib/libreadline.6.dylib /opt/local/lib/libreadline.a /opt/local/lib/libreadline.dylib ... How should I properly tell cabal install readline where my readline is? Cheers, Alexy

On Mon, Dec 28, 2009 at 11:48 PM, Alexy Khrabrov
I've tried to do cabal install readline on Snow Leopard with MacPorts and it fails with the infamous:
$ cabal install readline ... checking for GNUreadline.framework... checking for readline... no checking for tputs in -lncurses... yes checking for readline in -lreadline... yes checking for rl_readline_version... yes checking for rl_begin_undo_group... no configure: error: readline not found, so this package cannot be built See `config.log' for more details. cabal: Error: some packages failed to install: readline-1.0.1.0 failed during the configure step. The exception was: exit: ExitFailure 1
Googilng shows the usual explanation that Mac'y broken clone interferes; yet I do have MacPorts and readline 6 there. So I try, per fixes recommended,
$ cabal install readline --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib ... checking for rl_readline_version... yes checking for rl_begin_undo_group... no ... -- same result.
Downloaded the package and do configure manually:
./configure --with-readline-includes=/opt/local/include --with-readline-libraries=/opt/local/lib
You should use: cabal install readline --configure-option=--with-readline-includes=/opt/local/include --configure-option=--with-readline-libraries=/opt/local/lib Hope that helps, -Judah

On Tue, 2009-12-29 at 00:14 -0800, Judah Jacobson wrote:
Downloaded the package and do configure manually:
./configure --with-readline-includes=/opt/local/include --with-readline-libraries=/opt/local/lib
You should use:
cabal install readline --configure-option=--with-readline-includes=/opt/local/include --configure-option=--with-readline-libraries=/opt/local/lib
Which also indicates that the readline package is at fault here. It should pass these variables on to the configure script, but clearly it does not. Duncan

On Tue, Dec 29, 2009 at 2:48 AM, Alexy Khrabrov
I've tried to do cabal install readline on Snow Leopard with MacPorts and it fails with the infamous:
$ cabal install readline ...
<snip>
How should I properly tell cabal install readline where my readline is?
As a Mac user, I've pretty much given up on getting readline to work. It's been a lot less stressful for me to just rip out readline from whatever I'm trynig to build, and either go without fancy input or hit it with a hammer until Haskeline fits what they're doing. Most folks using readline are doing anything too fancy with it. Would you be interested in a shim module providing some of the basic readline interface but built against haskeline? Antoine

OK -- I've managed to build it as follows. 1. Got the readline from the source at ftp.gnu.org. Always fun to ftp to the mothership, got the patches while at it. Always fun to remember where to cd to patch and which -p level to supply. 2. Built and installed readline 6.004 with default /usr/local prefix. 3. In the readline-1.0.1.0, manually ran ./configure --with-readline-includes=/usr/local/include --with-readline-libraries=/usr/local/lib 4. runghc Setup.hs build # no runghc Setup.hs configure, messes things right back! 5. sudo runghc Setup.hs install The only difference with cabal install is that (5) installs in /usr/local, but apparently subsequent cabal install modules which need readline finds it, even though installing in ~/.cabal/. I wonder if having multiple libreadline5.x.dylib and ...6... in /opt/local/lib, the residue from the previous MacPorts, some not deactivated, may confuse Cabal. In any case, installing things manually into /usr/local/ generally coexisted well with MacPorts for me, so this works for now. Cheers, Alexy
participants (4)
-
Alexy Khrabrov
-
Antoine Latter
-
Duncan Coutts
-
Judah Jacobson