mirror of
https://github.com/helje5/dockSwiftOnARM.git
synced 2025-11-01 06:33:34 +00:00
Move stuff around and prep 3.1.1 build
This commit is contained in:
@@ -80,6 +80,7 @@ build-rpi-raspbian-swift-build-env :
|
||||
# (clang and such, also sets clang as the compiler)
|
||||
build-rpi-ubuntu-swift-build-env :
|
||||
time docker build -t helje5/rpi-ubuntu-swift-build-env \
|
||||
$(EXTRAFLAGS) \
|
||||
-f empty-ctx/rpi-ubuntu-swift-build-env.dockerfile \
|
||||
empty-ctx
|
||||
docker images | grep helje5/rpi-ubuntu-swift-build-env
|
||||
@@ -98,6 +99,13 @@ build-rpi-ubuntu-swift-build31-env : build-rpi-ubuntu-swift-build-env
|
||||
rpi-swift-31-build-ctx
|
||||
docker images | grep helje5/rpi-ubuntu-swift-build31-env
|
||||
|
||||
# contains the 3.1.1 Swift Sources
|
||||
build-rpi-ubuntu-swift-build311-env :
|
||||
time docker build -t helje5/rpi-ubuntu-swift-build311-env \
|
||||
-f rpi-swift-3.1.1-ctx/rpi-ubuntu-swift-build31-env.dockerfile \
|
||||
rpi-swift-31-build-ctx
|
||||
docker images | grep helje5/rpi-ubuntu-swift-build31-env
|
||||
|
||||
|
||||
# ---------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# Dockerfile
|
||||
#
|
||||
# docker run --privileged=true -i --tty --rm helje5/rpi-swift-dev:3.1.0
|
||||
#
|
||||
FROM helje5/rpi-swift:3.1.0
|
||||
|
||||
# rpi-swift sets it to swift
|
||||
USER root
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ARG CLANG_VERSION=3.8
|
||||
|
||||
RUN apt-get install -y apt-utils
|
||||
RUN apt-get install -y vim emacs make
|
||||
RUN apt-get install -y git libicu55 libedit2
|
||||
|
||||
# rpi-swift is installing stuff into site-packages, need to move them away
|
||||
RUN mv /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages.swift
|
||||
RUN apt-get install -y python2.7-minimal
|
||||
RUN mv /usr/lib/python2.7/site-packages.swift/* /usr/local/lib/python2.7/dist-packages/
|
||||
RUN rmdir /usr/lib/python2.7/site-packages.swift
|
||||
|
||||
RUN apt-get install -y python
|
||||
|
||||
RUN apt-get install -y clang-$CLANG_VERSION libc6-dev
|
||||
|
||||
RUN apt-get install -y \
|
||||
libicu-dev \
|
||||
autoconf libtool pkg-config \
|
||||
libblocksruntime-dev \
|
||||
libkqueue-dev \
|
||||
libpthread-workqueue-dev \
|
||||
systemtap-sdt-dev \
|
||||
libbsd-dev libbsd0 \
|
||||
curl libcurl4-openssl-dev \
|
||||
libedit-dev \
|
||||
libxml2 \
|
||||
wget sudo
|
||||
|
||||
RUN update-alternatives --quiet --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100
|
||||
RUN update-alternatives --quiet --install /usr/bin/clang++ clang++ /usr/bin/clang++-$CLANG_VERSION 100
|
||||
|
||||
|
||||
# setup sudo
|
||||
|
||||
RUN adduser swift sudo
|
||||
RUN echo 'swift ALL=(ALL:ALL) ALL' > /etc/sudoers.d/swift
|
||||
RUN chmod 0440 /etc/sudoers.d/swift
|
||||
RUN echo 'swift:swift' | chpasswd
|
||||
|
||||
|
||||
USER swift
|
||||
WORKDIR /home/swift
|
||||
@@ -0,0 +1,60 @@
|
||||
# Dockerfile
|
||||
#
|
||||
# https://github.com/uraimo/buildSwiftOnARM.git
|
||||
#
|
||||
# docker run --rm --interactive --tty helje5/rpi-swift-build
|
||||
|
||||
FROM helje5/rpi-ubuntu-swift-build311-env
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# swiftsrc is in /swiftsrc
|
||||
|
||||
RUN bash -c 'git clone https://github.com/uraimo/buildSwiftOnARM.git; \
|
||||
cd buildSwiftOnARM; \
|
||||
git archive -9 --format tgz master -o ../buildSwiftOnARM-3.1.tgz; \
|
||||
cd ..; \
|
||||
rm -rf buildSwiftOnARM; \
|
||||
cd /swiftsrc; \
|
||||
tar zxf ../buildSwiftOnARM-3.1.tgz; \
|
||||
rm ../buildSwiftOnARM-3.1.tgz'
|
||||
|
||||
WORKDIR /swiftsrc
|
||||
|
||||
RUN bash -c "for DIR in *; do \
|
||||
if test -d \"\${DIR}\"; then \
|
||||
if test -d \"\${DIR}.diffs\"; then \
|
||||
echo \"Applying patches to \${DIR}\" ; \
|
||||
cd \"\${DIR}\"; \
|
||||
patch -l -p1 < ../\${DIR}.diffs/*.diff; \
|
||||
cd ..; \
|
||||
fi; \
|
||||
fi; \
|
||||
done"
|
||||
|
||||
ENV SWIFT_SOURCE_ROOT /swiftsrc
|
||||
|
||||
# this fails because the script patches the PYTHONPATH so that
|
||||
# swiftsrc/swift/utils is before swiftsrc/swift/utils/swift_build_support
|
||||
# (and hence picks up the duplicate swift_build_support directory)
|
||||
# sys.path.append(os.path.dirname(__file__)) ...
|
||||
RUN bash -c "mv swift/utils/build-script swift/utils/build-script.orig; \
|
||||
cat swift/utils/build-script.orig \
|
||||
| sed '/import sys/a sys.path.append(os.path.join(os.path.dirname(__file__), \"swift_build_support\"))' \
|
||||
| sed '/import sys/a sys.path = sys.path[1:]' \
|
||||
>> swift/utils/build-script; \
|
||||
chmod +x swift/utils/build-script"
|
||||
|
||||
RUN ./build.sh
|
||||
|
||||
# the results will be in
|
||||
# /swiftsrc/install/usr/[bin|include|lib|libexec|local|share]
|
||||
|
||||
WORKDIR /swiftsrc/install/usr/
|
||||
|
||||
RUN apt-get install -y lsb-release
|
||||
|
||||
VOLUME /package
|
||||
|
||||
# takes ~4mins on RPi3, ~122MB (BZip2 takes ~8mins on RPi3, saves 12MB)
|
||||
RUN tar zcf "/package/swift-3.1-$(uname -m)-$(lsb_release -i -s | tr A-Z a-z)-$(lsb_release -r -s).tar.gz" *
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ./make-swift-branch-tarball.sh swift-checkout swift-3.1.1-RELEASE
|
||||
# ./make-swift-branch-tarball.sh swift-checkout swift-3.1-RELEASE
|
||||
# ./make-swift-branch-tarball.sh swift-checkout swift-3.0.2-RELEASE
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Dockerfile
|
||||
#
|
||||
# Just copy in Swift 3.1.1 to avoid the overhead when playing with the
|
||||
# compile.
|
||||
|
||||
FROM helje5/rpi-ubuntu-swift-build-env
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ADD swift-3.1.1-RELEASE.tgz /swiftsrc
|
||||
@@ -0,0 +1,26 @@
|
||||
# Dockerfile
|
||||
#
|
||||
# docker run --privileged=true -i --tty --rm helje5/rpi-swift:3.1.0
|
||||
#
|
||||
|
||||
FROM ioft/armhf-ubuntu:16.04
|
||||
|
||||
ARG TARBALL=swift-3.1.1-armv7l-ubuntu-16.04.tar.gz
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
# Funny: libcurl3 provies libcurl.so.4 :-)
|
||||
RUN apt-get install -y \
|
||||
git \
|
||||
libedit2 \
|
||||
libpython2.7 libcurl3 libxml2 libicu55 \
|
||||
libc6-dev
|
||||
|
||||
ADD $TARBALL /usr/
|
||||
|
||||
RUN useradd --create-home --shell /bin/bash swift
|
||||
|
||||
USER swift
|
||||
WORKDIR /home/swift
|
||||
Reference in New Issue
Block a user