Install debootstrap
.
# pacman -S arch-install-scripts debootstrap
Install Ubuntu base system into $ROOTFS
.
$ export ROOTFS=$HOME/rootfs
# mkdir -p $ROOTFS
# debootstrap --arch amd64 xenial $ROOTFS http://archive.ubuntu.com/ubuntu/
Chroot to the Ubuntu, and set PATH
.
(## means chrooted shell
# arch-chroot $ROOTFS /bin/bash
## echo 'export PATH="$PATH:/usr/sbin:/sbin:/bin"' >> .bashrc # run once
## source .bashrc
Install related library for Swift.
## apt update
## apt install make \
libc6-dev \
curl \
libedit-dev \
libpython2.7 \
libicu-dev \
libssl-dev \
libxml2 \
tzdata \
git \
libcurl4-openssl-dev \
pkg-config \
libicu57
Follow the official Ubuntu 16.04 instructions. https://swift.org/download/