2017-11-04 00:56:05 +00:00
|
|
|
# initialize from the image
|
|
|
|
|
|
|
|
FROM debian:9
|
|
|
|
|
2018-10-12 12:13:39 +00:00
|
|
|
ARG TOOLCHAIN_FLAVOR=linux
|
|
|
|
ENV TOOLCHAIN_FLAVOR=$TOOLCHAIN_FLAVOR
|
|
|
|
|
2017-11-04 00:56:05 +00:00
|
|
|
# install build tools and dependencies
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
2018-01-09 20:44:42 +00:00
|
|
|
build-essential wget git python3-pip gcc-multilib
|
2017-11-04 00:56:05 +00:00
|
|
|
|
2018-10-12 12:13:39 +00:00
|
|
|
# install dependencies from toolchain source build
|
|
|
|
|
|
|
|
RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && \
|
|
|
|
apt-get install -y autoconf autogen bison dejagnu \
|
|
|
|
flex flip gawk git gperf gzip nsis \
|
|
|
|
openssh-client p7zip-full perl python-dev \
|
|
|
|
libisl-dev tcl tofrodos zip \
|
|
|
|
texinfo texlive texlive-extra-utils
|
|
|
|
|
2018-01-09 20:44:42 +00:00
|
|
|
# download toolchain
|
2017-11-04 14:01:44 +00:00
|
|
|
|
2018-07-12 11:25:12 +00:00
|
|
|
ENV TOOLCHAIN_SHORTVER=7-2018q2
|
|
|
|
ENV TOOLCHAIN_LONGVER=gcc-arm-none-eabi-7-2018-q2-update
|
2018-01-09 20:44:42 +00:00
|
|
|
ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/$TOOLCHAIN_SHORTVER/$TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAVOR.tar.bz2
|
|
|
|
|
|
|
|
# extract toolchain
|
|
|
|
|
|
|
|
RUN cd /opt && wget $TOOLCHAIN_URL && tar xfj $TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAVOR.tar.bz2
|
|
|
|
|
2018-10-12 12:13:39 +00:00
|
|
|
# build toolchain (if required)
|
|
|
|
|
|
|
|
RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && cd /opt/$TOOLCHAIN_LONGVER && ./install-sources.sh --skip_steps=mingw32
|
|
|
|
RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && cd /opt/$TOOLCHAIN_LONGVER && ./build-prerequisites.sh --skip_steps=mingw32
|
|
|
|
RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && cd /opt/$TOOLCHAIN_LONGVER && ./build-toolchain.sh --skip_steps=mingw32,manual
|
|
|
|
|
2018-08-14 15:32:02 +00:00
|
|
|
# install additional tools
|
|
|
|
|
|
|
|
RUN apt-get install -y protobuf-compiler libprotobuf-dev
|
|
|
|
|
2018-10-12 11:57:27 +00:00
|
|
|
# setup toolchain
|
|
|
|
|
|
|
|
ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH
|
|
|
|
|
2017-11-04 14:01:44 +00:00
|
|
|
# install python tools
|
|
|
|
|
2018-08-14 15:32:02 +00:00
|
|
|
RUN pip3 install click pyblake2 scons protobuf
|
2017-11-04 00:56:05 +00:00
|
|
|
RUN pip3 install --no-deps git+https://github.com/trezor/python-trezor.git@master
|
|
|
|
|
|
|
|
# workarounds for weird default install
|
|
|
|
|
|
|
|
RUN ln -s python3 /usr/bin/python
|
2017-12-05 22:54:17 +00:00
|
|
|
RUN ln -s dist-packages /usr/local/lib/python3.5/site-packages
|
2017-11-04 00:56:05 +00:00
|
|
|
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
|