Skip to content

Instantly share code, notes, and snippets.

@vanhalt
Forked from bryanhunter/build-erlang-r16b.sh
Last active March 28, 2016 04:19
Show Gist options
  • Save vanhalt/5893962 to your computer and use it in GitHub Desktop.
Save vanhalt/5893962 to your computer and use it in GitHub Desktop.
Install Elixir v0.9.3 in Ubuntu 13.04
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://raw.github.com/gist/5487621/build-erlang-r16b.sh
# chmod u+x build-erlang-r16b.sh
# sudo ./build-erlang-r16b.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
echo "This script will install Erlang RB16 (with package dependencies) and Elixir v0.9.3"
apt-get update
# Install the build tools (dpkg-dev g++ gcc libc6-dev make)
apt-get -y install build-essential
# automatic configure script builder (debianutils m4 perl)
apt-get -y install autoconf
# Needed for HiPE (native code) support, but already installed by autoconf
# apt-get -y install m4
# Needed for terminal handling (libc-dev libncurses5 libtinfo-dev libtinfo5 ncurses-bin)
apt-get -y install libncurses5-dev
# For building with wxWidgets
apt-get -y install libwxgtk2.8-dev libgl1-mesa-dev libglu1-mesa-dev libpng3
# For building ssl (libssh-4 libssl-dev zlib1g-dev)
apt-get -y install libssh-dev
# ODBC support (libltdl3-dev odbcinst1debian2 unixodbc)
apt-get -y install unixodbc-dev
mkdir -p ~/code/erlang
cd ~/code/erlang
if [ -e otp_src_R16B.tar.gz ]; then
echo "Good! 'otp_src_R16B.tar.gz' already exists. Skipping download."
else
wget http://www.erlang.org/download/otp_src_R16B.tar.gz
fi
tar -xvzf otp_src_R16B.tar.gz
chmod -R 777 otp_src_R16B
cd otp_src_R16B
./configure
make
make install
# Elixir's installation
echo "Erlang party is over... Elixir's time!"
mkdir ~/code/elixir
chmod -R 777 ~/code/elixir
cd ~/code/elixir
wget http://dl.dropbox.com/u/4934685/elixir/v0.9.3.zip
unzip v0.9.3.zip
echo "Do not forget to add Erlang to your path with:"
echo "echo 'PATH=$PATH:$HOME/code/erlang/otp_src_R16B/bootstrap/bin' >> ~/.zshrc"
echo "echo 'PATH=$PATH:$HOME/code/erlang/otp_src_R16B/bootstrap/bin' >> ~/.bashrc"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment