↓ Skip to main content

Debian Lenny and the Haskell Platform

Cur­rently there is no pack­age for the Haskell-Platform in Debian stable. How­ever, the source of this plat­form and GHC is avail­able for down­load at ghc and plat­form.

How­ever, there are some is­sues to solve when in­stalling the plat­form from source. Mainly you’ll be miss­ing sev­eral pack­ages. The fol­low­ing com­mands worked at my own Debian ma­chine. If you find out that’s some­thing is miss­ing that was ap­par­ently already in­stalled on my ma­chine, don’t hes­it­ate to leave a com­ment.

The fol­low­ing com­mands are all ex­ecuted as root. First we need to down­load the sources, I’m us­ing the x86 sources, but feel free to use the x64 ver­sion: [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 ex­tract 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]

Be­fore we do any other stuff, let’s en­sure that we have all the pack­ages and lib­rar­ies we need be­fore con­tinu­ing.

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

Also make sure that you ap­ply this patch to the plat­form, the bug has been around for some time now but hasn’t been fixed ap­par­ently, it can be found at bug #84:

[bash] patch -p0 haskell-platform-2009.2.0.2/scripts/install.sh Index: haskell-platform-2009.2.0.2/scripts/install.sh
#

— haskell-platform-2009.2.0.2.orig/scripts/install.sh +++ haskell-platform-2009.2.0.2/scripts/install.sh @@ -34,13 +34,23 @@ install_pkg () { fi }

+# Is this ex­act ver­sion of the pack­age already in­stalled? +is_pkg_installed () {

  • PKG_VER=$1
  • grep " ${PKG_VER} " installed.packages > /dev/null 2>&1 +}

Actually do something!
#

cd pack­ages for pkg in cat platform.packages; do

  • cd "${pkg}" || die "The dir­ect­ory for the com­pon­ent ${PKG} is miss­ing"
  • echo "In­stalling ${pkg}…"
  • install_pkg ${pkg}
  • cd ..
  • if is_pkg_installed "${pkg}"; then
  • echo "Plat­form pack­age ${pkg} is already in­stalled. Skip­ping…"
  • else
  • cd "${pkg}" || die "The dir­ect­ory for the com­pon­ent ${PKG} is miss­ing"
  • echo "In­stalling ${pkg}…"
  • install_pkg ${pkg}
  • cd ..
  • fi done

echo [/bash]

Now go to the ghc dir and build it.

[bash] cd ghc-6.10.4 ./con­fig­ure make in­stall [/bash]

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

[bash] cd ../haskell-platform-2009.2.0.2/ ./con­fig­ure make make in­stall [/bash]

And done! :)