diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2024-02-02 16:18:44 +0100 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2024-02-02 16:23:34 +0100 |
commit | 42779f2ce4cc4bd17641865034e5b19ddd931c20 (patch) | |
tree | e5e0913edf8d1ec59f5f0abb955ebe1ba46fe44d /mail-client | |
parent | net-libs/nodejs: Stabilize 20.11.0 x86, #922726 (diff) | |
download | gentoo-42779f2ce4cc4bd17641865034e5b19ddd931c20.tar.gz gentoo-42779f2ce4cc4bd17641865034e5b19ddd931c20.tar.bz2 gentoo-42779f2ce4cc4bd17641865034e5b19ddd931c20.zip |
mail-client/claws-mail: backport upstream fix for gtk+ without X11
This avoids the recently introduced dependency on gtk+[X] for 4.2.0 and
live ebuild
Closes: https://bugs.gentoo.org/922657
Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
Diffstat (limited to 'mail-client')
-rw-r--r-- | mail-client/claws-mail/claws-mail-4.2.0-r2.ebuild (renamed from mail-client/claws-mail/claws-mail-4.2.0-r1.ebuild) | 4 | ||||
-rw-r--r-- | mail-client/claws-mail/claws-mail-9999.ebuild | 2 | ||||
-rw-r--r-- | mail-client/claws-mail/files/claws-mail-4.2.0-gtksocket.patch | 214 |
3 files changed, 218 insertions, 2 deletions
diff --git a/mail-client/claws-mail/claws-mail-4.2.0-r1.ebuild b/mail-client/claws-mail/claws-mail-4.2.0-r2.ebuild index 5851aa86830f..7c2196034cc0 100644 --- a/mail-client/claws-mail/claws-mail-4.2.0-r1.ebuild +++ b/mail-client/claws-mail/claws-mail-4.2.0-r2.ebuild @@ -38,7 +38,7 @@ COMMONDEPEND=" sys-libs/zlib:= x11-libs/cairo x11-libs/gdk-pixbuf:2[jpeg] - x11-libs/gtk+:3[X] + x11-libs/gtk+:3 x11-libs/libX11 x11-libs/pango archive? ( @@ -114,6 +114,8 @@ RDEPEND="${COMMONDEPEND} PATCHES=( "${FILESDIR}/${PN}-3.17.5-enchant-2_default.patch" "${FILESDIR}/${PN}-4.1.1-fix_lto.patch" + "${FILESDIR}/${P}-gtksocket.patch" + ) src_prepare() { diff --git a/mail-client/claws-mail/claws-mail-9999.ebuild b/mail-client/claws-mail/claws-mail-9999.ebuild index 4490774ed8e4..ced89451d1f2 100644 --- a/mail-client/claws-mail/claws-mail-9999.ebuild +++ b/mail-client/claws-mail/claws-mail-9999.ebuild @@ -38,7 +38,7 @@ COMMONDEPEND=" sys-libs/zlib:= x11-libs/cairo x11-libs/gdk-pixbuf:2[jpeg] - x11-libs/gtk+:3[X] + x11-libs/gtk+:3 x11-libs/libX11 x11-libs/pango archive? ( diff --git a/mail-client/claws-mail/files/claws-mail-4.2.0-gtksocket.patch b/mail-client/claws-mail/files/claws-mail-4.2.0-gtksocket.patch new file mode 100644 index 000000000000..db28228cc3a9 --- /dev/null +++ b/mail-client/claws-mail/files/claws-mail-4.2.0-gtksocket.patch @@ -0,0 +1,214 @@ +From dd4c4e5152235f9f4f319cc9fdad9227ebf688c9 Mon Sep 17 00:00:00 2001 +From: Jonathan Boeing <jonathan@claws-mail.org> +Date: Sat, 18 Nov 2023 18:51:30 -0700 +Subject: [PATCH] Fix building on non-X11 systems + +Gtk Sockets and the GDK_IS_X11_DISPLAY() macro are only available when +GDK_WINDOWING_X11 is defined +--- + src/action.c | 3 ++ + src/compose.c | 78 ++++++++++++++++++-------------- + src/plugins/dillo/dillo_viewer.c | 5 ++ + 3 files changed, 53 insertions(+), 33 deletions(-) + +diff --git a/src/action.c b/src/action.c +index d86294fbc..0c459aab6 100644 +--- a/src/action.c ++++ b/src/action.c +@@ -30,6 +30,9 @@ + #ifdef GDK_WINDOWING_X11 + # include <gdk/gdkx.h> + #endif /* GDK_WINDOWING_X11 */ ++#ifdef GDK_WINDOWING_QUARTZ ++# include <gdk/gdkquartz.h> ++#endif /* GDK_WINDOWING_QUARTZ */ + #include <stdio.h> + #include <stdlib.h> + #include <string.h> +diff --git a/src/compose.c b/src/compose.c +index 574d89be1..b32fa6bc7 100644 +--- a/src/compose.c ++++ b/src/compose.c +@@ -375,11 +375,11 @@ static void compose_set_ext_editor_sensitive (Compose *compose, + gboolean sensitive); + static gboolean compose_get_ext_editor_cmd_valid(); + static gboolean compose_get_ext_editor_uses_socket(); +-#ifndef G_OS_WIN32 ++#ifdef GDK_WINDOWING_X11 + static gboolean compose_ext_editor_plug_removed_cb + (GtkSocket *socket, + Compose *compose); +-#endif /* G_OS_WIN32 */ ++#endif /* GDK_WINDOWING_X11 */ + + static void compose_undo_state_changed (UndoMain *undostruct, + gint undo_state, +@@ -9623,11 +9623,11 @@ static gboolean compose_can_autosave(Compose *compose) + static void compose_exec_ext_editor(Compose *compose) + { + gchar *tmp; +-#ifndef G_OS_WIN32 ++#ifdef GDK_WINDOWING_X11 + GtkWidget *socket; + Window socket_wid = 0; + gchar *p, *s; +-#endif /* G_OS_WIN32 */ ++#endif /* GDK_WINDOWING_X11 */ + GPid pid; + GError *error = NULL; + gchar *cmd = NULL; +@@ -9643,39 +9643,43 @@ static void compose_exec_ext_editor(Compose *compose) + return; + } + +- if (compose_get_ext_editor_uses_socket() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) { +-#ifndef G_OS_WIN32 +- /* Only allow one socket */ +- if (compose->exteditor_socket != NULL) { +- if (gtk_widget_is_focus(compose->exteditor_socket)) { +- /* Move the focus off of the socket */ +- gtk_widget_child_focus(compose->window, GTK_DIR_TAB_BACKWARD); ++#ifdef GDK_WINDOWING_X11 ++ if (compose_get_ext_editor_uses_socket()) { ++ if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) { ++ /* Only allow one socket */ ++ if (compose->exteditor_socket != NULL) { ++ if (gtk_widget_is_focus(compose->exteditor_socket)) { ++ /* Move the focus off of the socket */ ++ gtk_widget_child_focus(compose->window, GTK_DIR_TAB_BACKWARD); ++ } ++ g_free(tmp); ++ return; + } +- g_free(tmp); +- return; +- } +- /* Create the receiving GtkSocket */ +- socket = gtk_socket_new (); +- g_signal_connect (G_OBJECT(socket), "plug-removed", +- G_CALLBACK(compose_ext_editor_plug_removed_cb), +- compose); +- gtk_box_pack_start(GTK_BOX(compose->edit_vbox), socket, TRUE, TRUE, 0); +- gtk_widget_set_size_request(socket, prefs_common.compose_width, -1); +- /* Realize the socket so that we can use its ID */ +- gtk_widget_realize(socket); +- socket_wid = gtk_socket_get_id(GTK_SOCKET (socket)); +- compose->exteditor_socket = socket; ++ /* Create the receiving GtkSocket */ ++ socket = gtk_socket_new (); ++ g_signal_connect (G_OBJECT(socket), "plug-removed", ++ G_CALLBACK(compose_ext_editor_plug_removed_cb), ++ compose); ++ gtk_box_pack_start(GTK_BOX(compose->edit_vbox), socket, TRUE, TRUE, 0); ++ gtk_widget_set_size_request(socket, prefs_common.compose_width, -1); ++ /* Realize the socket so that we can use its ID */ ++ gtk_widget_realize(socket); ++ socket_wid = gtk_socket_get_id(GTK_SOCKET (socket)); ++ compose->exteditor_socket = socket; ++ } else ++ debug_print("Socket communication with an external editor is only available on X11.\n"); ++ } + #else +- alertpanel_error(_("Socket communication with an external editor is not available on Windows.")); ++ if (compose_get_ext_editor_uses_socket()) { ++ alertpanel_error(_("Socket communication with an external editor is only available on X11.")); + g_free(tmp); + return; +-#endif /* G_OS_WIN32 */ +- } else +- debug_print("Socket communication with an external editor is only available on X11.\n"); ++ } ++#endif /* GDK_WINDOWING_X11 */ + + if (compose_get_ext_editor_cmd_valid()) { ++#ifdef GDK_WINDOWING_X11 + if (compose_get_ext_editor_uses_socket() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) { +-#ifndef G_OS_WIN32 + p = g_strdup(prefs_common_get_ext_editor_cmd()); + s = strstr(p, "%w"); + s[1] = 'u'; +@@ -9684,10 +9688,12 @@ static void compose_exec_ext_editor(Compose *compose) + else + cmd = g_strdup_printf(p, socket_wid, tmp); + g_free(p); +-#endif /* G_OS_WIN32 */ + } else { + cmd = g_strdup_printf(prefs_common_get_ext_editor_cmd(), tmp); + } ++#else ++ cmd = g_strdup_printf(prefs_common_get_ext_editor_cmd(), tmp); ++#endif /* GDK_WINDOWING_X11 */ + } else { + if (prefs_common_get_ext_editor_cmd()) + g_warning("external editor command-line is invalid: '%s'", +@@ -9776,10 +9782,12 @@ static void compose_ext_editor_closed_cb(GPid pid, gint exit_status, gpointer da + compose->exteditor_file = NULL; + compose->exteditor_pid = INVALID_PID; + compose->exteditor_tag = -1; ++#ifdef GDK_WINDOWING_X11 + if (compose->exteditor_socket && GDK_IS_X11_DISPLAY(gdk_display_get_default())) { + gtk_widget_destroy(compose->exteditor_socket); + compose->exteditor_socket = NULL; + } ++#endif /* GDK_WINDOWING_X11 */ + + } + +@@ -9887,6 +9895,7 @@ static void compose_set_ext_editor_sensitive(Compose *compose, + ext_editor_menu_entries[i], sensitive); + } + ++#ifdef GDK_WINDOWING_X11 + if (compose_get_ext_editor_uses_socket() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) { + if (sensitive) { + if (compose->exteditor_socket) +@@ -9910,6 +9919,9 @@ static void compose_set_ext_editor_sensitive(Compose *compose, + } else { + gtk_widget_set_sensitive(compose->text, sensitive); + } ++#else ++ gtk_widget_set_sensitive(compose->text, sensitive); ++#endif /* GDK_WINDOWING_X11 */ + if (compose->toolbar->send_btn) + gtk_widget_set_sensitive(compose->toolbar->send_btn, sensitive); + if (compose->toolbar->sendl_btn) +@@ -9934,14 +9946,14 @@ static gboolean compose_get_ext_editor_uses_socket() + strstr(prefs_common_get_ext_editor_cmd(), "%w")); + } + +-#ifndef G_OS_WIN32 ++#ifdef GDK_WINDOWING_X11 + static gboolean compose_ext_editor_plug_removed_cb(GtkSocket *socket, Compose *compose) + { + compose->exteditor_socket = NULL; + /* returning FALSE allows destruction of the socket */ + return FALSE; + } +-#endif /* G_OS_WIN32 */ ++#endif /* GDK_WINDOWING_X11 */ + + /** + * compose_undo_state_changed: +diff --git a/src/plugins/dillo/dillo_viewer.c b/src/plugins/dillo/dillo_viewer.c +index d2690bff6..8a93511d7 100644 +--- a/src/plugins/dillo/dillo_viewer.c ++++ b/src/plugins/dillo/dillo_viewer.c +@@ -125,10 +125,15 @@ static void dillo_show_mimepart(MimeViewer *_viewer, + g_free(viewer->filename); + } + ++#ifdef GDK_WINDOWING_X11 + if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) { + debug_print("dillo viewer only works on X11\n"); + return; + } ++#else ++ debug_print("dillo viewer only works on X11\n"); ++ return; ++#endif + + viewer->filename = procmime_get_tmp_file_name(partinfo); + +-- +2.25.1 + |