Skip to content

Commit 6772961

Browse files
committed
add support for 10.15 SDK
1 parent 9b9fe13 commit 6772961

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ I made the script XcodeLegacy.sh to extract these components (the links work if
1818
[Xcode 7.3.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg) (10.11 SDK),
1919
[Xcode 8.3.3](https://download.developer.apple.com/Developer_Tools/Xcode_8.3.3/Xcode8.3.3.xip) (10.12 SDK),
2020
[Xcode 9.4.1](https://download.developer.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip) (10.13 SDK),
21-
[Xcode 10.3](https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip) (10.14 SDK) and install them in Xcode 4-12:
21+
[Xcode 10.3](https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip) (10.14 SDK)
22+
[Xcode 11.7](https://download.developer.apple.com/Developer_Tools/Xcode_11.7/Xcode_11.7.xip) (10.15 SDK)
23+
and install them in Xcode 4-12:
2224

2325
- GCC 4.0, GCC 4.2 and LLVM GCC 4.2 compilers
2426
- GCC 4.0, GCC 4.2 and LLVM GCC 4.2 Xcode plugins
@@ -61,6 +63,7 @@ Optionally, one of the following options can be passed as the *first* argument t
6163
* `-osx1012` : only install OSX 10.12 SDK
6264
* `-osx1013` : only install OSX 10.13 SDK
6365
* `-osx1014` : only install OSX 10.14 SDK
66+
* `-osx1015` : only install OSX 10.15 SDK
6467
* `-path=path` : install to custom Xcode at 'path'
6568

6669

@@ -124,6 +127,7 @@ Here are the latest versions of Xcode that are known to /run/ on each OS X versi
124127
- [Xcode 8.3.3](https://download.developer.apple.com/Developer_Tools/Xcode_8.3.3/Xcode_8.3.3.xip) on macOS 10.12 (Sierra), please see note on linking below. (\*\*)
125128
- [Xcode 9.4.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip) on macOS 10.13 (High Sierra), please see note on linking below. (\*\*)
126129
- [Xcode 10.3](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_10.3/Xcode_10.3.xip) on macOS 10.14 (Mojave), please see note on linking below.
130+
- [Xcode 11.7](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_11.7/Xcode_11.7.xip) on macOS 10.15 (Catalina).
127131

128132
(\*) These Xcode versions were released before 26.03.2012 and may cause an "An unknown installation error" during installation, which is due to an expired certificate. Installing these may require disabling network time sync and setting the date to 01.01.2012 before installing. Network time sync may be re-enabled after install. See [this stackexchange question](https://apple.stackexchange.com/questions/45841/xcode-4-2-snow-leopard-doesnt-install) for more details.
129133

@@ -226,4 +230,5 @@ History
226230
- 2.2 (10/01/2019): Xcode 10 dropped 10.13 SDK, get it from Xcode 9.4.1
227231
- 2.3 (27/03/2019): Added an option to install in a custom Xcode path
228232
- 2.4 (10/02/2020): Fix for buildpackages if Xcode 8 or Xcode 9 xip have expired signatures. Also now check for stray Xcode.app if extracting Xcode 9.4.1, Fixes for changed download paths and archive names.
229-
- 2.5 (01/05/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
233+
- 2.5 (31/04/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
234+
- 2.6 (01/05/2021): Xcode 12 dropped 10.15 SDK, get it from Xcode 11.7

XcodeLegacy.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
# 2.2 (12/02/2019): Added support for using macOS High Sierra 10.13 SDK from Xcode 9.4.1 for use on Xcode 10/macOS 10.14 Mojave, also changed source of OS X 10.12 SDK to Xcode 8.3.3
3131
# 2.3 (27/03/2019): Added an option to install in a custom Xcode path
3232
# 2.4 (10/02/2020): Fix for buildpackages if Xcode 8 or Xcode 9 xip have expired signatures. Also now check for stray Xcode.app if extracting Xcode 9.4.1, Fixes for changed download paths and archive names.
33+
# 2.5 (31/04/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
34+
# 2.6 (01/05/2021): Xcode 12 dropped 10.15 SDK, get it from Xcode 11.7
3335

3436
#set -e # Exit immediately if a command exits with a non-zero status
3537
#set -u # Treat unset variables as an error when substituting.
@@ -47,6 +49,7 @@ osx1011=0
4749
osx1012=0
4850
osx1013=0
4951
osx1014=0
52+
osx1015=0
5053
gotoption=0
5154
error=0
5255

@@ -112,6 +115,11 @@ while [[ $error = 0 ]] && [[ $# -gt 1 ]]; do
112115
osx1014=1
113116
gotoption=1
114117
shift
118+
;;
119+
-osx1015)
120+
osx1015=1
121+
gotoption=1
122+
shift
115123
;;
116124
-path=*)
117125
CUSTOM_APP="${1#*=}"
@@ -138,6 +146,7 @@ if [ $gotoption = 0 ]; then
138146
osx1012=1
139147
osx1013=1
140148
osx1014=1
149+
osx1015=1
141150
fi
142151

143152
if [ $# != 1 ]; then
@@ -167,6 +176,7 @@ if [ $# != 1 ]; then
167176
echo " -osx1012 : only install OSX 10.12 SDK"
168177
echo " -osx1013 : only install OSX 10.13 SDK"
169178
echo " -osx1014 : only install OSX 10.14 SDK"
179+
echo " -osx1015 : only install OSX 10.15 SDK"
170180
echo " -path=path : A alternative Xcode folder to use. Default is /Application/Xcode.app"
171181
echo " e.g. -path=/Application/Xcode_8.3.1.app"
172182
echo "Note that these can be combined. For example, to build and install the 10.9"
@@ -233,6 +243,7 @@ xc7="$(( osx1011 != 0 ))"
233243
xc8="$(( osx1012 != 0 ))"
234244
xc9="$(( osx1013 != 0 ))"
235245
xc10="$(( osx1014 != 0 ))"
246+
xc11="$(( osx1015 != 0 ))"
236247

237248
# The sole argument is the macOS version (e.g. 10.12)
238249
installSDK() {
@@ -377,6 +388,14 @@ case $1 in
377388
echo " https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip"
378389
echo "and then run this script from within the same directory as the downloaded file"
379390
missingdmg=1
391+
fi
392+
if [ "$xc11" = 1 ] && [ ! -f Xcode_11.7.xip ]; then
393+
echo "*** You should download Xcode 11.7. Login to:"
394+
echo " https://developer.apple.com/downloads/"
395+
echo "then download from:"
396+
echo " https://download.developer.apple.com/Developer_Tools/Xcode_11.7/Xcode_11.7.xip"
397+
echo "and then run this script from within the same directory as the downloaded file"
398+
missingdmg=1
380399
fi
381400
if [ "$missingdmg" = 1 ]; then
382401
echo "*** at least one Xcode distribution is missing, cannot build packages - exiting now"
@@ -689,6 +708,18 @@ EOF
689708
( (cd "Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer" || exit; rm SDKs/MacOSX10.14.sdk; mv SDKs/MacOSX.sdk SDKs/MacOSX10.14.sdk; tar cf - SDKs/MacOSX10.14.sdk) | gzip -c > Xcode1014SDK.tar.gz) && echo "*** Created Xcode1014SDK.tar.gz in directory $(pwd)"
690709
rm -rf Xcode.app
691710
fi
711+
fi
712+
if [ "$xc11" = 1 ]; then
713+
if [ "$osx1015" = 1 ]; then
714+
echo "Extracting Mac OS X 10.15 SDK from Xcode 11.7. Be patient - this will take some time"
715+
open Xcode_11.7.xip
716+
while [ ! -d Xcode.app ]; do
717+
sleep 5
718+
done
719+
sleep 5
720+
( (cd "Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer" || exit; rm SDKs/MacOSX10.15.sdk; mv SDKs/MacOSX.sdk SDKs/MacOSX10.15.sdk; tar cf - SDKs/MacOSX10.15.sdk) | gzip -c > Xcode1015SDK.tar.gz) && echo "*** Created Xcode1015SDK.tar.gz in directory $(pwd)"
721+
rm -rf Xcode.app
722+
fi
692723
fi
693724
rmdir "$MNTDIR"
694725
;;
@@ -1107,6 +1138,10 @@ SPEC_EOF
11071138
installSDK 10.14
11081139
fi
11091140

1141+
if [ "$osx1015" = 1 ]; then
1142+
installSDK 10.15
1143+
fi
1144+
11101145
if [ "$compilers" = 1 ]; then
11111146
if [ -f /usr/bin/gcc-4.0 ]; then
11121147
#echo "*** Not installing xcode_3.2.6_gcc4.0.pkg (found installed in /usr/bin/gcc-4.0, uninstall first to force install)"
@@ -1241,6 +1276,9 @@ SPEC_EOF
12411276
if [ "$osx1014" = 1 ]; then
12421277
rm Xcode1014SDK.tar.gz 2>/dev/null
12431278
fi
1279+
if [ "$osx1015" = 1 ]; then
1280+
rm Xcode1015SDK.tar.gz 2>/dev/null
1281+
fi
12441282

12451283
;;
12461284

@@ -1357,6 +1395,10 @@ SPEC_EOF
13571395
i=10.14
13581396
[ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
13591397
fi
1398+
if [ "$osx1015" = 1 ]; then
1399+
i=10.15
1400+
[ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
1401+
fi
13601402

13611403
if [ "$compilers" = 1 ]; then
13621404
if [ "$GCCINSTALLDIR/usr/bin/gcc" -ef "$GCCINSTALLDIR/usr/bin/clang" ]; then

0 commit comments

Comments
 (0)