Skip to content

Commit

Permalink
Add swift language support
Browse files Browse the repository at this point in the history
  • Loading branch information
Menci committed Jan 27, 2021
1 parent cb3616f commit c10fc7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is the sandbox's rootfs used by [syzoj-ng-judge](https://github.com/syzoj/s
* Python 2.7 (from [PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa))
* Python 3.6
* Python 3.9 (from [PPA](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa))
* Swift (from [Swift.org](https://swift.org/))
* Rust (from [Rustup](https://rustup.rs/))
* Go (from [PPA](https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports))
* GHC (from [PPA](https://launchpad.net/~hvr/+archive/ubuntu/ghc))
Expand Down
6 changes: 6 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ su sandbox -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s
su sandbox -c "curl -s https://get.sdkman.io | bash"
su sandbox -s /bin/bash -c "source ~/.sdkman/bin/sdkman-init.sh && sdk install kotlin"

# Install Swift
SWIFT_URL="https://swift.org/builds/swift-5.3.2-release/ubuntu2004/swift-5.3.2-RELEASE/swift-5.3.2-RELEASE-ubuntu20.04.tar.gz"
wget -O - "$SWIFT_URL" | tar -xzf - -C /opt
mv /opt/swift* /opt/swift

# Create symlinks for compilers and interpreters with non-common names and locations
ln -s /usr/bin/g++-10 /usr/local/bin/g++
ln -s /usr/bin/gcc-10 /usr/local/bin/gcc
Expand All @@ -59,6 +64,7 @@ ln -s /usr/bin/clang++-11 /usr/local/bin/clang++
ln -s /sandbox/.sdkman/candidates/kotlin/current/bin/kotlin /usr/local/bin/kotlin
ln -s /sandbox/.sdkman/candidates/kotlin/current/bin/kotlinc /usr/local/bin/kotlinc
ln -s /sandbox/.cargo/bin/rustc /usr/local/bin/rustc
ln -s /opt/swift/usr/bin/swiftc /usr/local/bin/swiftc

# Clean the APT cache
apt-get clean
Expand Down

0 comments on commit c10fc7c

Please sign in to comment.