Skip to content

Instantly share code, notes, and snippets.

@yantonov
Last active June 11, 2020 09:20
Show Gist options
  • Save yantonov/10083524 to your computer and use it in GitHub Desktop.
Save yantonov/10083524 to your computer and use it in GitHub Desktop.

Revisions

  1. yantonov revised this gist Aug 23, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ### How to install latest GHC from source + latest stack + cabal + cabal-install on ubuntu
    ### How to install GHC from source + latest stack + cabal + cabal-install on ubuntu

    for your convinience these instuction is available as:
    for your convinience this instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

  2. yantonov revised this gist Feb 12, 2017. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,7 @@ for your convinience these instuction is available as:
    STACK_DIST_FILENAME=`ls -1 | grep 'stack-.*\.tar\.gz'`
    STACK_VERSION=`echo $STACK_DIST_FILENAME | sed -E 's/stack-([.0-9]+)-.*/\1/'`
    STACK_TARGET_DIR="stack-$STACK_VERSION"
    echo "stack $STACK_VERSION will be installed"

    tar xvf $STACK_DIST_FILENAME
    STACK_DIST_UNZIPPED_DIR=`ls -d -1 stack-*/`
    @@ -79,6 +80,8 @@ for your convinience these instuction is available as:
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.xz"

    ### ghc installation

    echo "GHC $GHC_VERSION will be installed"

    # get distr
    cd $DOWNLOADS_DIR
    @@ -120,9 +123,10 @@ for your convinience these instuction is available as:

    #### cabal library

    CABAL_VERSION=`curl https://www.haskell.org/cabal/release/cabal-latest/ | grep -E 'Cabal-([.0-9]+\.[0-9]).*' | sed -E 's/.*>Cabal-([.0-9]+\.[0-9]).*/\1/' | head -n 1`
    echo "Cabal $CABAL_VERSION will be installed..."
    CABAL_VERSION=`curl https://www.haskell.org/cabal/release/cabal-latest/ | grep -E 'Cabal-([.0-9]+\.[0-9]).*' | sed -E 's/.*>Cabal-([.0-9]+\.[0-9]).*/\1/' | head -n 1`
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    echo "Cabal $CABAL_VERSION will be installed..."

    # clone dist
    cd $DOWNLOADS_DIR
    @@ -144,9 +148,10 @@ for your convinience these instuction is available as:

    #### cabal-install

    CABAL_INSTALL_VERSION=`curl https://www.haskell.org/cabal/release/cabal-install-latest/ | grep -E 'cabal-install-([.0-9]+\.[0-9]).*' | sed -E 's/.*>cabal-install-([.0-9]+\.[0-9]).*/\1/' | head -n 1`
    CABAL_INSTALL_VERSION=`curl https://www.haskell.org/cabal/release/cabal-install-latest/ | grep -E 'cabal-install-([.0-9]+\.[0-9]).*' | sed -E 's/.*>cabal-install-([.0-9]+\.[0-9]).*/\1/' | head -n 1`
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    echo "cabal install $CABAL_INSTALL_VERSION will be installed..."
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    # get distributive
    cd $DOWNLOADS_DIR
  3. yantonov revised this gist Feb 12, 2017. 1 changed file with 22 additions and 24 deletions.
    46 changes: 22 additions & 24 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,20 @@
    ### How to install latest GHC 8.0.2 from source + latest stack + cabal 1.24.2.0 + cabal-install 1.24.0.2 on ubuntu
    ### How to install latest GHC from source + latest stack + cabal + cabal-install on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    # preferred way install stack than install ghc
    ### stack (package manager and build tool, preferrered way to manage dependencies)

    ### settings

    # settings
    DOWNLOADS_DIR=$HOME/Downloads

    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_URL="https://www.stackage.org/stack/$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_INSTALL_DIR="$HOME/Development/bin"

    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $DOWNLOADS_DIR

    curl -L -O $STACK_DIST_URL
    @@ -64,31 +62,23 @@ for your convinience these instuction is available as:

    # OLD way (manual installation of ghc)

    ### settings
    ### ubuntu prerequisites

    # Multiprecision arithmetic library developers tools, zlib
    sudo apt-get install libgmp-dev zlib1g-dev -y
    sudo -K

    ### ghc

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="8.0.2"
    GHC_VERSION=`curl https://downloads.haskell.org/~ghc/ | grep -E '([.0-9]+)/' | sed -E 's/.*>([.0-9]+).*/\1/' | uniq | sort -r | head -n 1`
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.xz"

    CABAL_VERSION="1.24.2.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.24.0.2"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc

    ### ubuntu prerequisites

    # Multiprecision arithmetic library developers tools, zlib
    sudo apt-get install libgmp-dev zlib1g-dev -y
    sudo -K

    ### ghc installation
    ### ghc installation

    # get distr
    cd $DOWNLOADS_DIR
    @@ -130,6 +120,10 @@ for your convinience these instuction is available as:

    #### cabal library

    CABAL_VERSION=`curl https://www.haskell.org/cabal/release/cabal-latest/ | grep -E 'Cabal-([.0-9]+\.[0-9]).*' | sed -E 's/.*>Cabal-([.0-9]+\.[0-9]).*/\1/' | head -n 1`
    echo "Cabal $CABAL_VERSION will be installed..."
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    # clone dist
    cd $DOWNLOADS_DIR
    curl -O "https://www.haskell.org/cabal/release/cabal-$CABAL_VERSION/$CABAL_DIST_FILENAME"
    @@ -150,6 +144,10 @@ for your convinience these instuction is available as:

    #### cabal-install

    CABAL_INSTALL_VERSION=`curl https://www.haskell.org/cabal/release/cabal-install-latest/ | grep -E 'cabal-install-([.0-9]+\.[0-9]).*' | sed -E 's/.*>cabal-install-([.0-9]+\.[0-9]).*/\1/' | head -n 1`
    echo "cabal install $CABAL_INSTALL_VERSION will be installed..."
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    # get distributive
    cd $DOWNLOADS_DIR
    curl -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"
  4. yantonov revised this gist Feb 12, 2017. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 8.0.2 from source + stack 1.3.2 + cabal 1.24.2.0 + cabal-install 1.24.0.2 on ubuntu
    ### How to install latest GHC 8.0.2 from source + latest stack + cabal 1.24.2.0 + cabal-install 1.24.0.2 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,21 +10,16 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.3.2"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    STACK_DIST_UNZIPPED_DIR="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_DIST_URL="https://www.stackage.org/stack/$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $DOWNLOADS_DIR

    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME
    curl -L -O $STACK_DIST_URL

    # in case if error like this:
    #curl: (77) error setting certificate verify locations: CAfile:
    @@ -35,13 +30,18 @@ for your convinience these instuction is available as:
    # capath=/etc/ssl/certs/
    # cacert=/etc/ssl/certs/ca-certificates.crt

    # move to home development dir
    STACK_DIST_FILENAME=`ls -1 | grep 'stack-.*\.tar\.gz'`
    STACK_VERSION=`echo $STACK_DIST_FILENAME | sed -E 's/stack-([.0-9]+)-.*/\1/'`
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    tar xvf $STACK_DIST_FILENAME
    STACK_DIST_UNZIPPED_DIR=`ls -d -1 stack-*/`

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mkdir -p $STACK_INSTALL_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR

    # sym link
    rm -rvi stack
    ln -s `pwd`/$STACK_TARGET_DIR stack
  5. yantonov revised this gist Feb 12, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -37,6 +37,7 @@ for your convinience these instuction is available as:

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mkdir -p $STACK_INSTALL_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR
  6. yantonov revised this gist Jan 18, 2017. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 8.0.1 from source + stack 1.2.0 + cabal 1.24.0.0 + cabal-install 1.24.0.0 on ubuntu
    ### How to install latest GHC 8.0.2 from source + stack 1.3.2 + cabal 1.24.2.0 + cabal-install 1.24.0.2 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,7 +10,7 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.2.0"
    STACK_VERSION="1.3.2"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    @@ -67,16 +67,16 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="8.0.1"
    GHC_VERSION="8.0.2"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.xz"

    CABAL_VERSION="1.24.0.0"
    CABAL_VERSION="1.24.2.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.24.0.0"
    CABAL_INSTALL_VERSION="1.24.0.2"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc
  7. yantonov revised this gist Dec 4, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 8.0.1 from source + stack 1.1.2 + cabal 1.24.0.0 + cabal-install 1.24.0.0 on ubuntu
    ### How to install latest GHC 8.0.1 from source + stack 1.2.0 + cabal 1.24.0.0 + cabal-install 1.24.0.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,7 +10,7 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.1.2"
    STACK_VERSION="1.2.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    @@ -167,3 +167,4 @@ for your convinience these instuction is available as:
    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

  8. yantonov revised this gist Oct 2, 2016. 1 changed file with 18 additions and 10 deletions.
    28 changes: 18 additions & 10 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.3 from source + stack 1.0.4 + cabal 1.22.8.0 + cabal-install 1.22.9.0 on ubuntu
    ### How to install latest GHC 8.0.1 from source + stack 1.1.2 + cabal 1.24.0.0 + cabal-install 1.24.0.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,12 +10,12 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.0.4"
    STACK_VERSION="1.1.2"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="osx"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    STACK_DIST_UNZIPPED_DIR="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_DIST_URL="https://www.stackage.org/stack/osx-x86_64"
    STACK_DIST_URL="https://www.stackage.org/stack/$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    @@ -26,6 +26,15 @@ for your convinience these instuction is available as:
    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # in case if error like this:
    #curl: (77) error setting certificate verify locations: CAfile:
    # /etc/pki/tls/certs/ca-bundle.crt CApath:
    # ...
    # create ~/.curlrc file
    # and put this lines to it
    # capath=/etc/ssl/certs/
    # cacert=/etc/ssl/certs/ca-certificates.crt

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    @@ -58,16 +67,16 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="7.10.3"
    GHC_VERSION="8.0.1"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.xz"

    CABAL_VERSION="1.22.8.0"
    CABAL_VERSION="1.24.0.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.9.0"
    CABAL_INSTALL_VERSION="1.24.0.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc
    @@ -84,7 +93,7 @@ for your convinience these instuction is available as:
    cd $DOWNLOADS_DIR
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfj $GHC_DIST_FILENAME
    tar xvfJ $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

    # install to
    @@ -158,4 +167,3 @@ for your convinience these instuction is available as:
    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

  9. yantonov revised this gist Sep 20, 2016. 1 changed file with 10 additions and 19 deletions.
    29 changes: 10 additions & 19 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 8.0.1 from source + stack 1.1.2 + cabal 1.24.0.0 + cabal-install 1.24.0.0 on ubuntu
    ### How to install latest GHC 7.10.3 from source + stack 1.0.4 + cabal 1.22.8.0 + cabal-install 1.22.9.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,12 +10,12 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.1.2"
    STACK_VERSION="1.0.4"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_PLATFORM="osx"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    STACK_DIST_UNZIPPED_DIR="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_DIST_URL="https://www.stackage.org/stack/$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_DIST_URL="https://www.stackage.org/stack/osx-x86_64"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    @@ -26,15 +26,6 @@ for your convinience these instuction is available as:
    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # in case if error like this:
    #curl: (77) error setting certificate verify locations: CAfile:
    # /etc/pki/tls/certs/ca-bundle.crt CApath:
    # ...
    # create ~/.curlrc file
    # and put this lines to it
    # capath=/etc/ssl/certs/
    # cacert=/etc/ssl/certs/ca-certificates.crt

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    @@ -67,16 +58,16 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="8.0.1"
    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.xz"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"

    CABAL_VERSION="1.24.0.0"
    CABAL_VERSION="1.22.8.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.24.0.0"
    CABAL_INSTALL_VERSION="1.22.9.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc
    @@ -93,7 +84,7 @@ for your convinience these instuction is available as:
    cd $DOWNLOADS_DIR
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfJ $GHC_DIST_FILENAME
    tar xvfj $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

    # install to
    @@ -139,7 +130,7 @@ for your convinience these instuction is available as:

    # build
    ghc --make Setup.hs
    ./Setup configure --user
    ./Setup configure --user --enable-library-profiling
    ./Setup build
    ./Setup install

  10. yantonov revised this gist May 28, 2016. 1 changed file with 18 additions and 9 deletions.
    27 changes: 18 additions & 9 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.3 from source + stack 1.0.4 + cabal 1.22.8.0 + cabal-install 1.22.9.0 on ubuntu
    ### How to install latest GHC 8.0.1 from source + stack 1.1.2 + cabal 1.24.0.0 + cabal-install 1.24.0.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,12 +10,12 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.0.4"
    STACK_VERSION="1.1.2"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="osx"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    STACK_DIST_UNZIPPED_DIR="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_DIST_URL="https://www.stackage.org/stack/osx-x86_64"
    STACK_DIST_URL="https://www.stackage.org/stack/$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    @@ -26,6 +26,15 @@ for your convinience these instuction is available as:
    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # in case if error like this:
    #curl: (77) error setting certificate verify locations: CAfile:
    # /etc/pki/tls/certs/ca-bundle.crt CApath:
    # ...
    # create ~/.curlrc file
    # and put this lines to it
    # capath=/etc/ssl/certs/
    # cacert=/etc/ssl/certs/ca-certificates.crt

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    @@ -58,16 +67,16 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="7.10.3"
    GHC_VERSION="8.0.1"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.xz"

    CABAL_VERSION="1.22.8.0"
    CABAL_VERSION="1.24.0.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.9.0"
    CABAL_INSTALL_VERSION="1.24.0.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc
    @@ -84,7 +93,7 @@ for your convinience these instuction is available as:
    cd $DOWNLOADS_DIR
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfj $GHC_DIST_FILENAME
    tar xvfJ $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

    # install to
  11. yantonov revised this gist Mar 10, 2016. 1 changed file with 71 additions and 68 deletions.
    139 changes: 71 additions & 68 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    ### How to install latest GHC 7.10.3 from source + stack 1.0.2 + cabal 1.22.7.0 + cabal-install 1.22.8.0 on mac os
    ### How to install latest GHC 7.10.3 from source + stack 1.0.4 + cabal 1.22.8.0 + cabal-install 1.22.9.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/23b15966eb46c45b73e0)
    [git repo](https://github.com/yantonov/install-ghc)
    # Prefererred way install stack then install ghc using stack
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    # preferred way install stack than install ghc

    ### settings

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.0.2"
    STACK_VERSION="1.0.4"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="osx"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    @@ -19,102 +19,104 @@ for your convinience these instuction is available as:
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"


    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $DOWNLOADS_DIR

    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR

    # sym link
    cd $STACK_INSTALL_DIR
    # delete old link
    rm -fv stack
    rm -rvi stack
    ln -s `pwd`/$STACK_TARGET_DIR stack

    # add to PATH environment
    STACK_HOME=$STACK_INSTALL_DIR/stack
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME:$PATH

    # clean up
    cd $DOWNLOADS_DIR
    rm -rfv stack-$STACK_VERSION*
    cd $DOWNLOADS_DIR
    rm -rf stack-$STACK_VERSION*

    ### install ghc using stack

    ### then install ghc
    # install ghc
    stack setup
    # run repl
    stack ghci

    # install ghc
    stack setup
    # run repl
    stack ghci

    # OLD way (manual installation of ghc)

    ### settings

    DOWNLOADS_DIR=$HOME/Downloads
    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    PLATFORM="apple-darwin"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"
    GHC_DIST_FILE="https://downloads.haskell.org/~ghc/$GHC_VERSION/$GHC_DIST_FILENAME"

    CABAL_VERSION="1.22.7.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"
    CABAL_VERSION="1.22.8.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.8.0"
    CABAL_INSTALL_VERSION="1.22.9.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc

    # install xcode command line tools from here:
    # [xcode command line tools site](https://developer.apple.com/downloads)

    # go to Downloads
    cd $DOWNLOADS_DIR

    # get ghc sources
    curl -O $GHC_DIST_FILE

    # extract files
    tar xvfj $GHC_DIST_FILENAME
    ### ubuntu prerequisites

    # goto extracted dir
    cd ghc-$GHC_VERSION
    # Multiprecision arithmetic library developers tools, zlib
    sudo apt-get install libgmp-dev zlib1g-dev -y
    sudo -K

    # configure
    mkdir -p $HOME/Development/bin/ghc-$GHC_VERSION
    ./configure --prefix=$HOME/Development/bin/ghc-$GHC_VERSION
    ### ghc installation

    # make and install
    # get distr
    cd $DOWNLOADS_DIR
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfj $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

    # install to
    mkdir $HOME/Development/bin/ghc-$GHC_VERSION
    # or choose another path

    ./configure --prefix=$HOME/Development/bin/ghc-$GHC_VERSION

    make install
    # for xcode4:
    # see [explanation](http://haskell.1045720.n5.nabble.com/Installing-ghc-7-8-3-OS-X-bindist-fails-on-Xcode-4-CLI-only-machine-td5752678.html)
    # make install CC_CLANG_BACKEND=0

    # symbol links
    cd $HOME/Development/bin
    rm -fv ghc
    ln -s `pwd`/ghc-$GHC_VERSION/ ghc

    # add $HOME/Development/bin/ghc to $PATH
    GHC_HOME=$HOME/Development/bin/ghc
    PATH=$GHC_HOME/bin:${PATH}

    rm -f ghc
    ln -s `pwd`/ghc-$GHC_VERSION ghc

    # add $HOME/Development/bin/ghc to $PATH
    # add this line to ~/.profile
    export GHC_HOME=$HOME/Development/bin/ghc
    export PATH=$GHC_HOME/bin:${PATH}

    # to use updated path without log off
    source ~/.profile

    # remove temporary files
    cd $DOWNLOADS_DIR
    rm -rfv ghc-$GHC_VERSION*
    cd $DOWNLOADS_DIR
    rm -rfv ghc-$GHC_VERSION*

    ### cabal (package manager, old way to manage dependencies)

    # remove old
    rm -rf $HOME/.cabal
    rm -rf $HOME/.ghc
    rm -rfv $HOME/.cabal
    rm -rfv $HOME/.ghc

    #### cabal library

    @@ -127,20 +129,20 @@ for your convinience these instuction is available as:
    cd Cabal-$CABAL_VERSION

    # build
    ghc --make Setup.hs
    ./Setup configure --user
    ./Setup build
    ./Setup install
    ghc --make Setup.hs
    ./Setup configure --user
    ./Setup build
    ./Setup install

    # Remove temporary files
    cd $DOWNLOADS_DIR
    rm -rfv Cabal-$CABAL_VERSION*
    # Remove temporary files
    cd $DOWNLOADS_DIR
    rm -rfv Cabal-$CABAL_VERSION*

    #### cabal-install

    # get distributive
    cd $DOWNLOADS_DIR
    curl -L -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"
    curl -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"

    # extract archive
    tar xzvf $CABAL_INSTALL_DIST_FILENAME
    @@ -154,5 +156,6 @@ for your convinience these instuction is available as:
    rm -rfv cabal-install-$CABAL_INSTALL_VERSION*

    # add path to cabal to PATH environment
    CABAL_HOME=$HOME/.cabal
    PATH=$CABAL_HOME/bin:$PATH
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

  12. yantonov revised this gist Feb 18, 2016. 1 changed file with 67 additions and 70 deletions.
    137 changes: 67 additions & 70 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    ### How to install latest GHC 7.10.3 from source + stack 1.0.2 + cabal 1.22.7.0 + cabal-install 1.22.8.0 on ubuntu
    ### How to install latest GHC 7.10.3 from source + stack 1.0.2 + cabal 1.22.7.0 + cabal-install 1.22.8.0 on mac os

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    # preferered way install stack than install ghc
    [gist](https://gist.github.com/yantonov/23b15966eb46c45b73e0)
    [git repo](https://github.com/yantonov/install-ghc)
    # Prefererred way install stack then install ghc using stack

    ### settings

    @@ -19,104 +19,102 @@ for your convinience these instuction is available as:
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"


    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $DOWNLOADS_DIR

    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR

    # sym link
    rm -rvi stack
    cd $STACK_INSTALL_DIR
    # delete old link
    rm -fv stack
    ln -s `pwd`/$STACK_TARGET_DIR stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    STACK_HOME=$STACK_INSTALL_DIR/stack
    PATH=$STACK_HOME:$PATH

    # clean up
    cd $DOWNLOADS_DIR
    rm -rf stack-$STACK_VERSION*

    ### install ghc using stack
    cd $DOWNLOADS_DIR
    rm -rfv stack-$STACK_VERSION*

    # install ghc
    stack setup
    # run repl
    stack ghci
    ### then install ghc

    # install ghc
    stack setup
    # run repl
    stack ghci

    # OLD way (manual installation of ghc)

    ### settings
    DOWNLOADS_DIR="$HOME/Downloads"

    DOWNLOADS_DIR=$HOME/Downloads

    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="deb8-linux"
    PLATFORM="apple-darwin"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"
    GHC_DIST_FILE="https://downloads.haskell.org/~ghc/$GHC_VERSION/$GHC_DIST_FILENAME"

    CABAL_VERSION="1.22.7.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"
    CABAL_VERSION="1.22.7.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.8.0"
    CABAL_INSTALL_VERSION="1.22.8.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc

    ### ubuntu prerequisites
    # install xcode command line tools from here:
    # [xcode command line tools site](https://developer.apple.com/downloads)

    # Multiprecision arithmetic library developers tools, zlib
    sudo apt-get install libgmp-dev zlib1g-dev -y
    sudo -K
    # go to Downloads
    cd $DOWNLOADS_DIR

    ### ghc installation
    # get ghc sources
    curl -O $GHC_DIST_FILE

    # get distr
    cd $DOWNLOADS_DIR
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfj $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

    # install to
    mkdir $HOME/Development/bin/ghc-$GHC_VERSION
    # or choose another path

    ./configure --prefix=$HOME/Development/bin/ghc-$GHC_VERSION

    # extract files
    tar xvfj $GHC_DIST_FILENAME

    # goto extracted dir
    cd ghc-$GHC_VERSION

    # configure
    mkdir -p $HOME/Development/bin/ghc-$GHC_VERSION
    ./configure --prefix=$HOME/Development/bin/ghc-$GHC_VERSION

    # make and install
    make install
    # for xcode4:
    # see [explanation](http://haskell.1045720.n5.nabble.com/Installing-ghc-7-8-3-OS-X-bindist-fails-on-Xcode-4-CLI-only-machine-td5752678.html)
    # make install CC_CLANG_BACKEND=0

    # symbol links
    cd $HOME/Development/bin
    rm -f ghc
    ln -s `pwd`/ghc-$GHC_VERSION ghc

    # add $HOME/Development/bin/ghc to $PATH
    # add this line to ~/.profile
    export GHC_HOME=$HOME/Development/bin/ghc
    export PATH=$GHC_HOME/bin:${PATH}

    # to use updated path without log off
    source ~/.profile

    rm -fv ghc
    ln -s `pwd`/ghc-$GHC_VERSION/ ghc

    # add $HOME/Development/bin/ghc to $PATH
    GHC_HOME=$HOME/Development/bin/ghc
    PATH=$GHC_HOME/bin:${PATH}

    # remove temporary files
    cd $DOWNLOADS_DIR
    rm -rfv ghc-$GHC_VERSION*
    cd $DOWNLOADS_DIR
    rm -rfv ghc-$GHC_VERSION*

    ### cabal (package manager, old way to manage dependencies)

    # remove old
    rm -rfv $HOME/.cabal
    rm -rfv $HOME/.ghc
    rm -rf $HOME/.cabal
    rm -rf $HOME/.ghc

    #### cabal library

    @@ -129,20 +127,20 @@ for your convinience these instuction is available as:
    cd Cabal-$CABAL_VERSION

    # build
    ghc --make Setup.hs
    ./Setup configure --user
    ./Setup build
    ./Setup install
    ghc --make Setup.hs
    ./Setup configure --user
    ./Setup build
    ./Setup install

    # Remove temporary files
    cd $DOWNLOADS_DIR
    rm -rfv Cabal-$CABAL_VERSION*
    # Remove temporary files
    cd $DOWNLOADS_DIR
    rm -rfv Cabal-$CABAL_VERSION*

    #### cabal-install

    # get distributive
    cd $DOWNLOADS_DIR
    curl -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"
    curl -L -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"

    # extract archive
    tar xzvf $CABAL_INSTALL_DIST_FILENAME
    @@ -156,6 +154,5 @@ for your convinience these instuction is available as:
    rm -rfv cabal-install-$CABAL_INSTALL_VERSION*

    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

    CABAL_HOME=$HOME/.cabal
    PATH=$CABAL_HOME/bin:$PATH
  13. yantonov revised this gist Feb 10, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.3 from source + stack 1.0.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu
    ### How to install latest GHC 7.10.3 from source + stack 1.0.2 + cabal 1.22.7.0 + cabal-install 1.22.8.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -10,7 +10,7 @@ for your convinience these instuction is available as:

    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.0.0"
    STACK_VERSION="1.0.2"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="osx"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    @@ -61,13 +61,13 @@ for your convinience these instuction is available as:
    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="unknown-linux"
    PLATFORM="deb8-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"

    CABAL_VERSION="1.22.4.0"
    CABAL_VERSION="1.22.7.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_VERSION="1.22.8.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc
  14. yantonov revised this gist Jan 22, 2016. 1 changed file with 29 additions and 22 deletions.
    51 changes: 29 additions & 22 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -4,32 +4,20 @@ for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    ### settings

    DOWNLOADS_DIR="$HOME/Downloads"
    # preferered way install stack than install ghc

    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="unknown-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"

    CABAL_VERSION="1.22.4.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"
    ### settings

    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"
    DOWNLOADS_DIR=$HOME/Downloads

    STACK_VERSION="1.0.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_PLATFORM="osx"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    STACK_DIST_URL="https://www.stackage.org/stack/linux-x86_64"
    STACK_DIST_UNZIPPED_DIR="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    ## preferered way install stack than install ghc
    STACK_DIST_URL="https://www.stackage.org/stack/osx-x86_64"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    ### stack (package manager and build tool, preferrered way to manage dependencies)

    @@ -56,12 +44,31 @@ for your convinience these instuction is available as:
    cd $DOWNLOADS_DIR
    rm -rf stack-$STACK_VERSION*

    ### install ghci using stack
    ### install ghc using stack

    # install ghc
    stack setup
    # this will install ghc into ~/.stack
    # run repl
    stack ghci

    ## OLD way [manual installation of ghc]

    # OLD way (manual installation of ghc)

    ### settings

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="unknown-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"

    CABAL_VERSION="1.22.4.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc

  15. yantonov revised this gist Jan 22, 2016. 1 changed file with 34 additions and 25 deletions.
    59 changes: 34 additions & 25 deletions install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,40 @@ for your convinience these instuction is available as:
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    ## preferered way install stack than install ghc

    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $DOWNLOADS_DIR

    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR

    # sym link
    rm -rvi stack
    ln -s `pwd`/$STACK_TARGET_DIR stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME:$PATH

    # clean up
    cd $DOWNLOADS_DIR
    rm -rf stack-$STACK_VERSION*

    ### install ghci using stack
    stack setup
    # this will install ghc into ~/.stack
    stack ghci

    ## OLD way [manual installation of ghc]

    ### ghc

    ### ubuntu prerequisites
    @@ -71,31 +105,6 @@ for your convinience these instuction is available as:
    cd $DOWNLOADS_DIR
    rm -rfv ghc-$GHC_VERSION*

    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $DOWNLOADS_DIR

    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR

    # sym link
    rm -rvi stack
    ln -s `pwd`/$STACK_TARGET_DIR stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME:$PATH

    # clean up
    cd $DOWNLOADS_DIR
    rm -rf stack-$STACK_VERSION*

    ### cabal (package manager, old way to manage dependencies)

    # remove old
  16. yantonov renamed this gist Jan 9, 2016. 1 changed file with 25 additions and 19 deletions.
    44 changes: 25 additions & 19 deletions install-ghc.md → install-ghc-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    ### How to install latest GHC 7.10.3 from source + stack 0.1.10.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu
    ### How to install latest GHC 7.10.3 from source + stack 1.0.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    ### settings

    DOWNLOADS_DIR="$HOME/Downloads"

    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    @@ -18,10 +20,14 @@ for your convinience these instuction is available as:
    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    STACK_VERSION="0.1.10.0"
    STACK_VERSION="1.0.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    STACK_DIST_URL="https://www.stackage.org/stack/linux-x86_64"
    STACK_DIST_UNZIPPED_DIR="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE"
    STACK_INSTALL_DIR="$HOME/Development/bin"
    STACK_TARGET_DIR="stack-$STACK_VERSION"

    ### ghc

    @@ -34,7 +40,7 @@ for your convinience these instuction is available as:
    ### ghc installation

    # get distr
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfj $GHC_DIST_FILENAME
    @@ -62,32 +68,32 @@ for your convinience these instuction is available as:
    source ~/.profile

    # remove temporary files
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    rm -rfv ghc-$GHC_VERSION*

    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $HOME/Downloads
    STACK_DIST_URL="https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$STACK_DIST_FILENAME"
    curl -L -O $STACK_DIST_URL
    cd $DOWNLOADS_DIR

    curl -L -o $STACK_DIST_FILENAME $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    mkdir -p $HOME/Development/bin/stack-$STACK_VERSION/bin
    mv stack $HOME/Development/bin/stack-$STACK_VERSION/bin
    rm $STACK_DIST_FILENAME
    cd $HOME/Development/bin
    rm -rf $STACK_INSTALL_DIR/$STACK_TARGET_DIR
    mv $STACK_DIST_UNZIPPED_DIR $STACK_INSTALL_DIR/$STACK_TARGET_DIR

    cd $STACK_INSTALL_DIR

    # sym link
    rm -ri stack
    ln -s `pwd`/stack-$STACK_VERSION stack
    rm -rvi stack
    ln -s `pwd`/$STACK_TARGET_DIR stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME/bin:$PATH
    PATH=$STACK_HOME:$PATH

    # clean up
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    rm -rf stack-$STACK_VERSION*

    ### cabal (package manager, old way to manage dependencies)
    @@ -99,7 +105,7 @@ for your convinience these instuction is available as:
    #### cabal library

    # clone dist
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    curl -O "https://www.haskell.org/cabal/release/cabal-$CABAL_VERSION/$CABAL_DIST_FILENAME"

    # extract
    @@ -113,13 +119,13 @@ for your convinience these instuction is available as:
    ./Setup install

    # Remove temporary files
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    rm -rfv Cabal-$CABAL_VERSION*

    #### cabal-install

    # get distributive
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    curl -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"

    # extract archive
    @@ -130,7 +136,7 @@ for your convinience these instuction is available as:
    ./bootstrap.sh

    # remove temporary files
    cd $HOME/Downloads
    cd $DOWNLOADS_DIR
    rm -rfv cabal-install-$CABAL_INSTALL_VERSION*

    # add path to cabal to PATH environment
  17. yantonov revised this gist Dec 7, 2015. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,24 @@
    ### How to install latest GHC 7.10.2 from source + stack 0.1.6.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu
    ### How to install latest GHC 7.10.3 from source + stack 0.1.10.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    ### settings

    GHC_VERSION="7.10.2"
    GHC_VERSION="7.10.3"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="unknown-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM-deb7.tar.bz2"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM.tar.bz2"

    CABAL_VERSION="1.22.4.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    STACK_VERSION="0.1.6.0"
    STACK_VERSION="0.1.10.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"
    @@ -35,7 +35,8 @@ for your convinience these instuction is available as:

    # get distr
    cd $HOME/Downloads
    wget "https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    GHC_DIST_URL="https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    curl -L -O $GHC_DIST_URL
    tar xvfj $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

  18. yantonov revised this gist Oct 25, 2015. 1 changed file with 15 additions and 9 deletions.
    24 changes: 15 additions & 9 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.2 from source + stack 0.1.5.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu
    ### How to install latest GHC 7.10.2 from source + stack 0.1.6.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -18,10 +18,10 @@ for your convinience these instuction is available as:
    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    STACK_VERSION="0.1.5.0"
    STACK_VERSION="0.1.6.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_ARCHITECTURE-$STACK_PLATFORM.tar.gz"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_PLATFORM-$STACK_ARCHITECTURE.tar.gz"

    ### ghc

    @@ -64,10 +64,11 @@ for your convinience these instuction is available as:
    cd $HOME/Downloads
    rm -rfv ghc-$GHC_VERSION*

    ### stack (new package manager and build tool, preferrered way to dependency management)
    ### stack (package manager and build tool, preferrered way to manage dependencies)

    cd $HOME/Downloads
    curl -L -O "https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$STACK_DIST_FILENAME"
    cd $HOME/Downloads
    STACK_DIST_URL="https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$STACK_DIST_FILENAME"
    curl -L -O $STACK_DIST_URL
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    @@ -76,15 +77,19 @@ for your convinience these instuction is available as:
    rm $STACK_DIST_FILENAME
    cd $HOME/Development/bin

    # sym link
    # sym link
    rm -ri stack
    ln -s `pwd`/stack-$STACK_VERSION stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME/bin:$PATH
    PATH=$STACK_HOME/bin:$PATH

    # clean up
    cd $HOME/Downloads
    rm -rf stack-$STACK_VERSION*

    ### cabal (package manager for haskell)
    ### cabal (package manager, old way to manage dependencies)

    # remove old
    rm -rfv $HOME/.cabal
    @@ -130,3 +135,4 @@ for your convinience these instuction is available as:
    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

  19. yantonov revised this gist Oct 17, 2015. 1 changed file with 23 additions and 22 deletions.
    45 changes: 23 additions & 22 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.2 from source + cabal 1.22.4.0 + cabal-install 1.22.6.0 + stack 0.1.5.0 on ubuntu
    ### How to install latest GHC 7.10.2 from source + stack 0.1.5.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -25,13 +25,13 @@ for your convinience these instuction is available as:

    ### ghc

    ubuntu prerequisites
    ### ubuntu prerequisites

    # Multiprecision arithmetic library developers tools, zlib
    sudo apt-get install libgmp-dev zlib1g-dev -y
    sudo -K

    ghc installation
    ### ghc installation

    # get distr
    cd $HOME/Downloads
    @@ -64,6 +64,26 @@ ghc installation
    cd $HOME/Downloads
    rm -rfv ghc-$GHC_VERSION*

    ### stack (new package manager and build tool, preferrered way to dependency management)

    cd $HOME/Downloads
    curl -L -O "https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$STACK_DIST_FILENAME"
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    mkdir -p $HOME/Development/bin/stack-$STACK_VERSION/bin
    mv stack $HOME/Development/bin/stack-$STACK_VERSION/bin
    rm $STACK_DIST_FILENAME
    cd $HOME/Development/bin

    # sym link
    ln -s `pwd`/stack-$STACK_VERSION stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME/bin:$PATH


    ### cabal (package manager for haskell)

    # remove old
    @@ -110,22 +130,3 @@ ghc installation
    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

    ### stack (new package manager and build tool)

    cd $HOME/Downloads
    curl -L -O "https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$STACK_DIST_FILENAME"
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    mkdir -p $HOME/Development/bin/stack-$STACK_VERSION/bin
    mv stack $HOME/Development/bin/stack-$STACK_VERSION/bin
    rm $STACK_DIST_FILENAME
    cd $HOME/Development/bin

    # sym link
    ln -s `pwd`/stack-$STACK_VERSION stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME/bin:$PATH
  20. yantonov revised this gist Oct 15, 2015. No changes.
  21. yantonov revised this gist Oct 15, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.2 from source + cabal 1.22.4.0 + cabal-install 1.22.6.0 + stack on ubuntu
    ### How to install latest GHC 7.10.2 from source + cabal 1.22.4.0 + cabal-install 1.22.6.0 + stack 0.1.5.0 on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -18,7 +18,7 @@ for your convinience these instuction is available as:
    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    STACK_VERSION="0.1.4.0"
    STACK_VERSION="0.1.5.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_ARCHITECTURE-$STACK_PLATFORM.tar.gz"
  22. yantonov revised this gist Sep 13, 2015. 1 changed file with 25 additions and 1 deletion.
    26 changes: 25 additions & 1 deletion install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.10.2 + cabal 1.22.4.0 + cabal-install 1.22.6.0 from source on ubuntu
    ### How to install latest GHC 7.10.2 from source + cabal 1.22.4.0 + cabal-install 1.22.6.0 + stack on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    @@ -18,6 +18,11 @@ for your convinience these instuction is available as:
    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    STACK_VERSION="0.1.4.0"
    STACK_ARCHITECTURE="x86_64"
    STACK_PLATFORM="linux"
    STACK_DIST_FILENAME="stack-$STACK_VERSION-$STACK_ARCHITECTURE-$STACK_PLATFORM.tar.gz"

    ### ghc

    ubuntu prerequisites
    @@ -105,3 +110,22 @@ ghc installation
    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH

    ### stack (new package manager and build tool)

    cd $HOME/Downloads
    curl -L -O "https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$STACK_DIST_FILENAME"
    tar xvfz $STACK_DIST_FILENAME

    # move to home development dir
    mkdir -p $HOME/Development/bin/stack-$STACK_VERSION/bin
    mv stack $HOME/Development/bin/stack-$STACK_VERSION/bin
    rm $STACK_DIST_FILENAME
    cd $HOME/Development/bin

    # sym link
    ln -s `pwd`/stack-$STACK_VERSION stack

    # add to PATH environment
    STACK_HOME=$HOME/Development/bin/stack
    PATH=$STACK_HOME/bin:$PATH
  23. yantonov revised this gist Aug 27, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    ### How to install latest GHC 7.10.1 + cabal 1.22.3.0 from source on ubuntu
    ### How to install latest GHC 7.10.2 + cabal 1.22.4.0 + cabal-install 1.22.6.0 from source on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    ### settings

    GHC_VERSION="7.10.1"
    GHC_VERSION="7.10.2"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="unknown-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM-deb7.tar.bz2"

    CABAL_VERSION="1.22.3.0"
    CABAL_VERSION="1.22.4.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.3.0"
    CABAL_INSTALL_VERSION="1.22.6.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc
  24. yantonov revised this gist Aug 27, 2015. 1 changed file with 31 additions and 21 deletions.
    52 changes: 31 additions & 21 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,21 @@

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)
    [git repo](https://github.com/yantonov/install-ghc)

    ### settings

    GHC_VERSION="7.10.1"
    ARCHITECTURE="x86_64"
    # for 32 bit ARCHITECTURE="i386"
    PLATFORM="unknown-linux"
    GHC_DIST_FILENAME="ghc-$GHC_VERSION-$ARCHITECTURE-$PLATFORM-deb7.tar.bz2"

    CABAL_VERSION="1.22.3.0"
    CABAL_DIST_FILENAME="Cabal-$CABAL_VERSION.tar.gz"

    CABAL_INSTALL_VERSION="1.22.3.0"
    CABAL_INSTALL_DIST_FILENAME="cabal-install-$CABAL_INSTALL_VERSION.tar.gz"

    ### ghc

    @@ -15,27 +29,23 @@ ubuntu prerequisites
    ghc installation

    # get distr
    cd $HOME/Downloads
    # 64 bit
    wget https://www.haskell.org/ghc/dist/7.10.1/ghc-7.10.1-x86_64-unknown-linux-deb7.tar.bz2
    tar xvfj ghc-7.10.1-x86_64-unknown-linux-deb7.tar.bz2
    # 32 bit
    # wget https://www.haskell.org/ghc/dist/7.10.1/ghc-7.10.1-i386-unknown-linux-deb7.tar.bz2
    # tar xvfj ghc-7.10.1-i386-unknown-linux-deb7.tar.bz2
    cd ghc-7.10.1
    cd $HOME/Downloads
    wget "https://www.haskell.org/ghc/dist/$GHC_VERSION/$GHC_DIST_FILENAME"
    tar xvfj $GHC_DIST_FILENAME
    cd ghc-$GHC_VERSION

    # install to
    mkdir $HOME/Development/bin/ghc-7.10.1
    mkdir $HOME/Development/bin/ghc-$GHC_VERSION
    # or choose another path

    ./configure --prefix=$HOME/Development/bin/ghc-7.10.1
    ./configure --prefix=$HOME/Development/bin/ghc-$GHC_VERSION

    make install

    # symbol links
    cd $HOME/Development/bin
    rm -f ghc
    ln -s `pwd`/ghc-7.10.1 ghc
    ln -s `pwd`/ghc-$GHC_VERSION ghc

    # add $HOME/Development/bin/ghc to $PATH
    # add this line to ~/.profile
    @@ -47,7 +57,7 @@ ghc installation

    # remove temporary files
    cd $HOME/Downloads
    rm -rfv ghc-7.10.1*
    rm -rfv ghc-$GHC_VERSION*

    ### cabal (package manager for haskell)

    @@ -59,11 +69,11 @@ ghc installation

    # clone dist
    cd $HOME/Downloads
    curl -O https://www.haskell.org/cabal/release/cabal-1.22.3.0/Cabal-1.22.3.0.tar.gz
    curl -O "https://www.haskell.org/cabal/release/cabal-$CABAL_VERSION/$CABAL_DIST_FILENAME"

    # extract
    tar xzvf Cabal-1.22.3.0.tar.gz
    cd Cabal-1.22.3.0
    tar xzvf $CABAL_DIST_FILENAME
    cd Cabal-$CABAL_VERSION

    # build
    ghc --make Setup.hs
    @@ -73,24 +83,24 @@ ghc installation

    # Remove temporary files
    cd $HOME/Downloads
    rm -rfv Cabal-1.22.3.0*
    rm -rfv Cabal-$CABAL_VERSION*

    #### cabal-install

    # get distributive
    cd $HOME/Downloads
    curl -O https://www.haskell.org/cabal/release/cabal-install-1.22.3.0/cabal-install-1.22.3.0.tar.gz
    curl -O "https://www.haskell.org/cabal/release/cabal-install-$CABAL_INSTALL_VERSION/$CABAL_INSTALL_DIST_FILENAME"

    # extract archive
    tar xzvf cabal-install-1.22.3.0.tar.gz
    cd cabal-install-1.22.3.0
    tar xzvf $CABAL_INSTALL_DIST_FILENAME
    cd cabal-install-$CABAL_INSTALL_VERSION

    # install
    ./bootstrap.sh

    # remove temporary files
    cd $HOME/Downloads
    rm -rfv cabal-install-1.22.3.0*
    rm -rfv cabal-install-$CABAL_INSTALL_VERSION*

    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
  25. yantonov revised this gist Apr 27, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    ### How to install latest GHC 7.10.1 + cabal 1.22.3.0 from source on ubuntu

    for your convinience these instuction is available as:
    [gist](https://gist.github.com/yantonov/10083524)
    [git repo](https://github.com/yantonov/install-ghc)

    ### ghc

    ubuntu prerequisites
  26. yantonov revised this gist Apr 25, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.8.4 + cabal 1.22 from source on ubuntu
    ### How to install latest GHC 7.10.1 + cabal 1.22.3.0 from source on ubuntu

    ### ghc

  27. yantonov revised this gist Apr 25, 2015. 1 changed file with 23 additions and 26 deletions.
    49 changes: 23 additions & 26 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -13,27 +13,28 @@ ghc installation
    # get distr
    cd $HOME/Downloads
    # 64 bit
    wget https://downloads.haskell.org/~ghc/7.8.4/ghc-7.8.4-x86_64-unknown-linux-deb7.tar.bz2
    tar xvfj ghc-7.8.4-x86_64-unknown-linux-deb7.tar.bz2
    wget https://www.haskell.org/ghc/dist/7.10.1/ghc-7.10.1-x86_64-unknown-linux-deb7.tar.bz2
    tar xvfj ghc-7.10.1-x86_64-unknown-linux-deb7.tar.bz2
    # 32 bit
    # wget https://downloads.haskell.org/~ghc/7.8.4/ghc-7.8.4-i386-unknown-linux-deb7.tar.bz2
    # tar xvfj ghc-7.8.4-i386-unknown-linux-deb7.tar.bz2
    cd ghc-7.8.4
    # wget https://www.haskell.org/ghc/dist/7.10.1/ghc-7.10.1-i386-unknown-linux-deb7.tar.bz2
    # tar xvfj ghc-7.10.1-i386-unknown-linux-deb7.tar.bz2
    cd ghc-7.10.1

    # install to
    mkdir $HOME/Development/bin/ghc-7.8.4
    mkdir $HOME/Development/bin/ghc-7.10.1
    # or choose another path

    ./configure --prefix=$HOME/Development/bin/ghc-7.8.4
    ./configure --prefix=$HOME/Development/bin/ghc-7.10.1

    make install

    # symbol links
    cd $HOME/Development/bin
    ln -s `pwd`/ghc-7.8.4 ghc
    cd $HOME/Development/bin
    rm -f ghc
    ln -s `pwd`/ghc-7.10.1 ghc

    # add $HOME/Development/bin/ghc to $PATH
    # add this line to ~/.profile
    # add $HOME/Development/bin/ghc to $PATH
    # add this line to ~/.profile
    export GHC_HOME=$HOME/Development/bin/ghc
    export PATH=$GHC_HOME/bin:${PATH}

    @@ -42,22 +43,23 @@ ghc installation

    # remove temporary files
    cd $HOME/Downloads
    rm -rf ghc-7.8.4*
    rm -rfv ghc-7.10.1*

    ### cabal (package manager for haskell)

    # remove old
    rm -rf $HOME/.cabal
    rm -rfv $HOME/.cabal
    rm -rfv $HOME/.ghc

    #### cabal library

    # clone dist
    cd $HOME/Downloads
    curl -O https://www.haskell.org/cabal/release/cabal-1.22.0.0/Cabal-1.22.0.0.tar.gz
    curl -O https://www.haskell.org/cabal/release/cabal-1.22.3.0/Cabal-1.22.3.0.tar.gz

    # extract
    tar xzvf Cabal-1.22.0.0.tar.gz
    cd Cabal-1.22.0.0
    tar xzvf Cabal-1.22.3.0.tar.gz
    cd Cabal-1.22.3.0

    # build
    ghc --make Setup.hs
    @@ -67,29 +69,24 @@ ghc installation

    # Remove temporary files
    cd $HOME/Downloads
    rm -rf Cabal-1.22.0.0*
    rm -rfv Cabal-1.22.3.0*

    #### cabal-install

    # remove ghc cache (in case of reinstall)
    if [ -d "$HOME/.ghc/" ]; then
    ghc-pkg --user recache
    fi

    # get distributive
    cd $HOME/Downloads
    curl -O https://www.haskell.org/cabal/release/cabal-install-1.22.0.0/cabal-install-1.22.0.0.tar.gz
    curl -O https://www.haskell.org/cabal/release/cabal-install-1.22.3.0/cabal-install-1.22.3.0.tar.gz

    # extract archive
    tar xzvf cabal-install-1.22.0.0.tar.gz
    cd cabal-install-1.22.0.0
    tar xzvf cabal-install-1.22.3.0.tar.gz
    cd cabal-install-1.22.3.0

    # install
    ./bootstrap.sh

    # remove temporary files
    cd $HOME/Downloads
    rm -rf cabal-install-1.22.0.0*
    rm -rfv cabal-install-1.22.3.0*

    # add path to cabal to PATH environment
    export CABAL_HOME=$HOME/.cabal
  28. yantonov revised this gist Apr 15, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -92,5 +92,5 @@ ghc installation
    rm -rf cabal-install-1.22.0.0*

    # add path to cabal to PATH environment
    CABAL_HOME=$HOME/.cabal
    PATH=$CABAL_HOME/bin:$PATH
    export CABAL_HOME=$HOME/.cabal
    export PATH=$CABAL_HOME/bin:$PATH
  29. yantonov revised this gist Feb 20, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### How to install latest GHC 7.8.4 + cabal 1.22 on ubuntu
    ### How to install latest GHC 7.8.4 + cabal 1.22 from source on ubuntu

    ### ghc

  30. yantonov revised this gist Feb 18, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-ghc.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    ubuntu prerequisites

    # Multiprecision arithmetic library developers tools
    # Multiprecision arithmetic library developers tools, zlib
    sudo apt-get install libgmp-dev zlib1g-dev -y
    sudo -K