0. 系统环境
- Elementary OS or Ubuntu
- oh-my-zsh :推荐
- vim
1. 安装 Clang
➜ sudo apt-get update
➜ sudo apt-get install clang libicu-dev
➜ clang --version
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
2. 确定系统版本
➜ cat /etc/issue
elementary OS Freya \n \l
➜ sudo lsb_release -a
[sudo] password for mintisan:
No LSB modules are available.
Distributor ID: elementary OS
Description: elementary OS Freya
Release: 0.3.2
Codename: freya
➜ uname -r
3.19.0-39-generic
➜
注:elementary OS Freya使用Ubuntu 14.04 LST 版本
3. 下载对应版本的 Swift
4. 解压到用户目录并添加环境变量
➜ ~ tar xzf swift-2.2.1-RELEASE-ubuntu14.04.tar.gzip ~/bin/swift-2.2.1-RELEASE-ubuntu14.04
➜ ~ export PATH="$PATH:/home/mintisan/bin/swift-2.2.1-RELEASE-ubuntu14.04/usr/bin"
➜ ~ swift --version
Swift version 2.2.1 (swift-2.2.1-RELEASE)
Target: x86_64-unknown-linux-gnu
➜ echo $PATH
/home/mintisan/bin/swift-2.2.1-RELEASE-ubuntu14.04/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
添加到文件.zshrc
,这样重启后就可以默认加上了:
5. Hello Word!
6. 遗留
无法使用swift-build
: