Skip to content
David Christiansen edited this page Nov 3, 2013 · 20 revisions

Idris on Debian jessie

jessie is the codename of Debian's current testing release, and it is a good starting point to install Idris: Whereas wheezy, Debian's current stable release will get more and more outdated as time passes, jessie's packages are updated regularly and therefore more recent, usually only a few weeks behind sid (Debian's unstable release). This also makes Idris' installation easier, as e. g. llvm-3.3-dev, a requirement for Idris (cf. below) is already available on jessie. Being behind sid has the advantage nevertheless of avoiding the adventures and possible pitfalls of a bleeding edge release.

I will describe the installation of Idris in a virtual Haskell environment: hsenv, relying in great part on Debian packages.

Having installed a basic Hakell environment, and in particular cabal from Debian (your milage may vary, of course):

# aptitude install ghc 
# aptitude install haskell-platform
# aptitude install cabal-install
# aptitude install libgmp-dev

(These commands can be shortened, as haskell-platform depends on ghc e. g.) I cabal install only one single package: hsenv system wide in my home dir i. e.

$ cabal update 
$ cabal install hsenv

Further packages I install either from Debian or from within my isolated Haskell environment. Anyway, a few more Debian packages are needed:

# aptitude install llvm-3.3-dev libghc-terminfo-dev pkg-config libgc-dev
# aptitude install build-essential libghc-llvm-dev 

A virtual env is created easily:

$ mkdir foo
$ cd foo
$ hsenv

Activate this environment with

$ source .hsenv/bin/activate

(as desribed in the output of issuing the command hsenv above, not shown here). This will give you an indication of your env being activated at the prompt:

[hsenv]$ 

By the way, as I use hsenv quite a lot, I have shortcuts for activating (a) and deactivating (d) defined in my .bashrc:

a()
{
    if [ -d "$(find . -maxdepth 1 -name ".hsenv")" ]; then
        echo "activating hsenv..."
        source ./.hsenv/bin/activate
    else
        echo "not a virtual hs env"
    fi
}


d()
{
    if [  -d "$(find . -maxdepth 1 -name ".hsenv")" ]; then
        echo "deactivating hsenv..."
        deactivate_hsenv
    else
        echo "not a virtual hs env"
    fi
}

This should be enough to install Idris:

[hsenv]$ cabal update
[hsenv]$ cabal install idris

cabal-dev instead of hsenv should do just as well. Likewise cabal sandboxes, which I haven't tried yet however, as my Debian installed version of cabal (v 1.16.0.2-2) doesn't provide them yet.

If everything goes well, you should be able to just call idris from within your activated env

[hsenv]$ idris

The packages installed this way can be seen in .hsenv/cabal/lib. Some of those are available for Debian as well in recent enough versions, and the more I install from Debian, the less will cabal have to do, besides I will automatically get Debian updates etc. So, while not strictly necessary, I also install from Debian before cabal installing idris

# aptitude install libghc-vector-dev 
# aptitude install libghc-blaze-builder-dev
# aptitude install libghc-blaze-markup-dev
# aptitude install libghc-utf8-string-dev
# aptitude install libghc-dlist-dev

You should be able to veryfy in a fresh hsenv, that the list of cabal built packages gets shorter this way, and I assume there are more Debian Haskell packages that one could make use of.

It should be pointed out though: some Debian Haskell packages installed this way, will just not be used, as Idris requires newer version than the ones provided by jessie (though I haven't studied the version numbers in detail yet), e. g. having Debian installed

# aptitude install libghc-ansi-terminal-dev
# aptitude install libghc-ansi-wl-pprint-dev

cabal will still install ansi-terminal-0.6 and ansi-wl-pprint-0.6.6 in your hsenv.

And my experience was that having installed lens from Debian:

# aptitude libghc-data-lens-dev

is actually a bad idea, as it even defeats Idris' installation...

[hsenv]$ cabal install idris
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: idris-0.9.9.3
rejecting: trifecta-1.2.1.1, 1.2.1, 1.2 (conflict: idris => trifecta==1.1)
trying: trifecta-1.1
trying: reducers-3.10.1
trying: keys-3.10
trying: free-4.1
trying: bifunctors-4.1.0.1
rejecting: semigroupoids-1.3.1.2/installed-142... (conflict: reducers =>
semigroupoids>=4 && <5)
trying: semigroupoids-4.0
trying: contravariant-0.2.0.2/installed-4f2...
rejecting: lens-3.10 (conflict: contravariant==0.2.0.2/installed-4f2..., lens
=> contravariant>=0.3 && <1)
rejecting: lens-3.9.2, 3.9.1, 3.9.0.3, 3.9.0.2, 3.9.0.1, 3.9, 3.8.7.3,
3.8.7.2, 3.8.7.1, 3.8.7, 3.8.6, 3.8.5, 3.8.4, 3.8.3, 3.8.2 (conflict:
bifunctors==4.1.0.1, lens => bifunctors>=3 && <4)
rejecting: lens-3.8.1, 3.8.0.2, 3.8.0.1, 3.8, 3.7.6, 3.7.5, 3.7.4, 3.7.3,
3.7.2, 3.7.1.2, 3.7.1.1, 3.7.1, 3.7.0.2, 3.7.0.1, 3.7, 3.6.0.4, 3.6.0.3,
3.6.0.2, 3.6.0.1, 3.6, 3.5.1, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0.6, 3.0.5, 3.0.4,
3.0.3, 3.0.2, 3.0.1, 3.0, 2.9, 2.8, 2.7.0.1, 2.7, 2.6.1, 2.6, 2.5, 2.4.0.2,
2.4, 2.3, 2.2, 2.1, 2.0, 1.9.1, 1.9, 1.8, 1.7.1, 1.7, 1.6, 1.5, 1.4.1, 1.4,
1.3.1, 1.3, 1.2, 1.1.1, 1.1, 1.0.3, 1.0.2, 1.0.1, 1.0, 0.9, 0.8, 0.7, 0.6,
0.5, 0.4, 0.3, 0.2, 0.1 (conflict: trifecta => lens>=3.8.2 && <4)
[hsenv]$

(haven't bothered yet to study these version conflicts in detail)

Clone this wiki locally