FROM    ubuntu:16.04
MAINTAINER Nurullah Akkaya <nurullah@nakkaya.com>

RUN apt-get update && \
    apt-get upgrade -y

RUN apt-get install apt-utils software-properties-common -y
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get update

# Setup Tangle Requirements

RUN apt-get install wget make git emacs24-nox openjdk-8-jre-headless -y

RUN wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
RUN chmod +x lein
RUN mv lein /usr/bin/
RUN lein

ENV LEIN_ROOT true

# Setup Test Requirements

# arduino
RUN wget http://downloads.arduino.cc/arduino-1.8.7-linux64.tar.xz
RUN tar xf arduino-1.8.7-linux64.tar.xz
RUN mv arduino-1.8.7 /usr/local/share/arduino
RUN ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino

# x86
RUN apt-get install gcc-5 g++-5 cppcheck -y
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
RUN wget http://apt.llvm.org/llvm-snapshot.gpg.key
RUN apt-key add llvm-snapshot.gpg.key
RUN apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main"
RUN apt-get update
RUN apt-get install clang-6.0 llvm-6.0 -y
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 50

# Setup Platform Build Requirements
RUN apt-get install zip reprepro -y
