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

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/df181bfc6abe713626cd956235a675770645fc9c">https://github.com/macports/macports-ports/commit/df181bfc6abe713626cd956235a675770645fc9c</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 df181bfc6ab cmake-bootstrap: Backport a fix for find_library
</span>df181bfc6ab is described below

<span style='display:block; white-space:pre;color:#808000;'>commit df181bfc6abe713626cd956235a675770645fc9c
</span>Author: Mark Mentovai <mark@chromium.org>
AuthorDate: Thu Jun 9 23:43:59 2022 -0400

<span style='display:block; white-space:pre;color:#404040;'>    cmake-bootstrap: Backport a fix for find_library
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    CMake versions older than 3.18 (including cmake-bootstrap, pegged at
</span><span style='display:block; white-space:pre;color:#404040;'>    3.9) have a bug in find_library that causes them to find libraries when
</span><span style='display:block; white-space:pre;color:#404040;'>    filesystem nodes are present at a candidate path, even if they are not
</span><span style='display:block; white-space:pre;color:#404040;'>    usable. This can happen “innocently” since macOS 11, where expanded use
</span><span style='display:block; white-space:pre;color:#404040;'>    of the dyld shared cache has caused the removal of most OS dylibs from
</span><span style='display:block; white-space:pre;color:#404040;'>    the filesystem.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    For example, when instructed to look for shared library iodbc.2, a CMake
</span><span style='display:block; white-space:pre;color:#404040;'>    with this bug running on macOS 11 or later might notice a symbolic link
</span><span style='display:block; white-space:pre;color:#404040;'>    at /usr/lib/libiodbc.2.dylib and return it. That dylib is not usable, as
</span><span style='display:block; white-space:pre;color:#404040;'>    it’s “dangling”: it refers to libiodbc.2.1.18.dylib, which isn’t present
</span><span style='display:block; white-space:pre;color:#404040;'>    on disk, it’s only in the dyld shared cache. This CMake bug might cause
</span><span style='display:block; white-space:pre;color:#404040;'>    a build to attempt to link against /usr/lib/libiodbc.2.dylib, which is,
</span><span style='display:block; white-space:pre;color:#404040;'>    of course, impossible, as the symbolic link points nowhere. The expected
</span><span style='display:block; white-space:pre;color:#404040;'>    behavior is for CMake to discard that unusable path and continue its
</span><span style='display:block; white-space:pre;color:#404040;'>    search, eventually locating $SDKROOT/usr/lib/libiodbc.2.tbd.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    This backports the fix present in CMake 3.18
</span><span style='display:block; white-space:pre;color:#404040;'>    (https://gitlab.kitware.com/cmake/cmake/-/commit/f2c903fb9a02) which
</span><span style='display:block; white-space:pre;color:#404040;'>    causes find_library to check that a file is readable before returning
</span><span style='display:block; white-space:pre;color:#404040;'>    it. A symbolic link that points nowhere will not pass this check. This
</span><span style='display:block; white-space:pre;color:#404040;'>    improves cmake-bootstrap’s reliability on newer OS versions where OS
</span><span style='display:block; white-space:pre;color:#404040;'>    dylibs are only in the dyld shared cache and not in the filesystem.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    This also updates cmake-bootstrap to 3.9.6. The cmake-bootstrap port is
</span><span style='display:block; white-space:pre;color:#404040;'>    intended to be pegged to the last version of CMake to not require C++11.
</span><span style='display:block; white-space:pre;color:#404040;'>    In reality, the diff between the existing 3.9.4 and 3.9.6 is minimal
</span><span style='display:block; white-space:pre;color:#404040;'>    (https://gitlab.kitware.com/cmake/cmake/-/compare/v3.9.4...v3.9.6) and
</span><span style='display:block; white-space:pre;color:#404040;'>    does not introduce a C++11 requirement. There’s no reason for the port
</span><span style='display:block; white-space:pre;color:#404040;'>    not to be at the terminal version on the CMake 3.9 branch, 3.9.6.
</span>---
 devel/cmake-bootstrap/Portfile                     | 27 +++++++++++-----------
 .../patch-Source-cmFindLibraryCommand.cxx.diff     | 14 +++++++++++
 2 files changed, 28 insertions(+), 13 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cmake-bootstrap/Portfile b/devel/cmake-bootstrap/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index a9478c8a521..507c98ed7c4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/cmake-bootstrap/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cmake-bootstrap/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,12 +12,12 @@ maintainers         nomaintainer
</span> dist_subdir         cmake
 
 set branch          3.9
<span style='display:block; white-space:pre;background:#ffe0e0;'>-version             ${branch}.4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version             ${branch}.6
</span> distname            cmake-${version}
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums           rmd160  bb9c30f2726413f0d7d7b92e0294b61438151d62 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    sha256  b5d86f12ae0072db520fdbdad67405f799eb728b610ed66043c20a92b4906ca1 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    size    7705052
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums           rmd160  858257d95fde810195e4cf7254072dd8db608cc4 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    sha256  7410851a783a41b521214ad987bb534a7e4a65e059651a2514e6ebfc8f46b218 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    size    7705400
</span> 
 homepage            https://cmake.org
 master_sites        ${homepage}/files/v${branch}/
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -35,6 +35,7 @@ patchfiles-append \
</span>     patch-Modules-noArchCheck.release.diff \
     patch-CMakeFindFrameworks.cmake.release.diff \
     patch-Source_CMakeVersionCompute.cmake.release.diff \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    patch-Source-cmFindLibraryCommand.cxx.diff \
</span>     patch-Source-kwsys-kwsysPlatformTestsCXX.cxx.diff
 
 post-patch {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -47,16 +48,16 @@ configure.cxx_stdlib
</span> platform darwin {
     configure.env-append   CMAKE_OSX_DEPLOYMENT_TARGET=${macosx_deployment_target}
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        if {${configure.sdkroot} eq ""} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           configure.env-append SDKROOT=/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {${configure.sdkroot} eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        configure.env-append SDKROOT=/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        if {${os.arch} eq "i386" && ${os.major} <= 9} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           # The old system headers do some bit shifting on Intel about which newer compilers throw errors:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           # SecKeychain.h:102:46: error: shift expression '(1853123693 << 8)' overflows [-fpermissive]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           configure.cflags-append -fpermissive
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-           configure.cxxflags-append -fpermissive
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-   }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {${os.arch} eq "i386" && ${os.major} <= 9} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # The old system headers do some bit shifting on Intel about which newer compilers throw errors:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        # SecKeychain.h:102:46: error: shift expression '(1853123693 << 8)' overflows [-fpermissive]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        configure.cflags-append -fpermissive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        configure.cxxflags-append -fpermissive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span> }
 
 # Clear CPATH and LIBRARY_PATH as we want to be completely independent of other ports
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cmake-bootstrap/files/patch-Source-cmFindLibraryCommand.cxx.diff b/devel/cmake-bootstrap/files/patch-Source-cmFindLibraryCommand.cxx.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..80864fc98f0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cmake-bootstrap/files/patch-Source-cmFindLibraryCommand.cxx.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,14 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git Source/cmFindLibraryCommand.cxx Source/cmFindLibraryCommand.cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a6b1a2155c..45b14a030a 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Source/cmFindLibraryCommand.cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Source/cmFindLibraryCommand.cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -387,7 +387,8 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     if (name.Regex.find(testName)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+       this->TestPath = path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+       this->TestPath += origName;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-      if (!cmSystemTools::FileIsDirectory(this->TestPath)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      // Make sure the path is readable and is not a directory.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++      if (cmSystemTools::FileExists(this->TestPath, true)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         // This is a matching file.  Check if it is better than the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         // best name found so far.  Earlier prefixes are preferred,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         // followed by earlier suffixes.  For OpenBSD, shared library
</span></pre><pre style='margin:0'>

</pre>