<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/d33f9e52bf94491eafbf164c1d3b5951e8df29aa">https://github.com/macports/macports-ports/commit/d33f9e52bf94491eafbf164c1d3b5951e8df29aa</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit d33f9e52bf94491eafbf164c1d3b5951e8df29aa
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Tue Nov 16 14:37:50 2021 +0000

<span style='display:block; white-space:pre;color:#404040;'>    openssl PG: Add configuration method that sets env. vars.
</span>---
 _resources/port1.0/group/openssl-1.0.tcl | 49 +++++++++++++++++++++++++++-----
 1 file changed, 42 insertions(+), 7 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/openssl-1.0.tcl b/_resources/port1.0/group/openssl-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 3e79ca93926..2dbca032be3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/openssl-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/openssl-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -14,7 +14,7 @@ options openssl.depends_type
</span> default openssl.depends_type lib
 
 options openssl.configure
<span style='display:block; white-space:pre;background:#ffe0e0;'>-default openssl.configure {pkgconfig build_flags}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default openssl.configure {env_vars pkgconfig build_flags}
</span> 
 # cache variables storing current configuration state
 default openssl_cache_branch_nodot ""
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -23,6 +23,7 @@ default openssl_cache_incdir       ""
</span> default openssl_cache_libdir       ""
 default openssl_cache_cmake_flags  ""
 default openssl_cache_configure    ""
<span style='display:block; white-space:pre;background:#e0ffe0;'>+default openssl_cache_env_vars     [list ]
</span> 
 proc openssl::default_branch {} {
     # NOTE - Whenever the default branch is bumped, the revision
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -86,6 +87,8 @@ proc openssl::set_openssl_dependency {} {
</span>     
     if { [openssl::is_enabled] } {
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        ui_debug "openssl: Set OpenSSL Branch dependency [option openssl.branch]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span>         # Just in case, remove this dep
         depends_lib-delete path:lib/libssl.dylib:openssl
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -106,7 +109,7 @@ proc openssl::check_for_cmake {} {
</span>     if { [openssl::is_enabled] } {
         if { [string match *cmake* [option configure.cmd] ] } {
             if { ![string match *cmake* [option openssl.configure] ] } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                ui_debug "Appending cmake to openssl configuration types"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                ui_debug "openssl: Appending cmake to openssl configuration types"
</span>                 openssl.configure-append cmake
             }
         }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -114,8 +117,27 @@ proc openssl::check_for_cmake {} {
</span> }
 port::register_callback openssl::check_for_cmake
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+proc openssl::add_once { opt where value } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    ui_debug "openssl:  -> Will $where $value to $opt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    ${opt}-delete   ${value}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    ${opt}-${where} ${value}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc openssl::set_phase_env_var { var } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    foreach phase { extract configure build destroot test } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        openssl::add_once ${phase}.env append ${var}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc openssl::remove_phase_env_var { var } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    foreach phase { extract configure build destroot test } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ui_debug "openssl:  -> removing env var ${var}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ${phase}.env-delete ${var}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc openssl::configure_build {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global openssl_cache_branch_nodot openssl_cache_depends
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    global openssl_cache_branch_nodot openssl_cache_depends openssl_cache_env_vars
</span>     global openssl_cache_incdir openssl_cache_libdir openssl_cache_cmake_flags openssl_cache_configure
 
     if { [openssl::is_enabled] } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -125,7 +147,7 @@ proc openssl::configure_build {} {
</span>              ${openssl_cache_depends} ne [option openssl.depends_type] ||
              ${openssl_cache_configure} ne [option openssl.configure] } {
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            ui_debug "Configure Types '[option openssl.configure]'"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            ui_debug "openssl: Configure Types '[option openssl.configure]' Branch [option openssl.branch]"
</span> 
             # If no configure method(s) given do nothing
             set openssl_cache_configure [option openssl.configure]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -133,14 +155,25 @@ proc openssl::configure_build {} {
</span> 
                 foreach meth [option openssl.configure] {
                     switch ${meth} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                        env_vars {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            ui_debug "openssl: -> Setting openssl environment variable configuration"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            foreach var ${openssl_cache_env_vars} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                openssl::remove_phase_env_var ${var}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            # Set various env vars. that may help ports locate the correct openssl installation
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            set openssl_cache_env_vars [list OPENSSL_DIR=[openssl::install_area]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            foreach var ${openssl_cache_env_vars} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                openssl::set_phase_env_var ${var}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        }
</span>                         pkgconfig {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            ui_debug " -> Setting openssl pkgconfig configuration"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            ui_debug "openssl: -> Setting openssl pkgconfig configuration"
</span>                             configure.pkg_config_path-prepend [openssl::pkgconfig_dir]
                             depends_build-delete port:pkgconfig
                             depends_build-append port:pkgconfig
                         }
                         build_flags {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            ui_debug " -> Setting openssl build flags configuration"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            ui_debug "openssl: -> Setting openssl build flags configuration"
</span>                             if { ${openssl_cache_incdir} ne "" } {
                                 configure.cppflags-delete -I${openssl_cache_incdir}
                                 configure.cflags-delete   -I${openssl_cache_incdir}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -155,7 +188,7 @@ proc openssl::configure_build {} {
</span>                             configure.ldflags-prepend  -L${openssl_cache_libdir}
                         }
                         cmake {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            ui_debug " -> Setting openssl cmake configuration"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            ui_debug "openssl: -> Setting openssl cmake configuration"
</span>                             if { ${openssl_cache_cmake_flags} ne "" } {
                                 foreach flag ${openssl_cache_cmake_flags} {
                                     configure.args-delete ${flag}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -188,6 +221,7 @@ port::register_callback openssl::configure_build
</span> 
 proc openssl::branch_proc {option action args} {
     if {$action ne "set"} return
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    ui_debug "openssl: branch_proc $action : Branch [option openssl.branch]"
</span>     openssl::set_openssl_dependency
     openssl::configure_build
 }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -195,6 +229,7 @@ option_proc openssl.branch openssl::branch_proc
</span> 
 proc openssl::configure_proc {option action args} {
     if {$action ne "set"} return
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    ui_debug "openssl: configure_proc $action : Configure '[option openssl.configure]'"
</span>     openssl::configure_build
 }
 option_proc openssl.configure openssl::configure_proc
</pre><pre style='margin:0'>

</pre>