<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/2660da8a43f082d84992455accbdd98352991216">https://github.com/macports/macports-ports/commit/2660da8a43f082d84992455accbdd98352991216</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 2660da8a43f082d84992455accbdd98352991216
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Thu Jun 1 13:44:58 2023 -0400
<span style='display:block; white-space:pre;color:#404040;'> protobuf3-cpp: build with cmake; compatibility ver change requires dep rebuilds
</span><span style='display:block; white-space:pre;color:#404040;'> - Provides cmake build files for dependents, among other benefits
</span>---
devel/protobuf3-cpp/Portfile | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/protobuf3-cpp/Portfile b/devel/protobuf3-cpp/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 78a86d4829a..06775c0fa8e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/protobuf3-cpp/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/protobuf3-cpp/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3,6 +3,7 @@
</span> PortSystem 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup github 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup cmake 1.1
</span>
# NOTE: For any version number change, also
# NOTE: Update py-protobuf3 version's number to match
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -15,7 +16,7 @@ name protobuf3-cpp
</span> github.setup protocolbuffers protobuf 3.${release_version} v
git.branch v${release_version}
# remove stealth update code below with next update
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 2
</span>
# remove stealth update code with next update
dist_subdir ${name}/${version}_1
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -53,25 +54,40 @@ github.tarball_from releases
</span> distname protobuf-cpp-${version}
worksrcdir protobuf-${version}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Upstream adds zlib include - which is ${prefix}/include - before search path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# of 3rd-party components, like gtest, gmock, etc. That causes the external
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# versions of those to be pulled in, and the build fails.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# So don't let the project cmake add zlib; already added (last) by base.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append cmake-zlib-include.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> compiler.cxx_standard 2011
compiler.thread_local_storage yes
# error: constexpr constructor never produces a constant expression [-Winvalid-constexpr]
compiler.blacklist {clang < 900}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# bundled libtool version doesn't recognise -stdlib
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-use_autoreconf yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if { [string match *clang* ${configure.compiler}] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Quiet deprecation warnings
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxxflags-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-deprecated-declarations \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-error=unknown-warning-option \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-unknown-warning-option
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# see https://trac.macports.org/wiki/UsingTheRightCompiler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.env-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CC_FOR_BUILD=${configure.cc} \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CXX_FOR_BUILD=${configure.cxx}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Clear optflags; controlled by project, via cmake build type
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.optflags
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.cflags-append -g
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.cppflags-append -g
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {[variant_isset debug]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake.build_type Debug
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmake.build_type RelWithDebInfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
depends_lib-append \
port:zlib
<span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DBUILD_SHARED_LIBS:BOOL=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> post-destroot {
set docdir ${destroot}${prefix}/share/doc/${name}
</pre><pre style='margin:0'>
</pre>