Cabal: Manual Installation & Configuration

Today I wanted to spent some of my time installing and configuring Cabal;
I recently installed the new version of GHC (7.6.1) for Archlinux, and cabal suggested me to update my cabal package from 1.10 to a newer version. But, when I was trying to install it (cabal install cabal-install), I got an error.

cabal install cabal-install
...
Resolving dependencies...cabal: Couldn't read cabal file "hashable/1.2.0.0/hashable.cabal"
...

Well, I searched a little on the web, and I found that I have to install it manually, so I downloaded the newer version of Cabal from Hackage and tried to install it again.

./bootstrap.sh

However, I got another error again. This time, it was a compilation error on the package HTTP, on the file Auth.hs, something with URL’s.

Trying to fix it manually, I noticed that the bootstrap.sh was installing the version 2.4 of HTTP but there were a newer 2.6 version. So I changed to the new one and worked it out.

The next steps was to configure cabal. It is not needed for normal use, but personally I prefer that cabal installs my packages on /usr/local/bin and not below my user (~/.cabal/). And also I want cabal to generate the documentation automatically, etc. So a few changes on the cabal config file (~/.cabal/config) is needed.

First, global installation: just uncomment some fields

user-install: False
root-cmd: sudo

For documentation

documentation: True
doc-index-file: $datadir/doc/index.html

You will also need to install the package haddock (cabal install haddock) for documentation.
One thing I don’t know but I would like, is to automatically generate hscolour output on the documentation. It would be wonderful to have all packages with his colored code available on documentation.

That’s all I think.

PS: Don’t forget to do cabal update right after installing cabal.

Advertisements

About gcarlos

Some people call me engineer, other developer or programmer, but I rather like be called scientist because that is what I really want to do ...
This entry was posted in cabal, haskell and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s