-
Notifications
You must be signed in to change notification settings - Fork 0
/
swift-env-ubuntu-22.04.sh
executable file
·62 lines (48 loc) · 1.3 KB
/
swift-env-ubuntu-22.04.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
echo "Ubuntu 22.04 Swift 运行环境安装"
apt-get install \
binutils \
git \
gnupg2 \
libc6-dev \
libcurl4-openssl-dev \
libedit2 \
libgcc-9-dev \
libpython3.8 \
libsqlite3-0 \
libstdc++-9-dev \
libxml2-dev \
libz3-dev \
pkg-config \
tzdata \
unzip \
curl \
wget \
zlib1g-dev
echo "Ubuntu 22.04 Swift 运行环境安装完毕!!!!!"
# 下载Swift 5.7 arm64
installSiwft()
{
mkdir -p ../swiftlang
wget https://download.swift.org/swift-5.7-release/ubuntu2204-aarch64/swift-5.7-RELEASE/swift-5.7-RELEASE-ubuntu22.04-aarch64.tar.gz
tar xzf ./swift-5.7-RELEASE-ubuntu22.04-aarch64.tar.gz
mv ./swift-5.7-RELEASE-ubuntu22.04-aarch64 ../swiftlang/5.7
echo "swift 5.7 安装完毕。"
}
# 将Swift加入环境变量中
exportSwift()
{
export PATH=$(pwd)/../swiftlang/5.7/usr/bin:"${PATH}"
echo "swift 5.7 加入环境变量中成功"
}
# swiftBin=$(pwd)/../swiftlang/5.7/usr/bin
# if [[ -d "$swiftBin" ]]; then
# echo "缓存中找到Swift 5.7"
# exportSwift
# else
# echo "缓存中没有找到Swift 5.7"
# installSiwft
# exportSwift
# fi
installSiwft
exportSwift