commit:     c44771d1fa957cd2f04b42d79f900205575f0faa
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 22 00:46:05 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 22 00:46:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c44771d1

x11-libs/vte: fix musl build

Closes: https://bugs.gentoo.org/835489
Closes: https://bugs.gentoo.org/554416
Thanks-to: Jory A. Pratt <anarchy <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../vte/files/vte-0.66.2-musl-W_EXITCODE.patch     | 29 ++++++++++++++++++++++
 x11-libs/vte/vte-0.66.2.ebuild                     |  2 ++
 x11-libs/vte/vte-0.68.0.ebuild                     |  2 ++
 3 files changed, 33 insertions(+)

diff --git a/x11-libs/vte/files/vte-0.66.2-musl-W_EXITCODE.patch 
b/x11-libs/vte/files/vte-0.66.2-musl-W_EXITCODE.patch
new file mode 100644
index 000000000000..b629613feaf6
--- /dev/null
+++ b/x11-libs/vte/files/vte-0.66.2-musl-W_EXITCODE.patch
@@ -0,0 +1,29 @@
+https://gitlab.gnome.org/GNOME/vte/-/issues/72
+https://bugs.gentoo.org/835489
+https://bugs.gentoo/org/554416
+
+From 1c1de9e9119cf1e0ef45a594ca9bbf306d2209cb Mon Sep 17 00:00:00 2001
+From:
+Date: Fri, 12 Mar 2021 08:41:13 -0600
+Subject: [PATCH] Expanded non-standard W_EXITCODE macro for Musl compatibility
+
+--- a/src/widget.cc
++++ b/src/widget.cc
+@@ -20,8 +20,6 @@
+ 
+ #include "widget.hh"
+ 
+-#include <sys/wait.h> // for W_EXITCODE
+-
+ #include <exception>
+ #include <new>
+ #include <string>
+@@ -235,7 +233,7 @@ void
+ Widget::dispose() noexcept
+ {
+         if (m_terminal->terminate_child()) {
+-                int status = W_EXITCODE(0, SIGKILL);
++                int status = (0) << 8 | (SIGKILL); // W_EXITCODE(ret, sig)
+                 emit_child_exited(status);
+         }
+ }

diff --git a/x11-libs/vte/vte-0.66.2.ebuild b/x11-libs/vte/vte-0.66.2.ebuild
index 2fdbc105f8d7..9de97c89a24b 100644
--- a/x11-libs/vte/vte-0.66.2.ebuild
+++ b/x11-libs/vte/vte-0.66.2.ebuild
@@ -53,6 +53,8 @@ PATCHES=(
 )
 
 src_prepare() {
+       use elibc_musl && eapply 
"${FILESDIR}"/${PN}-0.66.2-musl-W_EXITCODE.patch
+
        if ! use vanilla; then
                # Part of 
https://src.fedoraproject.org/rpms/vte291/raw/f31/f/vte291-cntnr-precmd-preexec-scroll.patch
                # Adds OSC 777 support for desktop notifications in 
gnome-terminal or elsewhere

diff --git a/x11-libs/vte/vte-0.68.0.ebuild b/x11-libs/vte/vte-0.68.0.ebuild
index 161fb49fb97e..36caed902924 100644
--- a/x11-libs/vte/vte-0.68.0.ebuild
+++ b/x11-libs/vte/vte-0.68.0.ebuild
@@ -56,6 +56,8 @@ src_prepare() {
        use vala && vala_setup
        xdg_environment_reset
 
+       use elibc_musl && eapply 
"${FILESDIR}"/${PN}-0.66.2-musl-W_EXITCODE.patch
+
        if ! use vanilla; then
                # Part of 
https://src.fedoraproject.org/rpms/vte291/raw/f31/f/vte291-cntnr-precmd-preexec-scroll.patch
                # Adds OSC 777 support for desktop notifications in 
gnome-terminal or elsewhere

Reply via email to