UNMAINTAINED: I no longer use this. There are now better ways to do similar things.
The multi-ghc repository contains tools for managing multiple distributions of GHC in a single system. It simplifies the installation process and switching the current environment to use one GHC+Cabal.
-
ghc-config- A Bash script that sets up the environment and switches between GHC+Cabal paths. This works primarily using directory conventions and symbolic links. -
Makefile- For symplifying the building of Linux binary tarballs.
-
Create a directory for your GHC distributions. We'll call this directory
$GHC_DISTRIBUTION_DIRfor now. -
Clone this repository into
$GHC_DISTRIBUTION_DIR. -
Add the following to your startup scripts (i.e. your
.bashrcor.bash_profile):# These environment variables are only necessary if you don't use the defaults # shown. GHC_DISTRIBUTION_DIR="/opt/ghc" GHC_CONFIG_DIR="$HOME/.ghc-config" CABAL_USER_DIR="$HOME/.cabal" # Add the paths for ghc-config, ghc, and cabal-installed binaries. Use # the actual paths if you don't set the variables above. PATH=$PATH:$GHC_DISTRIBUTION_DIR/bin # ghc-config PATH=$PATH:$GHC_CONFIG_DIR/ghc/bin # ghc PATH=$PATH:$CABAL_USER_DIR/bin # cabal and cabal-installed binaries # Initialize the current configuration for this session. ghc-config -i -
Install a GHC distribution into sudirectories of
$GHC_DISTRIBUTION_DIR/$GHC_VERSION/src, where$GHC_VERSIONis that particular GHC version number. For example:$ ls /opt/ghc/6.10.4/src ghc-6.10.4/ ghc-6.10.4-i386-unknown-linux-n.tar.bz2 -
Create a symbolic link to the included
Makefilein$GHC_DISTRIBUTION_DIR.$ cd /opt/ghc/6.10.4 $ ln -s ../Makefile -
Install the
$GHC_VERSIONof GHC using theMakefile. This will use the directory and naming conventions established by the previous steps. See the `Makefile for details.$ make install -
Restart your shell.
-
Run
ghc-configto see the help information. -
Run
ghc --versionto confirm that GHC works. -
Install
cabalby downloading the latest tarball and running thebootstrap.shscript. -
Run
cabal --versionto confirm that cabal-install works.