# Debian Lenny and the Haskell Platform

Currently there is no package for the Haskell-Platform in Debian stable. However, the source of this platform and GHC is available for download at ghc and platform.

However, there are some issues to solve when installing the platform from source. Mainly you’ll be missing several packages. The following commands worked at my own Debian machine. If you find out that’s something is missing that was apparently already installed on my machine, don’t hesitate to leave a comment.

The following commands are all executed as root. First we need to download the sources, I’m using the x86 sources, but feel free to use the x64 version: [bash] cd /tmp wget http://www.haskell.org/ghc/dist/6.10.4/ghc-6.10.4-i386-unknown-linux-n.tar.bz2 wget http://hackage.haskell.org/platform/2009.2.0.2/haskell-platform-2009.2.0.2.tar.gz [/bash]

Now we need to extract these sources:

[bash] tar xvf ghc-6.10.4-i386-unknown-linux-n.tar.bz2 tar xvzf haskell-platform-2009.2.0.2.tar.gz [/bash]

Before we do any other stuff, let’s ensure that we have all the packages and libraries we need before continuing.

[bash] apt-get install build-essential libghc6-opengl-dev libghc6-glut-dev libeditline-dev libedit2 libedit-dev [/bash]

Also make sure that you apply this patch to the platform, the bug has been around for some time now but hasn’t been fixed apparently, it can be found at bug #84:

+# Is this exact version of the package already installed? +is_pkg_installed () { + PKG_VER=$1 + grep ”${PKG_VER} ” installed.packages > /dev/null 2>&1 +} + # Actually do something! cd packages for pkg in cat platform.packages; do - cd “${pkg}” || die “The directory for the component${PKG} is missing” - echo “Installing ${pkg}…” - install_pkg${pkg} - cd .. + if is_pkg_installed “${pkg}”; then + echo “Platform package${pkg} is already installed. Skipping…” + else + cd “${pkg}” || die “The directory for the component${PKG} is missing” + echo “Installing ${pkg}…” + install_pkg${pkg} + cd .. + fi done

echo [/bash]

Now go to the ghc dir and build it.

[bash] cd ghc-6.10.4 ./configure make install [/bash]

And if all of this goes well you can now go to the haskell-platform dir and install it:

[bash] cd ../haskell-platform-2009.2.0.2/ ./configure make make install [/bash]

And done! :)