commit:     1fd831828b26a92051ae4a7a74e9ffe3ec058987
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 30 15:03:44 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 15:43:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fd83182

media-gfx/ueberzugpp: fix build w/ libc++ if USE=X or USE=wayland

Two different issues with libc++ (clang18+libstdc++ is fine),
USE=wayland is missing an header, and USE=X fails due to incomplete
C++20 support (std::jthread) in libc++.

Fortunately for the latter, the support does exist and is merely
locked behind -fexperimental-library (unsure if the implementation
works right but it seems ok at a glance).

Closes: https://bugs.gentoo.org/930977
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-gfx/ueberzugpp/files/ueberzugpp-2.9.4-libcxx18.patch | 11 +++++++++++
 media-gfx/ueberzugpp/ueberzugpp-2.9.4.ebuild               | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/media-gfx/ueberzugpp/files/ueberzugpp-2.9.4-libcxx18.patch 
b/media-gfx/ueberzugpp/files/ueberzugpp-2.9.4-libcxx18.patch
new file mode 100644
index 000000000000..ccd808e5b5f1
--- /dev/null
+++ b/media-gfx/ueberzugpp/files/ueberzugpp-2.9.4-libcxx18.patch
@@ -0,0 +1,11 @@
+https://bugs.gentoo.org/930977
+https://github.com/jstkdng/ueberzugpp/issues/179
+--- a/src/canvas/wayland/config/dummy.hpp
++++ b/src/canvas/wayland/config/dummy.hpp
+@@ -20,4 +20,6 @@
+ #include "../config.hpp"
+ 
++#include <string>
++
+ class DummyWaylandConfig : public WaylandConfig
+ {

diff --git a/media-gfx/ueberzugpp/ueberzugpp-2.9.4.ebuild 
b/media-gfx/ueberzugpp/ueberzugpp-2.9.4.ebuild
index d37875aaaff8..44c32b0c573f 100644
--- a/media-gfx/ueberzugpp/ueberzugpp-2.9.4.ebuild
+++ b/media-gfx/ueberzugpp/ueberzugpp-2.9.4.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit cmake
+inherit cmake flag-o-matic toolchain-funcs
 
 DESCRIPTION="Drop in replacement for ueberzug written in C++"
 HOMEPAGE="https://github.com/jstkdng/ueberzugpp/";
@@ -53,7 +53,18 @@ BDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}"/${P}-libcxx18.patch
+)
+
 src_configure() {
+       if use X && tc-is-clang && has_version sys-libs/libcxx; then
+               # X support makes use of C++20's std::jthread which is currently
+               # marked experimental (at least) in <=libcxx-18 (should limit
+               # version in above libcxx check whenever this becomes 
unnecessary)
+               append-cxxflags $(test-flags-CXX -fexperimental-library)
+       fi
+
        # TODO?: wayfire plugin is skipped for now (needs wlroots which is
        # likely to be messier), but could be handled if there is a demand
 

Reply via email to