|
| 1 | +FROM amazonlinux:2 |
| 2 | + |
| 3 | +WORKDIR /home/ec2-user |
| 4 | + |
| 5 | +# The build needs a package from the EPEL repo so that needs to be enabled. |
| 6 | +# https://www.tecmint.com/install-epel-repository-on-centos/ |
| 7 | +RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
| 8 | + |
| 9 | +# Update and install needed build packages |
| 10 | +RUN yum -y update |
| 11 | +RUN yum -y group install "development tools" |
| 12 | +RUN yum -y install \ |
| 13 | + git cmake clang python swig uuid-devel libicu-devel libedit-devel \ |
| 14 | + libxml2-devel sqlite-devel ncurses-devel pkgconfig python-devel \ |
| 15 | + python-pkgconfig libbsd-devel libuuid-devel pexpect curl-devel \ |
| 16 | + tzdata rsync wget which python-six ninja-build |
| 17 | +RUN ln -s /usr/bin/ninja-build /usr/bin/ninja |
| 18 | + |
| 19 | +# Install sccache |
| 20 | +RUN mkdir /opt/sccache && cd /opt/sccache && \ |
| 21 | + wget -O - "https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz" | \ |
| 22 | + tar xz --strip-components 1 && \ |
| 23 | + ln -sf /opt/sccache/sccache /usr/local/bin |
| 24 | + |
| 25 | +# Grab an updated version of cmake |
| 26 | +RUN wget https://cmake.org/files/v3.16/cmake-3.16.5-Linux-x86_64.tar.gz \ |
| 27 | + && tar xvzf cmake-3.16.5-Linux-x86_64.tar.gz \ |
| 28 | + && rm cmake-3.16.5-Linux-x86_64.tar.gz |
| 29 | + |
| 30 | +# Add updated version of cmake to path |
| 31 | +ENV PATH="/home/ec2-user/cmake-3.16.5-Linux-x86_64/bin/:${PATH}" |
| 32 | + |
| 33 | + |
| 34 | +# Bootstrap the swift source and do a full checkout |
| 35 | +ARG SWIFT_GIT_SHA |
| 36 | +RUN git clone https://github.com/swiftwasm/swift.git |
| 37 | +WORKDIR /home/ec2-user/swift |
| 38 | +RUN git checkout $SWIFT_GIT_SHA |
| 39 | +RUN ./utils/update-checkout --clone --scheme wasm --skip-repository swift |
| 40 | +RUN ./utils/webassembly/install-wasi-sdk.sh linux ubuntu-18.04 |
| 41 | + |
| 42 | +RUN ./utils/webassembly/build-toolchain.sh |
0 commit comments