commit:     694c3954f69c851f50aabf227597c6bd7fbeee25
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Thu Sep  5 09:29:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep  5 16:55:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=694c3954

net-misc/mosh: set -std=gnu++17 for newer abseil-cpp

Setting the C++ standard via append-cxxflags ignores the configure.ac logic that
already does that for the same reasons and leads to duplicate flats. To rectify
that, change the targeted standard in configure.ac itself.

Closes: https://bugs.gentoo.org/935130
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/mosh/mosh-1.4.0.ebuild | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/net-misc/mosh/mosh-1.4.0.ebuild b/net-misc/mosh/mosh-1.4.0.ebuild
index 8792d6668383..02cffd896095 100644
--- a/net-misc/mosh/mosh-1.4.0.ebuild
+++ b/net-misc/mosh/mosh-1.4.0.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit autotools bash-completion-r1 flag-o-matic
+inherit autotools bash-completion-r1
 
 MY_P=${PN}-${PV/_rc/rc}
 DESCRIPTION="Mobile shell that supports roaming and intelligent local echo"
@@ -51,15 +51,20 @@ PATCHES=(
 src_prepare() {
        default
 
+       # abseil-cpp needs >=c++14
+       local CXXSTD="14"
+       if has_version ">=dev-cpp/abseil-cpp-20240722.0"; then
+               # needs >=c++17
+               CXXSTD="17"
+       fi
+       sed -e "/AX_CXX_COMPILE_STDCXX/{s/11/${CXXSTD}/}" -i configure.ac || die
+
        eautoreconf
 }
 
 src_configure() {
        MAKEOPTS+=" V=1"
 
-       # protobuf needs >=c++14
-       append-cxxflags -std=gnu++14
-
        local myeconfargs=(
                # We install it ourselves in src_install
                --disable-completion

Reply via email to