commit:     f2b020c57035cd3217078df35446e2a96012b53c
Author:     brahmajit das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Mon Jun 27 05:05:21 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 27 05:23:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2b020c5

x11-terms/gnome-terminal: fix missing define

https://gitlab.gnome.org/GNOME/vte/-/issues/72
Someone already tried to upstream a similar patch to gnome vte that
would fix this but was rejected by maintainer. More info can be found
on the link above.

W_EXITCODE is missing in musl thus causing gnome-terminal build to fail.
This patch checks if W_EXITCODE is not defined and then defines it.

Signed-off-by: brahmajit das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/25872
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...nome-terminal-3.44.1-fix-missing-wexitcode.patch | 21 +++++++++++++++++++++
 .../gnome-terminal/gnome-terminal-3.44.1.ebuild     |  1 +
 2 files changed, 22 insertions(+)

diff --git 
a/x11-terms/gnome-terminal/files/gnome-terminal-3.44.1-fix-missing-wexitcode.patch
 
b/x11-terms/gnome-terminal/files/gnome-terminal-3.44.1-fix-missing-wexitcode.patch
new file mode 100644
index 000000000000..aff2237db902
--- /dev/null
+++ 
b/x11-terms/gnome-terminal/files/gnome-terminal-3.44.1-fix-missing-wexitcode.patch
@@ -0,0 +1,21 @@
+https://gitlab.gnome.org/GNOME/vte/-/issues/72
+Someone already tried to upstream a similar patch to gnome vte that
+would fix this but was rejected by maintainer. More info can be found
+on the link above.
+
+W_EXITCODE is missing in musl thus causing gnome-terminal build to fail.
+This patch checks if W_EXITCODE is not defined and then defines it.
+--- a/src/terminal.cc
++++ b/src/terminal.cc
+@@ -47,6 +47,11 @@
+ GS_DEFINE_CLEANUP_FUNCTION0(TerminalOptions*, gs_local_options_free, 
terminal_options_free)
+ #define gs_free_options __attribute__ ((cleanup(gs_local_options_free)))
+ 
++/* fix for musl */
++#ifndef W_EXITCODE
++#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
++#endif
++
+ /* Wait-for-exit helper */
+ 
+ typedef struct {

diff --git a/x11-terms/gnome-terminal/gnome-terminal-3.44.1.ebuild 
b/x11-terms/gnome-terminal/gnome-terminal-3.44.1.ebuild
index ee6bad56441b..079de738bb03 100644
--- a/x11-terms/gnome-terminal/gnome-terminal-3.44.1.ebuild
+++ b/x11-terms/gnome-terminal/gnome-terminal-3.44.1.ebuild
@@ -47,6 +47,7 @@ DOC_CONTENTS="To get previous working directory inherited in 
new opened tab, or
        . /etc/profile.d/vte-2.91.sh"
 
 src_prepare() {
+       eapply "${FILESDIR}"/${P}-fix-missing-wexitcode.patch
        if ! use vanilla; then
                # https://bugzilla.gnome.org/show_bug.cgi?id=695371
                # Fedora patches:

Reply via email to