<pre style='margin:0'>
Herby Gillot (herbygillot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/7b766832f7990e537eb2fffea23c97ebab6408d7">https://github.com/macports/macports-ports/commit/7b766832f7990e537eb2fffea23c97ebab6408d7</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 7b766832f7990e537eb2fffea23c97ebab6408d7
</span>Author: barracuda156 <vital.had@gmail.com>
AuthorDate: Fri May 26 23:27:33 2023 +0800
<span style='display:block; white-space:pre;color:#404040;'> elmerfem: ensure needed fortran flag is used for all clang-based systems
</span>---
science/elmerfem/Portfile | 9 +++++++++
science/elmerfem/files/patch-fix-gfortran-with-clang.diff | 15 +++++++++++++++
2 files changed, 24 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/science/elmerfem/Portfile b/science/elmerfem/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 9508a1c640b..3a4e42b1e12 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/science/elmerfem/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/science/elmerfem/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -37,6 +37,15 @@ compiler.blacklist-append \
</span> patchfiles-append patch-use-right-compiler.diff \
patch-ElmerGUI.diff
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.platform} eq "darwin" && ${os.major} > 9} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # CMakeLists check for a version of CXX compiler, assuming a coherent build with GCC.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # However since Macports uses Clangs on x86, the check does not do what was intended.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Just remove it for all systems with a default GCC > 9, i.e. everything but 10.4 and 10.5,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # so that the needed Fortran flag is actually used.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-fix-gfortran-with-clang.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> post-patch {
reinplace "s,@CC@,${configure.cc}," ${worksrcpath}/CMakeLists.txt
reinplace "s,@CXX@,${configure.cxx}," ${worksrcpath}/CMakeLists.txt
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/science/elmerfem/files/patch-fix-gfortran-with-clang.diff b/science/elmerfem/files/patch-fix-gfortran-with-clang.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..e06f13dc5dd
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/science/elmerfem/files/patch-fix-gfortran-with-clang.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,15 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- CMakeLists.txt.orig 2023-05-23 22:13:38.000000000 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ CMakeLists.txt 2023-05-26 23:11:35.000000000 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -240,10 +240,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Get rid of the annoying rank mismatch warning
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>