<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/b6ace059271dd2930b352af5a2b44a155b91b64f">https://github.com/macports/macports-ports/commit/b6ace059271dd2930b352af5a2b44a155b91b64f</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 b6ace059271 flang-11: new port
</span>b6ace059271 is described below

<span style='display:block; white-space:pre;color:#808000;'>commit b6ace059271dd2930b352af5a2b44a155b91b64f
</span>Author: Ken Cunningham <kencu@macports.org>
AuthorDate: Sun Nov 29 14:18:47 2020 -0800

<span style='display:block; white-space:pre;color:#404040;'>    flang-11: new port
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    This is an early release of the flang compiler from llvm.
</span><span style='display:block; white-space:pre;color:#404040;'>    It requires another compiler to do the actual fortran
</span><span style='display:block; white-space:pre;color:#404040;'>    compiling, and defaults to "gfortran" on your path.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    If there is no gfortran on your PATH, you will need to
</span><span style='display:block; white-space:pre;color:#404040;'>    set the desired fortran compiler with an ENV VAR, eg:
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    F18_FC=gfortran-mp-10 flang-mp-11 hello.f90 -o hello.bin
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    This port is provided as a much-requested, proof-of-concept.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    An actualy flang that can compile fortran itself is expected
</span><span style='display:block; white-space:pre;color:#404040;'>    with clang-12. As early versions of this become available,
</span><span style='display:block; white-space:pre;color:#404040;'>    we'll try them with a new flang-devel port that does not
</span><span style='display:block; white-space:pre;color:#404040;'>    yet exist.
</span>---
 lang/llvm-11/Portfile | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-11/Portfile b/lang/llvm-11/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 7e9a51b3c3f..9244340671f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-11/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-11/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -29,6 +29,7 @@ checksums               rmd160  594eb676d9c9786d809587c39dff087f2e8c9429 \
</span> name                    llvm-${llvm_version}
 revision                0
 subport                 clang-${llvm_version} { revision 0 }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+subport                 flang-${llvm_version} { revision 0 }
</span> subport                 lldb-${llvm_version} { revision 0 }
 set suffix              mp-${llvm_version}
 set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -70,6 +71,22 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span> 
     default_variants-append +analyzer
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+} elseif {${subport} eq "flang-${llvm_version}"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    homepage            https://flang.llvm.org/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    description         LLVM Fortran compiler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    long_description    ${description}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    depends_lib-append  port:llvm-${llvm_version} port:clang-${llvm_version}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # flang currently requires gfortran to actually compile anything
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # and we may have to set "F18_FC" in the environment to something else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # for it to find the gfortran we want to use
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {${build_arch} eq "arm64"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        depends_run-append  port:gcc-devel
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        depends_run-append  port:gcc10
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> } elseif {${subport} eq "lldb-${llvm_version}"} {
     homepage            https://lldb.llvm.org/
     description         the LLVM debugger
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -101,6 +118,14 @@ post-extract {
</span>         ln -s ${workpath}/llvm-project/libcxx                           ${worksrcpath}/projects/libcxx
         ln -s ${workpath}/llvm-project/libcxxabi                        ${worksrcpath}/projects/libcxxabi
         ln -s ${workpath}/llvm-project/clang-tools-extra                ${worksrcpath}/tools/clang/tools/extra
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    } elseif {${subport} eq "flang-${llvm_version}"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/clang                            ${worksrcpath}/tools/clang
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/compiler-rt                      ${worksrcpath}/projects/compiler-rt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/libcxx                           ${worksrcpath}/projects/libcxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/libcxxabi                        ${worksrcpath}/projects/libcxxabi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/clang-tools-extra                ${worksrcpath}/tools/clang/tools/extra
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/mlir                             ${worksrcpath}/tools/mlir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ln -s ${workpath}/llvm-project/flang                            ${worksrcpath}/tools/flang
</span>     } elseif {${subport} eq "lldb-${llvm_version}"} {
         ln -s ${workpath}/llvm-project/clang                            ${worksrcpath}/tools/clang
         ln -s ${workpath}/llvm-project/lldb                             ${worksrcpath}/tools/lldb
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -134,6 +159,24 @@ if {${subport} eq "clang-${llvm_version}"} {
</span>         5002-patch-toolchains-darwin-add-back-pre-10.6-link-libs.diff
 }
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${subport} eq "flang-${llvm_version}"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    patchfiles-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1001-MacPorts-Only-Prepare-clang-format-for-replacement-w.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1002-MacPorts-Only-Fix-name-of-scan-view-executable-insid.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1004-Default-to-fragile-ObjC-runtime-when-targeting-darwi.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1005-Fixup-libstdc-header-search-paths-for-older-versions.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1007-Fix-float.h-to-work-on-Snow-Leopard-and-earlier.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1008-compilerrt-fuzzer-missingdefs.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        1009-compilerrt-sanitizer-missingdefs.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        2002-Work-around-no-libdispatch-on-10.6.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        3001-Fix-missing-long-long-math-prototypes-when-using-the.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        3002-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        openmp-locations.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        leopard-no-asan.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        5000-patch-compilerrtdarwinutils-find-macosxsdkversion.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        5002-patch-toolchains-darwin-add-back-pre-10.6-link-libs.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if {${subport} eq "lldb-${llvm_version}"} {
     # lldb needs the clang sources present, so we apply the applicable patches.
     patchfiles-append \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -194,6 +237,23 @@ if {${subport} eq "llvm-${llvm_version}"} {
</span>         -DLIBCXX_ENABLE_SHARED=OFF \
         -DLIBCXX_INSTALL_LIBRARY=OFF
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+} elseif {${subport} eq "flang-${llvm_version}"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # CMAKE_LINKER is used to determine the value for HOST_LINK_VERSION
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DCMAKE_LINKER=${prefix}/bin/ld \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DLD64_EXECUTABLE=${prefix}/bin/ld \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DCLANG_INCLUDE_TESTS=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DCLANG_ENABLE_STATIC_ANALYZER=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DCLANG_ENABLE_ARCMT=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DDARWIN_PREFER_PUBLIC_SDK=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DLLVM_BUILD_RUNTIME=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DLIBCXX_ENABLE_SHARED=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        -DLIBCXX_INSTALL_LIBRARY=OFF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# useful in clang-devel and newer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#        configure.args-append -DFLANG_BUILD_NEW_DRIVER=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> } elseif {${subport} eq "lldb-${llvm_version}"} {
     #select.group        lldb
     #select.file         ${filespath}/mp-${subport}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -342,6 +402,23 @@ if {${subport} eq "clang-${llvm_version}"} {
</span>     }
 }
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${subport} eq "flang-${llvm_version}"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system "cd ${destroot.dir}/tools/mlir && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system "cd ${destroot.dir}/tools/flang && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        system "chmod 755 ${destroot}${sub_prefix}/bin/flang"
</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;'>+    notes-append {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        This version of flang passes off to another fortran compiler to do the actual compiling.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        At present, you may need to set the desired fortran compiler with an ENV VAR if\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        the default gfortran is not found on PATH.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        For example: F18_FC=gfortran-mp-10 flang-mp-11 hello.f90 -o hello.bin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        See  https://github.com/llvm/llvm-project/blob/master/flang/docs/ReleaseNotes.md
</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> if {${subport} eq "lldb-${llvm_version}"} {
     post-patch {
         reinplace "s|@@PREFIX@@|${prefix}|" \
</pre><pre style='margin:0'>

</pre>