forked from colemancda/swift-armv7
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch-sources.sh
executable file
·72 lines (67 loc) · 2.23 KB
/
fetch-sources.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
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
source swift-define
mkdir -p ./downloads
# Fetch sources
cd ./downloads
if [[ -d "$SWIFT_SRCDIR" ]]; then
echo "$SWIFT_SRCDIR exists"
cd $SWIFT_SRCDIR
git stash
else
echo "Checkout Swift"
git clone https://github.com/apple/swift.git
cd $SWIFT_SRCDIR
fi
# Update checkout
./utils/update-checkout --clone --tag $SWIFT_VERSION \
--skip-history \
--skip-repository cmake \
--skip-repository cmark \
--skip-repository curl \
--skip-repository icu \
--skip-repository indexstore-db \
--skip-repository llbuild \
--skip-repository libxml2 \
--skip-repository ninja \
--skip-repository sourcekit-lsp \
--skip-repository swift-asn1 \
--skip-repository swift-async-algorithms \
--skip-repository swift-atomics \
--skip-repository swift-argument-parser \
--skip-repository swift-certificates \
--skip-repository swift-crypto \
--skip-repository swift-docc \
--skip-repository swift-docc-render-artifact \
--skip-repository swift-docc-symbolkit \
--skip-repository swift-driver \
--skip-repository swift-format \
--skip-repository swift-installer-scripts \
--skip-repository swift-integration-tests \
--skip-repository swift-log \
--skip-repository swift-llvm-bindings \
--skip-repository swift-lmdb \
--skip-repository swift-markdown \
--skip-repository swift-nio \
--skip-repository swift-nio-ssl \
--skip-repository swift-numerics \
--skip-repository swift-stress-tester \
--skip-repository swift-system \
--skip-repository swift-tools-support-core \
--skip-repository swift-xcode-playground-support \
--skip-repository swiftpm \
--skip-repository tensorflow-swift-apis \
--skip-repository wasi-libc \
--skip-repository wasmkit \
--skip-repository yams \
--skip-repository zlib \
# Apply patches
echo "Apply CXX interop patch"
patch -d . -p1 <$SRC_ROOT/patches/0001-Swift-fix-find-libstdc++-for-cxx-interop.patch
# Only applies to Swift 5.9
if [[ $SWIFT_VERSION == *"5.9"* ]]; then
echo "Apply Foundation strlcpy/strlcat patch for Swift 5.9"
cd ../swift-corelibs-foundation
git stash
patch -d . -p1 <$SRC_ROOT/patches/0002-Foundation-5.9-check-for-strlcpy-strlcat.patch
fi