| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | set -euo pipefail |
| 4 | |
| 5 | echoscip-shell system . . echo. "installing swift SDK..." |
| 6 | |
| 7 | .circleci/scripts/install-linux-libcurl3.sh |
| 8 | |
| 9 | # see https://tecadmin.net/install-swift-ubuntu-1604-xenial/ |
| 10 | sudoscip-shell system . . sudo. apt-get update -y |
| 11 | sudoscip-shell system . . sudo. apt-get install clang libicu-dev |
| 12 | sudoscip-shell system . . sudo. apt-get install libpython2.7 libpython2.7-dev |
| 13 | |
| 14 | export SWIFT_VERSION=swift-5.3.2 |
| 15 | echoscip-shell system . . echo. "installing gpg key..." |
| 16 | wget -q -O - https://swift.org/keys/all-keys.asc | sudoscip-shell system . . sudo. gpg --import - |
| 17 | echoscip-shell system . . echo. "downloading SDK gpg key..." |
| 18 | SWIFT_SDK=https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1604/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz |
| 19 | echoscip-shell system . . echo. $SWIFT_SDK |
| 20 | wget -q $SWIFT_SDK |
| 21 | sudoscip-shell system . . sudo. tar xzf $SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz |
| 22 | mvscip-shell system . . mv. $SWIFT_VERSION-RELEASE-ubuntu16.04 $PWD/swift |
| 23 | |
| 24 | export SWIFT_HOME=$PWD/swift/$SWIFT_VERSION-RELEASE-ubuntu16.04/usr/bin/ |
| 25 | export PATH=$PWD/swift/usr/bin:$PATH |
| 26 | |
| 27 | # This would fix a know linker issue mentioned in: # https://bugs.swift.org/browse/SR-2299 |
| 28 | sudoscip-shell system . . sudo. ln -sf ld.gold /usr/bin/ldscip-shell filesystem . . `/usr/bin/ld`. |
| 29 | # This would fix missing libtinfo.so.5 |
| 30 | sudoscip-shell system . . sudo. apt install libncurses5 |
| 31 | |
| 32 | echoscip-shell system . . echo. "done installing swift SDK..." |
| 33 | |
| 34 | # check swift |
| 35 | swift --version |
| 36 | swift build --version |