<pre style='margin:0'>
Aaron Madlon-Kay (amake) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/c08c2d0d7053492a0782203b939754f2233f5638">https://github.com/macports/macports-ports/commit/c08c2d0d7053492a0782203b939754f2233f5638</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 c08c2d0d705 java-1.0 portgroup: better workaround for Big Sur issue
</span>c08c2d0d705 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit c08c2d0d7053492a0782203b939754f2233f5638
</span>Author: Aaron Madlon-Kay <amake@macports.org>
AuthorDate: Mon Dec 14 11:05:04 2020 +0900
<span style='display:block; white-space:pre;color:#404040;'> java-1.0 portgroup: better workaround for Big Sur issue
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See https://trac.macports.org/ticket/61445
</span>---
_resources/port1.0/group/java-1.0.tcl | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/java-1.0.tcl b/_resources/port1.0/group/java-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 9f59fe5cbf3..02a35101537 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/java-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/java-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -34,16 +34,8 @@ pre-fetch {
</span> java_set_env
# If still not present, error out
if { ${java_version_not_found} } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global os.platform os.major
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.platform} eq "darwin" && ${os.major} == 20} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # The following check is broken on macOS 11 Big Sur so we
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # temporarily give up on ensuring an exact Java version. See
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://trac.macports.org/ticket/61445
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_warn "Failed to confirm that required Java was installed; see https://trac.macports.org/ticket/61445"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "${name} requires Java ${java.version} but no such installation could be found."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "missing required Java version"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "${name} requires Java ${java.version} but no such installation could be found."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "missing required Java version"
</span> }
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -58,6 +50,21 @@ proc find_java_home {} {
</span>
global java.version java.fallback
if { ${java.version} ne "" } {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # /usr/libexec/java_home on Big Sur appears to have a bug where it won't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # honor the -f flag if the JAVA_HOME envar is set. See
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://stackoverflow.com/a/64917842/448068
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Temporarily unset and stash the value here.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # See https://trac.macports.org/ticket/61445
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global os.platform os.major
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set big_sur_workaround [expr {${os.platform} eq "darwin" && ${os.major} == 20 && [info exists ::env(JAVA_HOME)]}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${big_sur_workaround}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set env_java_home $::env(JAVA_HOME)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unset $::env(JAVA_HOME)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if { [catch {set val [exec "/usr/libexec/java_home" "-f" "-v" ${java.version}]}] } {
# Don't return an error because that would prevent the port from
# even being indexed when the required Java is missing. Instead, set
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -67,6 +74,11 @@ proc find_java_home {} {
</span> set home_value $val
ui_debug "Discovered JAVA_HOME via /usr/libexec/java_home -f -v: $home_value"
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Restore original JAVA_HOME value stashed above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${big_sur_workaround}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set $::env(JAVA_HOME) ${env_java_home}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
# Default to any valid value that made it through the environment
</pre><pre style='margin:0'>
</pre>