Skip to content

Instantly share code, notes, and snippets.

@novi
Last active July 13, 2018 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save novi/d05f394e5ccca226b8367ccc2218f478 to your computer and use it in GitHub Desktop.
Save novi/d05f394e5ccca226b8367ccc2218f478 to your computer and use it in GitHub Desktop.
Swift on Arch Linux

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment