Skip to content

Commit bc42387

Browse files
committed
Create swift-latest symlink in darwin installer
1 parent 1e2eea6 commit bc42387

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

utils/build-script-impl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ if [[ "${INSTALLABLE_PACKAGE}" ]] ; then
21492149
echo "-- Create Installer --"
21502150
"${SWIFT_SOURCE_DIR}/utils/toolchain-installer" "${INSTALL_DESTDIR}/${TOOLCHAIN_PREFIX}" "${DARWIN_TOOLCHAIN_BUNDLE_IDENTIFIER}" \
21512151
"${DARWIN_TOOLCHAIN_INSTALLER_CERT}" "${DARWIN_TOOLCHAIN_INSTALLER_PACKAGE}" "${DARWIN_TOOLCHAIN_INSTALL_LOCATION}" \
2152-
"${DARWIN_TOOLCHAIN_VERSION}"
2152+
"${DARWIN_TOOLCHAIN_VERSION}" "${SWIFT_SOURCE_DIR}/utils/darwin-installer-scripts"
21532153
fi
21542154

21552155
(cd "${INSTALL_DESTDIR}" &&
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
#===--- postinstall - Creates symlink after installing xctoolchain ----------===#
3+
#
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See http://swift.org/LICENSE.txt for license information
10+
## See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11+
#
12+
#===------------------------------------------------------------------------===#
13+
14+
INSTALLED_TOOLCHAIN=$2
15+
16+
ln -fs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest.xctoolchain"

utils/toolchain-installer

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ DARWIN_INSTALLER_CERT=$3
1717
DARWIN_INSTALLER_PACKAGE=$4
1818
DARWIN_TOOLCHAIN_INSTALL_LOCATION=$5
1919
DARWIN_TOOLCHAIN_VERSION=$6
20+
DARWIN_SCRIPTS=$7
2021

2122
pkgbuild --root "${TOOLCHAIN_PREFIX}" --install-location "${DARWIN_TOOLCHAIN_INSTALL_LOCATION}" "${DARWIN_INSTALLER_PACKAGE}" \
22-
--version "${DARWIN_TOOLCHAIN_VERSION}" --identifier "${DARWIN_BUNDLE_IDENTIFIER}" --sign "${DARWIN_INSTALLER_CERT}"
23+
--version "${DARWIN_TOOLCHAIN_VERSION}" --identifier "${DARWIN_BUNDLE_IDENTIFIER}" --sign "${DARWIN_INSTALLER_CERT}" \
24+
--scripts "${DARWIN_SCRIPTS}"

0 commit comments

Comments
 (0)