From ad517f376af5961cc9cad6e08282afe4b850c842 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 4 Nov 2017 01:56:05 +0100 Subject: [PATCH] build: add build using docker --- .gitignore | 1 + Dockerfile | 19 +++++++++++++++++++ build-docker.sh | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100755 build-docker.sh diff --git a/.gitignore b/.gitignore index f0e63a732..8052b8621 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ __pycache__/ _attic/ build/ +build-docker/ emu.config diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..dd2eb89c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# initialize from the image + +FROM debian:9 + +# install build tools and dependencies + +RUN apt-get update && apt-get install -y \ + build-essential git python3-pip \ + gcc-arm-none-eabi libnewlib-arm-none-eabi \ + gcc-multilib + +RUN pip3 install click pyblake2 scons +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 +ENV SCONS_LIB_DIR=/usr/local/lib/python3.5/dist-packages/scons-3.0.0 +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 000000000..068292ebc --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +IMAGE=trezor-core-build +TAG=${1:-master} + +docker build -t $IMAGE . +docker run -t -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\ + git clone https://github.com/trezor/trezor-core && \ + cd trezor-core && \ + ln -s /build build && + git checkout $TAG && \ + git submodule update --init --recursive && \ + make vendorheader && \ + make build_boardloader && \ + make build_bootloader && \ + make build_prodtest && \ + make build_firmware"