mac: drop build support for swift versions earlier than version 4.1

this drops support for swift <4.1 and with this support for xcode <=9.2.
this was the last setup that is officially working on macOS 10.12.

our old legacy build macOS 10.12 + xcode 9.2 is replaced by macOS 10.13
+ xcode 9.4.1 with swift 4.1. the macOS 10.13 + xcode 10.1 VM is
replaced by the latest macOS 10.14 + xcode 11.3.1 VM. this is the oldest
version officially supported by Apple.

this is in preparations for the following commit.
This commit is contained in:
der richter 2020-12-25 14:47:35 +01:00
parent bc58361d86
commit ce1571ac01
4 changed files with 21 additions and 52 deletions

View File

@ -36,18 +36,13 @@ matrix:
- <<: *mac
osx_image: xcode12.2
- <<: *mac
osx_image: xcode10.1
osx_image: xcode11.3
- <<: *mac
osx_image: xcode9.4
env:
- HOMEBREW_NO_AUTO_UPDATE=1
- HOMEBREW_NO_INSTALL_CLEANUP=1
- CI_HOMEBREW_HASH=7242872d7878f1a4c2706e5837faafcf0782b58d
- <<: *mac
osx_image: xcode9.2
env:
- HOMEBREW_NO_AUTO_UPDATE=1
- HOMEBREW_NO_INSTALL_CLEANUP=1
- CI_SWIFT_FLAGS="\-target x86_64-apple-macosx10.12"
- CI_HOMEBREW_HASH=55e02323812604add9a69bab8730319b9255a697
- os: freebsd
compiler: clang
- os: linux
@ -62,7 +57,7 @@ matrix:
env: CI_SCRIPT=ci/build-mingw64.sh TARGET=x86_64-w64-mingw32
allow_failures:
- os: osx
osx_image: xcode9.2
osx_image: xcode9.4
fast_finish: true
dist: focal
@ -123,15 +118,14 @@ before_install:
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
remove=$(brew list)
remove=$(brew list --formula)
keep="gettext pcre2 git"
install="autoconf automake pkg-config libtool python freetype fribidi little-cms2 luajit libass ffmpeg"
for formula in ${keep[@]}; do remove=("${remove[@]/$formula}"); done
for formula in ${install[@]}; do remove=("${remove[@]/$formula}"); done
brew remove --force $remove --ignore-dependencies
if [[ "$TRAVIS_OSX_IMAGE" == "xcode9.2" ]]; then
brew untap caskroom/cask
fi
brew remove --cask $(brew list --cask)
brew untap homebrew/cask
brew update
if [[ -n "$CI_HOMEBREW_HASH" ]]; then
pushd "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"

View File

@ -33,7 +33,6 @@ extension String {
#endif
extension NSPasteboard.PasteboardType {
static let fileURLCompat: NSPasteboard.PasteboardType = {
if #available(OSX 10.13, *) {
return .fileURL
@ -53,7 +52,6 @@ extension NSPasteboard.PasteboardType {
#if !swift(>=5.0)
extension Data {
mutating func withUnsafeMutableBytes<Type>(_ body: (UnsafeMutableRawBufferPointer) throws -> Type) rethrows -> Type {
let dataCount = count
return try withUnsafeMutableBytes { (ptr: UnsafeMutablePointer<UInt8>) throws -> Type in
@ -65,33 +63,8 @@ extension Data {
#if !swift(>=4.2)
extension NSDraggingInfo {
var draggingPasteboard: NSPasteboard {
get { return draggingPasteboard() }
}
}
#endif
#if !swift(>=4.1)
extension Array {
func compactMap<ElementOfResult>(_ transform: (Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
return try self.flatMap(transform)
}
}
extension Array where Element == [CGLPixelFormatAttribute] {
func contains(_ obj: [CGLPixelFormatAttribute]) -> Bool {
return self.contains(where:{ $0 == obj })
}
}
extension NSWindow.Level {
static func +(left: NSWindow.Level, right: Int) -> NSWindow.Level {
return NSWindow.Level(left.rawValue + right)
}
}
#endif

View File

@ -114,17 +114,19 @@ def check_cocoa(ctx, dependency_identifier):
return res
def check_swift(ctx, dependency_identifier):
minVer = StrictVersion("3.0.2")
if ctx.env.SWIFT_VERSION:
if StrictVersion(ctx.env.SWIFT_VERSION) >= minVer:
ctx.add_optional_message(dependency_identifier,
'version found: ' + str(ctx.env.SWIFT_VERSION))
return True
ctx.add_optional_message(dependency_identifier,
"'swift >= " + str(minVer) + "' not found, found " +
str(ctx.env.SWIFT_VERSION or None))
return False
def check_swift(version):
def fn(ctx, dependency_identifier):
minVer = StrictVersion(version)
if ctx.env.SWIFT_VERSION:
if StrictVersion(ctx.env.SWIFT_VERSION) >= minVer:
ctx.add_optional_message(dependency_identifier,
'version found: ' + str(ctx.env.SWIFT_VERSION))
return True
ctx.add_optional_message(dependency_identifier,
"'swift >= " + str(minVer) + "' not found, found " +
str(ctx.env.SWIFT_VERSION or None))
return False
return fn
def check_egl_provider(minVersion=None, name='egl', check=None):
def fn(ctx, dependency_identifier, **kw):

View File

@ -182,7 +182,7 @@ main_dependencies = [
'name': '--swift',
'desc': 'macOS Swift build tools',
'deps': 'os-darwin',
'func': compose_checks(check_swift, check_macos_sdk('10.10')),
'func': compose_checks(check_swift('4.1'), check_macos_sdk('10.10')),
}, {
'name': '--uwp',
'desc': 'Universal Windows Platform',