mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-29 04:08:46 +00:00
update Dockerfile and .travis.yml to be more similar to trezor-core
This commit is contained in:
parent
3b5fe11253
commit
afc17a23d5
30
.travis.yml
30
.travis.yml
@ -5,21 +5,20 @@ language: c
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- deadsnakes
|
- deadsnakes
|
||||||
packages:
|
packages:
|
||||||
- build-essential
|
- build-essential
|
||||||
- gcc-arm-none-eabi
|
- python3.6
|
||||||
- gcc-multilib
|
- python3.6-dev
|
||||||
- libnewlib-arm-none-eabi
|
- python3.6-venv
|
||||||
- python3.6
|
|
||||||
- python3.6-venv
|
|
||||||
- python3.6-dev
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- MAKEFLAGS=-j2
|
- MAKEFLAGS=-j2
|
||||||
- PYTHON=python3.6
|
- PYTHON=python3.6
|
||||||
- PROTOBUF_VERSION=3.4.0
|
- PROTOBUF_VERSION=3.4.0
|
||||||
|
- TOOLCHAIN_SHORTVER=8-2018q4
|
||||||
|
- TOOLCHAIN_LONGVER=gcc-arm-none-eabi-8-2018-q4-major
|
||||||
matrix:
|
matrix:
|
||||||
- DEBUG_LINK=0
|
- DEBUG_LINK=0
|
||||||
- DEBUG_LINK=1
|
- DEBUG_LINK=1
|
||||||
@ -35,14 +34,21 @@ matrix:
|
|||||||
compiler: clang
|
compiler: clang
|
||||||
script: pipenv run ./script/cibuild && pipenv run script/test
|
script: pipenv run ./script/cibuild && pipenv run script/test
|
||||||
|
|
||||||
install:
|
before_install:
|
||||||
- curl -LO "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip"
|
|
||||||
- unzip "protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" -d protoc
|
|
||||||
- export PATH="$(pwd)/protoc/bin:$PATH"
|
|
||||||
- $PYTHON -m ensurepip --user
|
- $PYTHON -m ensurepip --user
|
||||||
- $PYTHON -m pip install --user pipenv
|
- $PYTHON -m pip install --user pipenv
|
||||||
|
|
||||||
|
install:
|
||||||
|
- wget "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip"
|
||||||
|
- unzip "protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" -d protoc
|
||||||
|
- export PATH="$(pwd)/protoc/bin:$PATH"
|
||||||
- pipenv install
|
- pipenv install
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- test "$EMULATOR" = "1" || wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/$TOOLCHAIN_SHORTVER/$TOOLCHAIN_LONGVER-linux.tar.bz2
|
||||||
|
- test "$EMULATOR" = "1" || tar xfj $TOOLCHAIN_LONGVER-linux.tar.bz2
|
||||||
|
- test "$EMULATOR" = "1" || export PATH=$PWD/$TOOLCHAIN_LONGVER/bin:$PATH
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- pipenv run script/cibuild
|
- pipenv run script/cibuild
|
||||||
- pipenv run make -C bootloader
|
- pipenv run make -C bootloader
|
||||||
|
58
Dockerfile
58
Dockerfile
@ -2,32 +2,76 @@
|
|||||||
|
|
||||||
FROM debian:9
|
FROM debian:9
|
||||||
|
|
||||||
|
ARG TOOLCHAIN_FLAVOR=linux
|
||||||
|
ENV TOOLCHAIN_FLAVOR=$TOOLCHAIN_FLAVOR
|
||||||
|
|
||||||
# install build tools and dependencies
|
# install build tools and dependencies
|
||||||
|
|
||||||
ARG EMULATOR=0
|
ARG EMULATOR=0
|
||||||
ENV EMULATOR=$EMULATOR
|
ENV EMULATOR=$EMULATOR
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && apt-get install -y \
|
||||||
apt-get install -y build-essential curl git python3 python3-pip
|
build-essential wget git python3-pip
|
||||||
|
|
||||||
|
# install dependencies from toolchain source build
|
||||||
|
|
||||||
|
RUN if [ "$TOOLCHAIN_FLAVOR" = "src" ]; then \
|
||||||
|
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; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# download toolchain
|
||||||
|
|
||||||
|
ENV TOOLCHAIN_SHORTVER=8-2018q4
|
||||||
|
ENV TOOLCHAIN_LONGVER=gcc-arm-none-eabi-8-2018-q4-major
|
||||||
|
ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/$TOOLCHAIN_SHORTVER/$TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAVOR.tar.bz2
|
||||||
|
ENV TOOLCHAIN_HASH_linux=fb31fbdfe08406ece43eef5df623c0b2deb8b53e405e2c878300f7a1f303ee52
|
||||||
|
ENV TOOLCHAIN_HASH_src=bc228325dbbfaf643f2ee5d19e01d8b1873fcb9c31781b5e1355d40a68704ce7
|
||||||
|
|
||||||
RUN if [ "$EMULATOR" = 1 ]; then \
|
RUN if [ "$EMULATOR" = 1 ]; then \
|
||||||
apt-get install -y libsdl2-dev libsdl2-image-dev; \
|
apt-get install -y libsdl2-dev libsdl2-image-dev; \
|
||||||
else \
|
|
||||||
apt-get install -y gcc-arm-none-eabi libnewlib-arm-none-eabi; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# extract toolchain
|
||||||
|
|
||||||
|
RUN cd /opt && wget $TOOLCHAIN_URL
|
||||||
|
|
||||||
|
RUN cd /opt && echo "$TOOLCHAIN_HASH_linux $TOOLCHAIN_LONGVER-linux.tar.bz2\n$TOOLCHAIN_HASH_src $TOOLCHAIN_LONGVER-src.tar.bz2" | sha256sum -c --ignore-missing
|
||||||
|
|
||||||
|
RUN cd /opt && tar xfj $TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAVOR.tar.bz2
|
||||||
|
|
||||||
|
# build toolchain (if required)
|
||||||
|
|
||||||
|
RUN if [ "$TOOLCHAIN_FLAVOR" = "src" ]; then \
|
||||||
|
pushd /opt/$TOOLCHAIN_LONGVER ; \
|
||||||
|
./install-sources.sh --skip_steps=mingw32 ; \
|
||||||
|
./build-prerequisites.sh --skip_steps=mingw32 ; \
|
||||||
|
./build-toolchain.sh --skip_steps=mingw32,manual ; \
|
||||||
|
popd ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# download protobuf
|
||||||
|
|
||||||
ENV PROTOBUF_VERSION=3.4.0
|
ENV PROTOBUF_VERSION=3.4.0
|
||||||
ENV PROTOBUF_HASH=e4b51de1b75813e62d6ecdde582efa798586e09b5beaebfb866ae7c9eaadace4
|
ENV PROTOBUF_HASH=e4b51de1b75813e62d6ecdde582efa798586e09b5beaebfb866ae7c9eaadace4
|
||||||
RUN curl -LO "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip"
|
RUN wget "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip"
|
||||||
RUN echo "${PROTOBUF_HASH} protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" | sha256sum -c
|
RUN echo "${PROTOBUF_HASH} protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" | sha256sum -c
|
||||||
|
|
||||||
|
# setup toolchain
|
||||||
|
|
||||||
|
ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH
|
||||||
|
|
||||||
ENV PYTHON=python3
|
ENV PYTHON=python3
|
||||||
ENV LC_ALL=C.UTF-8
|
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
|
||||||
ENV LANG=C.UTF-8
|
|
||||||
|
|
||||||
# use zipfile module to extract files world-readable
|
# use zipfile module to extract files world-readable
|
||||||
RUN $PYTHON -m zipfile -e "protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" /usr/local && chmod 755 /usr/local/bin/protoc
|
RUN $PYTHON -m zipfile -e "protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" /usr/local && chmod 755 /usr/local/bin/protoc
|
||||||
|
|
||||||
ENV WORKON_HOME=/tmp/.venvs
|
ENV WORKON_HOME=/tmp/.venvs
|
||||||
|
|
||||||
|
# install python dependencies
|
||||||
|
|
||||||
RUN $PYTHON -m pip install pipenv
|
RUN $PYTHON -m pip install pipenv
|
||||||
|
Loading…
Reference in New Issue
Block a user