The regular method to install packages was:
find the package on Hackage http://hackage.haskell.org/packages/archive/pkg-list.html#cat:user-interface
unpack the file in a directory of your choice
change into this directory
runghc or runhaskell Setup.hs configure (or Setup.lhs – whatever is in the package)
runghc or runhaskell Setup.hs build
- sudo runghc or sudo runhaskell Setup.hs install
With this command, the compiled content is moved to /usr/local/lib and registered with the package manager of ghc (in /usr/lib/ghc-6.8.2)
- download the package as a .tar.gz file (link at the bottom of the page)
The procedure is simple, but time consuming to satisfy the dependencies between packages. A package may need another packages that must be previously installed, which is discovered in step 5 (configure). Then the package required must be installed first; it is usually easy to find on the hackage page of the dependent package, but may require yet another package...
Cabal automates this. The only problem was that I could not find a ready made cabal-install program and had to construct it. I had a new and clean installation for GHC 6.8.2 in Ubuntu 9.04 Jaunty (and the same should apply for Ubuntu 8.04 Hardy and 8.10 Intrepid). I loaded a bunch of packages already available in the Ubuntu repository, of which libghc-network, libghc6-parsec and libghc6-zlib (with the dependent zlib...) are likely the only relevant ones here.
The blog http://www.kuliniewicz.org/blog/archives/2009/03/24/installing-ghc-610-on-ubuntu-intrepid/comment-page-1/ gave me a start, but I ran into problems with cabal-install-0.6.2 as described there, probably because I had a 6.8.2 ghc and difficulties to build network, which I could not download. I gave up with ghc 6.10 which is not yet available for ubuntu.
I tried first to use the traditional method to install cabal-install, but found later a simpler method:
- getting cabal-install-0.6.0 from hackage and use
- sudo sh bootstrap.sh
Required are the packages mtl, parsec and network, which I had. The result is an executable ~/.cabal/bin/cal, which I copied to /usr/bin (sudo cp ~/.cabal/bin/cabal /usr/bin). Next, it may be necessary to run cabal update to download the list of packages from hackage.
Now life should be wonderful! (I did just install WxGeneric with simply sudo cabal install WxGeneric...)
Alternatively and on a different computer, the traditional approach with manual download and configure/build/install worked for the combination
- HTTP 3001.0.4 (produces some warnings)
- Cabal 1.2.3
- cabal-install 0.4.0
Higher versions I could not get working – but the result is satisfying.
Later note for installation with 6.10.1:
I installed manually only parsec-126.96.36.199 and network-188.8.131.52 (with runhaskell Setup.hs configu/build/install) and then the ./bootstrap script in cabal-install-0.6.2 ran.