Skip to content

Instantly share code, notes, and snippets.

@novi
Last active February 8, 2017 04:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save novi/4591a758538f6a23684887b113c15718 to your computer and use it in GitHub Desktop.
Save novi/4591a758538f6a23684887b113c15718 to your computer and use it in GitHub Desktop.
Install Swift ARM on ArchLinux(Raspberry Pi2)

Install debootstrap.

# pacman -S arch-install-scripts debootstrap

Install Debian base system into $ROOTFS.

$ export ROOTFS=$HOME/rootfs
# mkdir -p $ROOTFS 
# debootstrap --arch armhf sid $ROOTFS
(for Ubuntu: use this instead) # debootstrap --arch armhf xenial $ROOTFS http://ports.ubuntu.com/ubuntu-ports

Chroot to the Debian, 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 libxml2 libcurl3 clang git-core libpython2.7 wget
## wget https://launchpad.net/ubuntu/+source/icu/55.1-7/+build/8880729/+files/libicu55_55.1-7_armhf.deb
## dpkg -i libicu55_55.1-7_armhf.deb
## apt-get -f install

Install Swift ARM, from http://dev.iachieved.it/iachievedit/swift-3-0-on-raspberry-pi-2-and-3/ or https://www.uraimo.com/2016/12/30/Swift-3-0-2-for-raspberrypi-zero-1-2-3/ . Ubuntu version is preffered.

Thanks!!

## cd ~ && wget https://www.dropbox.com/s/cah35gf5ap22d11/swift-3.0.2-RPi23-1604.tgz
## tar zxvf swift-3.0.2-RPi23-1604.tgz
## echo 'export PATH="$HOME/usr/bin:$PATH"' >> .bashrc # run once
## source .bashrc
## swift -v

Appendix, use I2C on ArchLinux.

https://wiki.archlinuxjp.org/index.php/Raspberry_Pi#I2C

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