From ae8ab48a05fac9e733f6853d59e5d0ef6bf77048 Mon Sep 17 00:00:00 2001 From: David Nichols Date: Sun, 7 Jun 2026 05:35:11 +0200 Subject: [PATCH] qpid-proton: build as C++17 to fix jsoncpp link failure (#33025) jsoncpp >= 1.9.6 (MacPorts ships 1.9.7) only exports its std::string_view overloads when built as C++17, e.g. Json::Value::get(std::string_view, const Value&). qpid-proton 0.39.0 hardcodes CMAKE_CXX_STANDARD 11, so its C++ binding compiles against the removed const char* overloads and fails to link: Undefined symbols for architecture arm64: "Json::Value::get(char const*, Json::Value const&) const", referenced from: proton::parse(...) in connect_config.cpp.o Patch the bundled CMakeLists.txt to build as C++17 and bump compiler.cxx_standard to 2017 so the binding matches the jsoncpp ABI. Co-authored-by: Claude Opus 4.8 (1M context) --- net/qpid-proton/Portfile | 9 +++++++-- net/qpid-proton/files/patch-cxx17-jsoncpp.diff | 13 +++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 net/qpid-proton/files/patch-cxx17-jsoncpp.diff diff --git a/net/qpid-proton/Portfile b/net/qpid-proton/Portfile index e4bd5d70647..a84f0d1ef2c 100644 --- a/net/qpid-proton/Portfile +++ b/net/qpid-proton/Portfile @@ -8,7 +8,7 @@ PortGroup cmake 1.1 github.setup apache qpid-proton 0.39.0 # Change github.tarball_from to 'releases' or 'archive' next update github.tarball_from tarball -revision 1 +revision 2 description Qpid Proton is a high-performance, lightweight AMQP \ 1.0 messaging library. @@ -36,7 +36,7 @@ depends_lib-append port:jsoncpp \ cmake.build_type RelWithDebInfo compiler.c_standard 1999 -compiler.cxx_standard 2011 +compiler.cxx_standard 2017 # Enabling lto may break the build, avoid it by default. configure.args-append \ @@ -57,6 +57,11 @@ configure.args-append \ # https://github.com/apache/qpid-proton/commit/6f2fdeb633575114c5f92f1387a21eba992b422a patchfiles-append patch-fix-macOS-build.diff +# Build as C++17: jsoncpp (>= 1.9.6) only exports its std::string_view ABI when +# built as C++17, but qpid-proton 0.39.0 hardcodes C++11, which references the +# removed const char* Json::Value::get() overloads and fails to link. +patchfiles-append patch-cxx17-jsoncpp.diff + test.cmd ${filespath}/runtests.sh test.run yes diff --git a/net/qpid-proton/files/patch-cxx17-jsoncpp.diff b/net/qpid-proton/files/patch-cxx17-jsoncpp.diff new file mode 100644 index 00000000000..9d4ac0e0c2f --- /dev/null +++ b/net/qpid-proton/files/patch-cxx17-jsoncpp.diff @@ -0,0 +1,13 @@ +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -76,7 +76,9 @@ + enable_language(CXX) + + # This effectively checks for cmake version 3.1 or later +- set(CMAKE_CXX_STANDARD 11) ++ # jsoncpp (>= 1.9.6) exposes a std::string_view ABI under C++17; building the ++ # C++ binding as C++11 references removed const char* overloads -> link errors. ++ set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_EXTENSIONS OFF) + endif() +