-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile-crosseth
103 lines (92 loc) · 4.54 KB
/
Dockerfile-crosseth
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#-------------------------------------------------------------------------------
# Dockerfile for cross-compiling the Ethereum C++ components for mobile Linux
# platforms such as Tizen, Sailfish and Ubuntu Touch. Assumes that we have
# previous built the cross-compiler and can just copy that into our
# container.
#
# See http://ethereum.org/ to learn more about Ethereum.
# See http://doublethink.co/ to learn more about doublethinkco
#
# Copyright (c) 2015-2016 Kitsilano Software Inc (https://doublethink.co)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
FROM ubuntu:wily
MAINTAINER Bob Summerwill <[email protected]>
# External packages required by our scripts
RUN apt-get update && apt-get install -y \
autoconf=2.69-8 \
bzip2=1.0.6-8 \
cmake=3.2.2-2ubuntu3 \
git=1:2.5.0-1ubuntu0.2 \
m4=1.4.17-4 \
texinfo=6.0.0.dfsg.1-3 \
tree=1.7.0-3 \
unzip=6.0-17ubuntu1.2 \
wget=1.16.1-1ubuntu1
# Install "official" armel and armhf cross-compiler packages, which
# can be used as an alternative to our own custom crosstool-NG toolchains.
#
# NOTE - The GCC armel cross-compiler package which comes with
# Ubuntu-14.04 (Trusty) is REALLY old (GCC 4.7.2, released September 2012)
# and is pretty much unusable on this code-base.
#
# NOTE - Tizen ships with an even older version of GCC again :-)
# The Gear S2 smartwatch comes with libstdc++.so.6.0.16, which is the
# version which shipped with GCC 4.6.1, released in April 2010. Running
# the armel binaries generated with the GCC 5.2.1 cross-compiler which
# we are now using here results in binaries which we cannot run on the
# Gear S2. That results in the following runtime errors:
#
# ./eth: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./eth)
# ./eth: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by ./eth)
# ./eth: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.17' not found (required by ./eth)
# ./eth: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by
#
# So it looks like I am going to have to specifically use an older
# sysroot to get something which can work on the Gear S2. I am unable
# SDB connect to any of my other Tizen devices right now, so cannot verify
# if they have slightly newer runtime libraries. The SDK does also have a
# GCC-4.9 toolchain, which perhaps was included in the Tizen 2.4 runtime?
# Using a different sysroot will involve getting GCC 4.6 headers and libraries
# onto the build machine, and then getting -sysroot into the CC and CXX
# command-lines, probably by creating a shell script which wraps the
# actual GCC binaries, as per the example below.
#
# See http://stackoverflow.com/questions/2977182/alternatives-to-the-sysroot-switch-of-gcc
RUN apt-get update && apt-get install -y \
g++-arm-linux-gnueabi=4:5.2.1-1 \
gcc-arm-linux-gnueabi=4:5.2.1-1 \
g++-arm-linux-gnueabihf=4:5.2.1-1 \
gcc-arm-linux-gnueabihf=4:5.2.1-1
# Switch to a normal user account.
RUN useradd -ms /bin/bash crosseth
USER crosseth
# Commit of the webthree-umbrella repo to use.
ENV CPP_ETHEREUM_REPO https://github.com/doublethinkco/cpp-ethereum.git
ENV CPP_ETHEREUM_BRANCH develop
# Workaround - using doublethinkco fork of cpp-ethereum to chop out std::future usage.
#
# See "Build break - armel - invalid use of incomplete type 'class std::future<void>"
# https://github.com/doublethinkco/cpp-ethereum-cross/issues/111
# https://github.com/doublethinkco/cpp-ethereum/commit/edfafc
ENV CPP_ETHEREUM_COMMIT 415fe0c
# Clone the webthree-umbrella repo into the docker container, including sub-modules
WORKDIR /home/crosseth
RUN git clone -b ${CPP_ETHEREUM_BRANCH} --recursive ${CPP_ETHEREUM_REPO} && \
cd cpp-ethereum && git checkout ${CPP_ETHEREUM_COMMIT} && \
git submodule update --init
# Copy our cross-building scripts into the container
ADD cross-build/ /home/crosseth/cpp-ethereum/cross-build/
# And switch the working directory to the Ethereum cross-build scripts
WORKDIR /home/crosseth/cpp-ethereum/cross-build/ethereum