<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/8aa347e8adaa0250fda0b45309d3a31266c7cedb">https://github.com/macports/macports-base/commit/8aa347e8adaa0250fda0b45309d3a31266c7cedb</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 8aa347e8 handle SDKs with minor versions
</span>8aa347e8 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 8aa347e8adaa0250fda0b45309d3a31266c7cedb
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed Dec 16 03:32:11 2020 +1100
<span style='display:block; white-space:pre;color:#404040;'> handle SDKs with minor versions
</span>---
src/macports1.0/macports.tcl | 6 +---
src/port1.0/portconfigure.tcl | 77 +++++++++++++++++++++++++++++++++----------
src/port1.0/portutil.tcl | 2 +-
3 files changed, 61 insertions(+), 24 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 9d127e15..e1bfbc4a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1160,11 +1160,7 @@ match macports.conf.default."
</span> }
}
if {![info exists macports::macosx_sdk_version]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[vercmp $macos_version 11] >= 0} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set macports::macosx_sdk_version ${macos_version_major}.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set macports::macosx_sdk_version $macos_version_major
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set macports::macosx_sdk_version $macos_version_major
</span> }
if {![info exists macports::revupgrade_autorun]} {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portconfigure.tcl b/src/port1.0/portconfigure.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 9ba19d5c..81eb4bfd 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portconfigure.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portconfigure.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -509,6 +509,14 @@ proc portconfigure::configure_get_ld_archflags {} {
</span> }
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# find a "close enough" match for the given sdk_version in sdk_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc portconfigure::find_close_sdk {sdk_version sdk_path} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # only works right for versions >= 11, which is all we need
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_major [lindex [split $sdk_version .] 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdks [glob -nocomplain -directory $sdk_path MacOSX${sdk_major}*.sdk]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [lindex [lsort -command vercmp $sdks] 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc portconfigure::configure_get_sdkroot {sdk_version} {
global developer_dir macos_version_major xcodeversion os.arch os.major os.platform use_xcode
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -527,24 +535,38 @@ proc portconfigure::configure_get_sdkroot {sdk_version} {
</span> return {}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_major [lindex [split $sdk_version .] 0]
</span> set cltpath /Library/Developer/CommandLineTools
# Check CLT first if Xcode shouldn't be used
if {![tbool use_xcode]} {
set sdk ${cltpath}/SDKs/MacOSX${sdk_version}.sdk
if {[file exists $sdk]} {
return $sdk
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$sdk_major >= 11} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # SDKs have minor versions as of macOS 11
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk [find_close_sdk $sdk_version ${cltpath}/SDKs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$sdk ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists ::portconfigure::sdkroot_cache(macosx${sdk_version})]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$::portconfigure::sdkroot_cache(macosx${sdk_version}) ne ""} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $::portconfigure::sdkroot_cache(macosx${sdk_version})
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # negative result cached, do nothing here
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {![catch {exec env DEVELOPER_DIR=${cltpath} xcrun --sdk macosx${sdk_version} --show-sdk-path 2> /dev/null} sdk]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ::portconfigure::sdkroot_cache(macosx${sdk_version}) $sdk
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$sdk_major >= 11 && $sdk_major == $macos_version_major} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set try_versions [list ${sdk_major}.0 [option macos_version]]
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set ::portconfigure::sdkroot_cache(macosx${sdk_version}) ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set try_versions [list $sdk_version]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach try_version $try_versions {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists ::portconfigure::sdkroot_cache(macosx${try_version})]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$::portconfigure::sdkroot_cache(macosx${try_version}) ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $::portconfigure::sdkroot_cache(macosx${try_version})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # negative result cached, do nothing here
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {![catch {exec env DEVELOPER_DIR=${cltpath} xcrun --sdk macosx${try_version} --show-sdk-path 2> /dev/null} sdk]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ::portconfigure::sdkroot_cache(macosx${try_version}) $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ::portconfigure::sdkroot_cache(macosx${try_version}) ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
# Fallback on "macosx"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -580,23 +602,42 @@ proc portconfigure::configure_get_sdkroot {sdk_version} {
</span>
if {[file exists $sdk]} {
return $sdk
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$sdk_major >= 11} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # SDKs have minor versions as of macOS 11
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk [find_close_sdk $sdk_version ${sdks_dir}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$sdk ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists ::portconfigure::sdkroot_cache(macosx${sdk_version},noclt)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$::portconfigure::sdkroot_cache(macosx${sdk_version},noclt) ne ""} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $::portconfigure::sdkroot_cache(macosx${sdk_version},noclt)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # negative result cached, do nothing here
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {![catch {exec xcrun --sdk macosx${sdk_version} --show-sdk-path 2> /dev/null} sdk]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ::portconfigure::sdkroot_cache(macosx${sdk_version},noclt) $sdk
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$sdk_major >= 11 && $sdk_major == $macos_version_major} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set try_versions [list ${sdk_major}.0 [option macos_version]]
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set ::portconfigure::sdkroot_cache(macosx${sdk_version},noclt) ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set try_versions [list $sdk_version]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach try_version $try_versions {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists ::portconfigure::sdkroot_cache(macosx${try_version},noclt)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$::portconfigure::sdkroot_cache(macosx${try_version},noclt) ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $::portconfigure::sdkroot_cache(macosx${try_version},noclt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # negative result cached, do nothing here
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {![catch {exec xcrun --sdk macosx${try_version} --show-sdk-path 2> /dev/null} sdk]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ::portconfigure::sdkroot_cache(macosx${try_version},noclt) $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ::portconfigure::sdkroot_cache(macosx${try_version},noclt) ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
set sdk ${cltpath}/SDKs/MacOSX${sdk_version}.sdk
if {[file exists $sdk]} {
return $sdk
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$sdk_major >= 11} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # SDKs have minor versions as of macOS 11
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk [find_close_sdk $sdk_version ${cltpath}/SDKs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$sdk ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
set sdk ${sdks_dir}/MacOSX.sdk
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index cff6e706..46961ccc 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3391,7 +3391,7 @@ proc _check_xcode_version {} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.major} >= 18 && [option configure.sdk_version] ne "" && [file tail [option configure.sdkroot]] ne "MacOSX[option configure.sdk_version].sdk"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${os.major} >= 18 && [option configure.sdk_version] ne "" && ![string match MacOSX[option configure.sdk_version]*.sdk [file tail [option configure.sdkroot]]]} {
</span> ui_warn "The macOS [option configure.sdk_version] SDK does not appear to be installed. Ports may not build correctly."
ui_warn "You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'."
}
</pre><pre style='margin:0'>
</pre>