samhuri.net/bin/bootstrap
Sami Samhuri 17aff11e43
Update bootstrap script for Swift 6.1 on Ubuntu 25.04
- Bump Swift version from 5.5.2 to 6.1
- Update to Ubuntu 24.04 binaries (compatible with 25.04)
- Update package dependencies for newer Ubuntu:
  - libgcc-9-dev → libgcc-s1
  - libpython2.7 → libpython3.12
  - libstdc++-9-dev → libstdc++-14-dev
- Fix Swift download URL to use download.swift.org

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19 16:43:34 -07:00

50 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# bail on errors and unset variables
set -euo pipefail
SWIFT_VERSION=6.1
SWIFT_DIR=swift-$SWIFT_VERSION-RELEASE-ubuntu24.04
SWIFT_FILENAME=$SWIFT_DIR.tar.gz
if [[ $(uname) = "Linux" ]]; then
sudo apt install -y \
binutils \
git \
gnupg2 \
libc6-dev \
libcurl4 \
libedit2 \
libgcc-s1 \
libpython3.12 \
libsqlite3-0 \
libstdc++-14-dev \
libxml2 \
libz3-dev \
pkg-config \
tzdata \
uuid-dev \
zlib1g-dev
if which swift >/dev/null 2>/dev/null && swift --version | grep $SWIFT_VERSION >/dev/null 2>/dev/null; then
echo "*** swift $SWIFT_VERSION is installed"
else
echo "*** installing swift"
if [[ -e $SWIFT_FILENAME ]]; then
echo "*** $SWIFT_FILENAME exists, skipping download"
else
wget https://download.swift.org/swift-$SWIFT_VERSION-release/ubuntu2404/swift-$SWIFT_VERSION-RELEASE/$SWIFT_FILENAME
fi
if [[ -e $SWIFT_DIR ]]; then
echo "*** $SWIFT_DIR exists, skipping extraction"
else
tar xzf $SWIFT_FILENAME
fi
echo "*** add $PWD/$SWIFT_DIR/usr/bin to PATH in your shell's rc file"
fi
echo "*** installing inotify-tools for watch script"
sudo apt install -y inotify-tools
fi
echo "*** done"