Skip to content

Commit

Permalink
add support for 10.15 SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed May 2, 2021
1 parent 9b9fe13 commit 6772961
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ I made the script XcodeLegacy.sh to extract these components (the links work if
[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),
[Xcode 8.3.3](https://download.developer.apple.com/Developer_Tools/Xcode_8.3.3/Xcode8.3.3.xip) (10.12 SDK),
[Xcode 9.4.1](https://download.developer.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip) (10.13 SDK),
[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:
[Xcode 10.3](https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip) (10.14 SDK)
[Xcode 11.7](https://download.developer.apple.com/Developer_Tools/Xcode_11.7/Xcode_11.7.xip) (10.15 SDK)
and install them in Xcode 4-12:

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


Expand Down Expand Up @@ -124,6 +127,7 @@ Here are the latest versions of Xcode that are known to /run/ on each OS X versi
- [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. (\*\*)
- [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. (\*\*)
- [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.
- [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).

(\*) 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.

Expand Down Expand Up @@ -226,4 +230,5 @@ History
- 2.2 (10/01/2019): Xcode 10 dropped 10.13 SDK, get it from Xcode 9.4.1
- 2.3 (27/03/2019): Added an option to install in a custom Xcode path
- 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.
- 2.5 (01/05/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
- 2.5 (31/04/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
- 2.6 (01/05/2021): Xcode 12 dropped 10.15 SDK, get it from Xcode 11.7
42 changes: 42 additions & 0 deletions XcodeLegacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# 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
# 2.3 (27/03/2019): Added an option to install in a custom Xcode path
# 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.
# 2.5 (31/04/2021): Xcode 11 dropped 10.14 SDK, get it from Xcode 10.3
# 2.6 (01/05/2021): Xcode 12 dropped 10.15 SDK, get it from Xcode 11.7

#set -e # Exit immediately if a command exits with a non-zero status
#set -u # Treat unset variables as an error when substituting.
Expand All @@ -47,6 +49,7 @@ osx1011=0
osx1012=0
osx1013=0
osx1014=0
osx1015=0
gotoption=0
error=0

Expand Down Expand Up @@ -112,6 +115,11 @@ while [[ $error = 0 ]] && [[ $# -gt 1 ]]; do
osx1014=1
gotoption=1
shift
;;
-osx1015)
osx1015=1
gotoption=1
shift
;;
-path=*)
CUSTOM_APP="${1#*=}"
Expand All @@ -138,6 +146,7 @@ if [ $gotoption = 0 ]; then
osx1012=1
osx1013=1
osx1014=1
osx1015=1
fi

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

# The sole argument is the macOS version (e.g. 10.12)
installSDK() {
Expand Down Expand Up @@ -377,6 +388,14 @@ case $1 in
echo " https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip"
echo "and then run this script from within the same directory as the downloaded file"
missingdmg=1
fi
if [ "$xc11" = 1 ] && [ ! -f Xcode_11.7.xip ]; then
echo "*** You should download Xcode 11.7. Login to:"
echo " https://developer.apple.com/downloads/"
echo "then download from:"
echo " https://download.developer.apple.com/Developer_Tools/Xcode_11.7/Xcode_11.7.xip"
echo "and then run this script from within the same directory as the downloaded file"
missingdmg=1
fi
if [ "$missingdmg" = 1 ]; then
echo "*** at least one Xcode distribution is missing, cannot build packages - exiting now"
Expand Down Expand Up @@ -689,6 +708,18 @@ EOF
( (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)"
rm -rf Xcode.app
fi
fi
if [ "$xc11" = 1 ]; then
if [ "$osx1015" = 1 ]; then
echo "Extracting Mac OS X 10.15 SDK from Xcode 11.7. Be patient - this will take some time"
open Xcode_11.7.xip
while [ ! -d Xcode.app ]; do
sleep 5
done
sleep 5
( (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)"
rm -rf Xcode.app
fi
fi
rmdir "$MNTDIR"
;;
Expand Down Expand Up @@ -1107,6 +1138,10 @@ SPEC_EOF
installSDK 10.14
fi

if [ "$osx1015" = 1 ]; then
installSDK 10.15
fi

if [ "$compilers" = 1 ]; then
if [ -f /usr/bin/gcc-4.0 ]; then
#echo "*** Not installing xcode_3.2.6_gcc4.0.pkg (found installed in /usr/bin/gcc-4.0, uninstall first to force install)"
Expand Down Expand Up @@ -1241,6 +1276,9 @@ SPEC_EOF
if [ "$osx1014" = 1 ]; then
rm Xcode1014SDK.tar.gz 2>/dev/null
fi
if [ "$osx1015" = 1 ]; then
rm Xcode1015SDK.tar.gz 2>/dev/null
fi

;;

Expand Down Expand Up @@ -1357,6 +1395,10 @@ SPEC_EOF
i=10.14
[ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
fi
if [ "$osx1015" = 1 ]; then
i=10.15
[ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
fi

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

0 comments on commit 6772961

Please sign in to comment.