Sync from SUSE:SLFO:Main gtk2 revision c76a8a1c25f875035ee796f6101cc38d

This commit is contained in:
Adrian Schröter 2024-05-03 13:25:40 +02:00
commit 320d60fd8c
18 changed files with 7005 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

32
README.SUSE Normal file
View File

@ -0,0 +1,32 @@
README for bi-architecture 64 bit platforms users
=================================================
Current version of GTK+ has a problem running 32 and 64 version on
single machine. See http://bugzilla.gnome.org/show_bug.cgi?id=129540 and
http://bugzilla.gnome.org/show_bug.cgi?id=153848 for more information.
To work around this problem, 64 bit version for SUSE Linux uses special
names for following files:
/usr/bin/gtk-query-immodules-2.0: /usr/bin/gtk-query-immodules-2.0-64
/etc/gtk-2.0/gtk.immodules: /usr/gtk-2.0/gtk.immodules64
And following variable:
$GTK_PATH: $GTK_PATH64
This can cause problems during self-compilation of packages.
To work-around these problems (introduced by this work-around), you
should:
Either:
- Make a patch of package (please do not send it to package
developers, it's temporary solution).
Or:
- Install 32 bit version of GTK+.
These problems should be correctly solved in GTK+ sometimes in future.

19
_service Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<services>
<service mode="disabled" name="tar_scm">
<param name="url">https://gitlab.gnome.org/GNOME/gtk.git</param>
<param name="scm">git</param>
<param name="revision">gtk-2-24</param>
<param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param>
<param name="versionrewrite-pattern">(.*)\+0</param>
<param name="versionrewrite-replacement">\1</param>
<!--
<param name="changesgenerate">enable</param>
-->
</service>
<service mode="disabled" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="disabled" name="set_version" />
</services>

106
baselibs.conf Normal file
View File

@ -0,0 +1,106 @@
gtk2-devel
requires -gtk2-<targettype>
requires "libgtk-2_0-0-<targettype> = <version>"
gtk2-tools
+/usr/bin/gtk-query-immodules-2.0(-64)?
post "%if "%_lib" == "lib64""
post "if [ $1 = 1 ]; then test -d <prefix>%{_libdir}/gtk-2.0/2.10.0; if test $? -eq 0; then <prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache; fi; fi"
post "%else"
post "if [ $1 = 1 ]; then test -d <prefix>%{_libdir}/gtk-2.0/2.10.0; if test $? -eq 0; then <prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache; fi; fi"
post "%endif"
libgtk-2_0-0
requires "gtk2-tools-<targettype>"
provides "gtk2-<targettype> = <version>"
obsoletes "gtk2-<targettype> < <version>"
obsoletes "gail-<targettype> <= 1.22.1"
post "%if "%_lib" == "lib64""
post "if test -f <prefix>%{_bindir}/gtk-query-immodules-2.0-64; then <prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache; fi"
post "%else"
post "if test -f <prefix>%{_bindir}/gtk-query-immodules-2.0; then <prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache; fi"
post "%endif"
gtk2-immodule-amharic
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"
gtk2-immodule-inuktitut
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"
gtk2-immodule-multipress
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"
gtk2-immodule-thai
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"
gtk2-immodule-tigrigna
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"
provides "gtk2-immodules-tigrigna-<targettype> = <version>"
obsoletes "gtk2-immodules-tigrigna-<targettype> = <version>"
gtk2-immodule-vietnamese
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"
gtk2-immodule-xim
requires "gtk2-<targettype>"
post "%if "%_lib" == "lib64""
post "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
post "%else"
post "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
post "%endif"
postun "%if "%_lib" == "lib64""
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0-64 --update-cache"
postun "%else"
postun "<prefix>%{_bindir}/gtk-query-immodules-2.0 --update-cache"
postun "%endif"

View File

@ -0,0 +1,48 @@
Index: gtk+-2.19.0/gtk/gtkfontbutton.c
===================================================================
--- gtk+-2.19.0.orig/gtk/gtkfontbutton.c
+++ gtk+-2.19.0/gtk/gtkfontbutton.c
@@ -893,7 +893,7 @@ gtk_font_button_update_font_info (GtkFon
if (style == NULL || !g_ascii_strcasecmp (style, "Regular"))
family_style = g_strdup (family);
else
- family_style = g_strdup_printf ("%s %s", family, style);
+ family_style = g_strdup_printf ("%s %s", family, _(style));
gtk_label_set_text (GTK_LABEL (font_button->priv->font_label), family_style);
Index: gtk+-2.19.0/gtk/gtkfontsel.c
===================================================================
--- gtk+-2.19.0.orig/gtk/gtkfontsel.c
+++ gtk+-2.19.0/gtk/gtkfontsel.c
@@ -76,6 +76,21 @@
#define DEFAULT_FONT_NAME "Sans 10"
+/* These are the commonly used font styles, listed here only for
+ translations. */
+#define FONT_STYLE_ULTRA_LIGHT N_("Ultra-Light")
+#define FONT_STYLE_LIGHT N_("Light")
+#define FONT_STYLE_MEDIUM N_("Medium")
+#define FONT_STYLE_NORMAL N_("Normal")
+#define FONT_STYLE_REGULAR N_("Regular")
+#define FONT_STYLE_ITALIC N_("Italic")
+#define FONT_STYLE_OBLIQUE N_("Oblique")
+#define FONT_STYLE_SEMI_BOLD N_("Semi-Bold")
+#define FONT_STYLE_BOLD N_("Bold")
+#define FONT_STYLE_ULTRA_BOLD N_("Ultra-Bold")
+#define FONT_STYLE_HEAVY N_("Heavy")
+#define FONT_STYLE_BOLD_ITALIC N_("Bold Italic")
+
/* This is the initial and maximum height of the preview entry (it expands
when large font sizes are selected). Initial height is also the minimum. */
#define INITIAL_PREVIEW_HEIGHT 44
@@ -869,7 +884,7 @@ gtk_font_selection_show_available_styles
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
FACE_COLUMN, faces[i],
- FACE_NAME_COLUMN, str,
+ FACE_NAME_COLUMN, _(str),
-1);
if (i == 0)

BIN
gtk-2.24.33.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

78
gtk-path-local.patch Normal file
View File

@ -0,0 +1,78 @@
https://bugzilla.novell.com/show_bug.cgi?id=369696
This patch adds support for /usr/local without setting of GTK_PATH.
/usr/local path preference is a behavior expected by FHS.
This patch cannot be upstreamed as is:
- It needs to be platform dependent.
- It needs to solve situation, when prefix != /usr (and maybe add /usr
to the search path, but after the default_dir).
- There is no consensus for /usr/local/lib x /usr/local/lib64 yet.
Defaulting to /usr/local/lib64 may need /usr/local/share/config.site
file (bnc#382344).
Note that the patch it does not provide solution for bi-arch path clash:
http://bugzilla.gnome.org/show_bug.cgi?id=153848
Index: gtk/gtkmodules.c
===================================================================
--- gtk/gtkmodules.c.orig
+++ gtk/gtkmodules.c
@@ -60,6 +60,7 @@ get_module_path (void)
gchar *home_gtk_dir = NULL;
gchar *module_path;
gchar *default_dir;
+ gchar *local_dir;
static gchar **result = NULL;
if (result)
@@ -73,25 +74,32 @@ get_module_path (void)
exe_prefix = g_getenv ("GTK_EXE_PREFIX");
if (exe_prefix)
+ {
default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", NULL);
+ local_dir = g_build_filename ("/usr/local", "lib", "gtk-2.0", NULL);
+ }
else
+ {
default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL);
+ local_dir = g_build_filename ("/usr/local", LIB, "gtk-2.0", NULL);
+ }
if (module_path_env && home_gtk_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
- module_path_env, home_gtk_dir, default_dir, NULL);
+ module_path_env, home_gtk_dir, local_dir, default_dir, NULL);
else if (module_path_env)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
- module_path_env, default_dir, NULL);
+ module_path_env, local_dir, default_dir, NULL);
else if (home_gtk_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
- home_gtk_dir, default_dir, NULL);
+ home_gtk_dir, local_dir, default_dir, NULL);
else
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
- default_dir, NULL);
+ local_dir, default_dir, NULL);
g_free (home_gtk_dir);
g_free (default_dir);
+ g_free (local_dir);
result = pango_split_file_list (module_path);
g_free (module_path);
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -1340,7 +1340,8 @@ AC_SUBST(GDK_EXTRA_LIBS)
AC_SUBST(GDK_EXTRA_CFLAGS)
AC_SUBST(GDK_DEP_LIBS)
AC_SUBST(GDK_DEP_CFLAGS)
-
+LIB=`echo $libdir | sed 's:.*/::'`
+AC_DEFINE_UNQUOTED([LIB],["$LIB"],[Platform dependent tail of libdir.])
########################################
# Check for Accessibility Toolkit flags

13
gtk2-GTK_PATH64.patch Normal file
View File

@ -0,0 +1,13 @@
Index: gtk+-2.22.1/gtk/gtkmodules.c
===================================================================
--- gtk+-2.22.1.orig/gtk/gtkmodules.c
+++ gtk+-2.22.1/gtk/gtkmodules.c
@@ -68,7 +68,7 @@ get_module_path (void)
if (home_dir)
home_gtk_dir = g_build_filename (home_dir, ".gtk-2.0", NULL);
- module_path_env = g_getenv ("GTK_PATH");
+ module_path_env = g_getenv ("GTK_PATH64");
exe_prefix = g_getenv ("GTK_EXE_PREFIX");
if (exe_prefix)

View File

@ -0,0 +1,84 @@
From fb01c5ea4c5b9f0c2b0d2b2d9c926cf1caea27c0 Mon Sep 17 00:00:00 2001
From: Damien Leone <dleone@nvidia.nvidia.com>
Date: Mon, 12 Sep 2011 09:53:00 -0700
Subject: [PATCH] Bug 625202 - 30-bit drawables remain black
This patch adds support for 10-10-10 bitmask BGR conversion at
depths 30 and 32 by preventing gdk_rgb_select_conv() from failing
back to the gdk_rgb_convert_32_generic() conversion function.
Since GdkImage codes R, G and B channels in a char, we replicate
the two most significant bits to the two least significant ones
such that all 10 bits are used (i.e. all bits are set to 1 for
white color).
---
gdk/gdkrgb.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c
index 6e32bab..93ef6ab 100644
--- a/gdk/gdkrgb.c
+++ b/gdk/gdkrgb.c
@@ -2242,6 +2242,48 @@ gdk_rgb_convert_8880_br (GdkRgbInfo *image_info, GdkImage *image,
}
}
+static void
+gdk_rgb_convert_0AAA_br (GdkRgbInfo *image_info, GdkImage *image,
+ gint x0, gint y0, gint width, gint height,
+ const guchar *buf, int rowstride,
+ gint x_align, gint y_align, GdkRgbCmap *cmap)
+{
+ int y, w;
+ guchar *obuf, *p;
+ gint bpl;
+ const guchar *bptr, *bp2;
+ guchar r, g, b;
+
+ bptr = buf;
+ bpl = image->bpl;
+ obuf = ((guchar *)image->mem) + y0 * bpl + x0 * 4;
+
+ for (y = 0; y < height; y++)
+ {
+ bp2 = bptr;
+ p = obuf;
+ w = width;
+ while (w--)
+ {
+ r = *bp2++;
+ g = *bp2++;
+ b = *bp2++;
+
+ /* Since the R, G and B channels are coded in a char, we
+ * replicate the two most significant bits to the two least
+ * significant ones. */
+ *((guint32*)p) = 0x3 << 30 |
+ b << 22 | (b >> 6) << 20 |
+ g << 12 | (g >> 6) << 10 |
+ r << 2 | (r >> 6);
+
+ p += 4;
+ }
+ bptr += rowstride;
+ obuf += bpl;
+ }
+}
+
/* Generic truecolor/directcolor conversion function. Slow, but these
are oddball modes. */
static void
@@ -3195,6 +3237,11 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info)
#endif
}
#endif
+ else if (bpp == 32 && (depth == 30 || depth == 32) &&
+ vtype == GDK_VISUAL_TRUE_COLOR &&
+ (red_mask == 0x3ff && green_mask == 0xffc00 &&
+ blue_mask == 0x3ff00000 && byte_order == GDK_LSB_FIRST))
+ conv = gdk_rgb_convert_0AAA_br;
else if (vtype == GDK_VISUAL_TRUE_COLOR && byte_order == GDK_LSB_FIRST)
{
conv = gdk_rgb_convert_truecolor_lsb;
--
1.7.5.4

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,267 @@
Index: gtk+-2.16.0/gtk/gtkfontsel.c
===================================================================
--- gtk+-2.16.0.orig/gtk/gtkfontsel.c
+++ gtk+-2.16.0/gtk/gtkfontsel.c
@@ -588,11 +588,24 @@ static void
gtk_font_selection_finalize (GObject *object)
{
GtkFontSelection *fontsel;
+ guint selection_timeout;
g_return_if_fail (GTK_IS_FONT_SELECTION (object));
fontsel = GTK_FONT_SELECTION (object);
+ selection_timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "font-selection-timeout"));
+ if (selection_timeout)
+ g_source_remove (selection_timeout);
+
+ selection_timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "style-selection-timeout"));
+ if (selection_timeout)
+ g_source_remove (selection_timeout);
+
+ selection_timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "size-selection-timeout"));
+ if (selection_timeout)
+ g_source_remove (selection_timeout);
+
if (fontsel->font)
gdk_font_unref (fontsel->font);
@@ -631,6 +644,9 @@ gtk_font_selection_reload_fonts (GtkFont
PangoFontDescription *desc;
desc = gtk_font_selection_get_font_description (fontsel);
+ /* Disable selection timeout */
+ g_object_set_data (G_OBJECT (fontsel), "immediate-selection", GUINT_TO_POINTER (1));
+
gtk_font_selection_show_available_fonts (fontsel);
gtk_font_selection_show_available_sizes (fontsel, TRUE);
gtk_font_selection_show_available_styles (fontsel);
@@ -638,6 +654,9 @@ gtk_font_selection_reload_fonts (GtkFont
gtk_font_selection_select_font_desc (fontsel, desc, NULL, NULL);
gtk_font_selection_scroll_to_selection (fontsel);
+ /* Enable selection timeout */
+ g_object_set_data (G_OBJECT (fontsel), "immediate-selection", GUINT_TO_POINTER (0));
+
pango_font_description_free (desc);
}
}
@@ -714,10 +733,10 @@ gtk_font_selection_scroll_on_map (GtkWid
}
/* This is called when a family is selected in the list. */
-static void
-gtk_font_selection_select_font (GtkTreeSelection *selection,
- gpointer data)
+static gboolean
+gtk_font_selection_real_select_font (gpointer data)
{
+ GtkTreeSelection *selection;
GtkFontSelection *fontsel;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -725,7 +744,11 @@ gtk_font_selection_select_font (GtkTreeS
const gchar *family_name;
#endif
+ if (!g_object_get_data (G_OBJECT (data), "immediate-selection"))
+ GDK_THREADS_ENTER ();
+
fontsel = GTK_FONT_SELECTION (data);
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (fontsel->family_list));
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
@@ -747,6 +770,40 @@ gtk_font_selection_select_font (GtkTreeS
g_object_unref (family);
}
+
+ g_object_set_data (G_OBJECT (fontsel), "font-selection-timeout", GUINT_TO_POINTER (0));
+
+ if (!g_object_get_data (G_OBJECT (fontsel), "immediate-selection"))
+ GDK_THREADS_LEAVE ();
+
+ /* Remove ourselves */
+ return FALSE;
+}
+
+static void
+gtk_font_selection_select_font (GtkTreeSelection *selection,
+ gpointer data)
+{
+ GtkFontSelection *fontsel;
+ guint selection_timeout = 0;
+ guint immediate_selection = 0;
+
+ fontsel = GTK_FONT_SELECTION (data);
+ selection_timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "font-selection-timeout"));
+ immediate_selection = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "immediate-selection"));
+
+ if (selection_timeout)
+ g_source_remove (selection_timeout);
+
+ if (immediate_selection)
+ {
+ gtk_font_selection_real_select_font (data);
+ }
+ else
+ {
+ selection_timeout = g_timeout_add (200, gtk_font_selection_real_select_font, data);
+ g_object_set_data (G_OBJECT (fontsel), "font-selection-timeout", GUINT_TO_POINTER (selection_timeout));
+ }
}
static int
@@ -949,14 +1006,20 @@ gtk_font_selection_select_best_style (Gt
/* This is called when a style is selected in the list. */
-static void
-gtk_font_selection_select_style (GtkTreeSelection *selection,
- gpointer data)
+static gboolean
+gtk_font_selection_real_select_style (gpointer data)
{
- GtkFontSelection *fontsel = GTK_FONT_SELECTION (data);
+ GtkTreeSelection *selection;
+ GtkFontSelection *fontsel;
GtkTreeModel *model;
GtkTreeIter iter;
+ if (!g_object_get_data (G_OBJECT (data), "immediate-selection"))
+ GDK_THREADS_ENTER ();
+
+ fontsel = GTK_FONT_SELECTION (data);
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (fontsel->face_list));
+
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
PangoFontFace *face;
@@ -968,6 +1031,40 @@ gtk_font_selection_select_style (GtkTree
gtk_font_selection_show_available_sizes (fontsel, FALSE);
gtk_font_selection_select_best_size (fontsel);
+
+ g_object_set_data (G_OBJECT (fontsel), "style-selection-timeout", GUINT_TO_POINTER (0));
+
+ if (!g_object_get_data (G_OBJECT (fontsel), "immediate-selection"))
+ GDK_THREADS_LEAVE ();
+
+ /* Remove ourselves */
+ return FALSE;
+}
+
+static void
+gtk_font_selection_select_style (GtkTreeSelection *selection,
+ gpointer data)
+{
+ GtkFontSelection *fontsel;
+ guint selection_timeout = 0;
+ guint immediate_selection = 0;
+
+ fontsel = GTK_FONT_SELECTION (data);
+ selection_timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "style-selection-timeout"));
+ immediate_selection = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "immediate-selection"));
+
+ if (selection_timeout)
+ g_source_remove (selection_timeout);
+
+ if (immediate_selection)
+ {
+ gtk_font_selection_real_select_style (data);
+ }
+ else
+ {
+ selection_timeout = g_timeout_add (200, gtk_font_selection_real_select_style, data);
+ g_object_set_data (G_OBJECT (fontsel), "style-selection-timeout", GUINT_TO_POINTER (selection_timeout));
+ }
}
static void
@@ -1100,22 +1197,60 @@ gtk_font_selection_size_focus_out (GtkWi
}
/* This is called when a size is selected in the list. */
-static void
-gtk_font_selection_select_size (GtkTreeSelection *selection,
- gpointer data)
+static gboolean
+gtk_font_selection_real_select_size (gpointer data)
{
+ GtkTreeSelection *selection;
GtkFontSelection *fontsel;
GtkTreeModel *model;
GtkTreeIter iter;
gint new_size;
+ if (!g_object_get_data (G_OBJECT (data), "immediate-selection"))
+ GDK_THREADS_ENTER ();
+
fontsel = GTK_FONT_SELECTION (data);
-
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (fontsel->size_list));
+
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gtk_tree_model_get (model, &iter, SIZE_COLUMN, &new_size, -1);
gtk_font_selection_set_size (fontsel, new_size * PANGO_SCALE);
}
+
+ g_object_set_data (G_OBJECT (fontsel), "size-selection-timeout", GUINT_TO_POINTER (0));
+
+ if (!g_object_get_data (G_OBJECT (fontsel), "immediate-selection"))
+ GDK_THREADS_LEAVE ();
+
+ /* Remove ourselves */
+ return FALSE;
+}
+
+static void
+gtk_font_selection_select_size (GtkTreeSelection *selection,
+ gpointer data)
+{
+ GtkFontSelection *fontsel;
+ guint selection_timeout = 0;
+ guint immediate_selection = 0;
+
+ fontsel = GTK_FONT_SELECTION (data);
+ selection_timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "size-selection-timeout"));
+ immediate_selection = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (fontsel), "immediate-selection"));
+
+ if (selection_timeout)
+ g_source_remove (selection_timeout);
+
+ if (immediate_selection)
+ {
+ gtk_font_selection_real_select_size (data);
+ }
+ else
+ {
+ selection_timeout = g_timeout_add (200, gtk_font_selection_real_select_size, data);
+ g_object_set_data (G_OBJECT (fontsel), "size-selection-timeout", GUINT_TO_POINTER (selection_timeout));
+ }
}
static void
@@ -1449,6 +1584,9 @@ gtk_font_selection_select_font_desc (Gtk
if (!new_family)
return FALSE;
+ /* Disable selection timeout */
+ g_object_set_data (G_OBJECT (fontsel), "immediate-selection", GUINT_TO_POINTER (1));
+
if (pfamily)
*pfamily = new_family;
else
@@ -1499,6 +1637,9 @@ gtk_font_selection_select_font_desc (Gtk
gtk_font_selection_set_size (fontsel, pango_font_description_get_size (new_desc));
+ /* Enable selection timeout */
+ g_object_set_data (G_OBJECT (fontsel), "immediate-selection", GUINT_TO_POINTER (0));
+
return TRUE;
}

View File

@ -0,0 +1,24 @@
From bd9ed0462cbfb84b7c273c50f7ccb916ef6ff108 Mon Sep 17 00:00:00 2001
From: Chenthill Palanisamy <pchenthill@novell.com>
Date: Tue, 5 Nov 2013 13:30:33 +0100
Subject: [PATCH] Do not reset the waiting_for_printer on status change
* gtk/gtkprintunixdialog.c (printer_status_cb): Do not reset the
waiting_for_printer on status change as the default printer might
get added later.
https://bugzilla.gnome.org/show_bug.cgi?id=577642
diff -ur gtk+-2.24.22.orig/gtk/gtkprintunixdialog.c gtk+-2.24.22/gtk/gtkprintunixdialog.c
--- gtk+-2.24.22.orig/gtk/gtkprintunixdialog.c 2014-02-07 14:05:41.432196666 -0600
+++ gtk+-2.24.22/gtk/gtkprintunixdialog.c 2014-02-07 14:06:08.037864049 -0600
@@ -800,7 +800,9 @@
/* When the pause state change then we need to update sensitive property
* of GTK_RESPONSE_OK button inside of selected_printer_changed function. */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview));
+ priv->internal_printer_change = TRUE;
selected_printer_changed (selection, dialog);
+ priv->internal_printer_change = FALSE;
if (gtk_print_backend_printer_list_is_done (backend) &&
gtk_printer_is_default (printer) &&

5
gtk2-rpmlintrc Normal file
View File

@ -0,0 +1,5 @@
# Legacy package, gtk2 internally is the only consumer of libgail
addFilter("shlib-policy-name-error SONAME: libgailutil.so.18");
# rpmlint error, the library shares so-version info and is allowed in the main package
addFilter("shlib-policy-name-error SONAME: libg[dt]k-x11-2.0.so.0");

View File

@ -0,0 +1,97 @@
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -37,6 +37,7 @@
#include <utime.h>
#endif
+#include <dirent.h>
#include <glib.h>
#include <glib/gstdio.h>
#undef GDK_PIXBUF_DISABLE_DEPRECATED
@@ -594,6 +595,50 @@ replace_backslashes_with_slashes (gchar
path[i] = '/';
}
+struct sortdir {
+ struct dirent **nl;
+ int cur;
+ int max;
+};
+
+static const gchar *sort_item(struct sortdir *sd)
+{
+ while (sd->cur >= 0) {
+ if (strcmp (sd->nl[sd->cur]->d_name, "..") == 0)
+ {
+ sd->cur--;
+ continue;
+ }
+ if (strcmp (sd->nl[sd->cur]->d_name, ".") == 0)
+ {
+ sd->cur--;
+ continue;
+ }
+ return sd->nl[sd->cur--]->d_name;
+ }
+ return NULL;
+}
+
+static gboolean sort_open(char *path, struct sortdir *sd)
+{
+ int n;
+
+ n = scandir(path, &sd->nl, NULL, alphasort);
+ if (n <= 0)
+ return FALSE;
+ sd->max = sd->cur = n - 1;
+ return TRUE;
+}
+
+static void sort_close(struct sortdir *sd)
+{
+ int i;
+
+ for (i = sd->max; i >= 0; i--)
+ free(sd->nl[i]);
+ free(sd->nl);
+}
+
static GList *
scan_directory (const gchar *base_path,
const gchar *subdir,
@@ -602,7 +647,7 @@ scan_directory (const gchar *base_path,
gint depth)
{
GHashTable *dir_hash;
- GDir *dir;
+ struct sortdir sortdir;
const gchar *name;
gchar *dir_path;
gboolean dir_added = FALSE;
@@ -610,15 +655,12 @@ scan_directory (const gchar *base_path,
dir_path = g_build_path ("/", base_path, subdir, NULL);
- /* FIXME: Use the gerror */
- dir = g_dir_open (dir_path, 0, NULL);
-
- if (!dir)
+ if (sort_open(dir_path, &sortdir) == FALSE)
return directories;
dir_hash = g_hash_table_new (g_str_hash, g_str_equal);
- while ((name = g_dir_read_name (dir)))
+ while ((name = sort_item(&sortdir)))
{
gchar *path;
gboolean retval;
@@ -698,7 +740,7 @@ scan_directory (const gchar *base_path,
g_free (path);
}
- g_dir_close (dir);
+ sort_close(&sortdir);
/* Move dir into the big file hash */
g_hash_table_foreach_remove (dir_hash, foreach_remove_func, files);

4007
gtk2.changes Normal file

File diff suppressed because it is too large Load Diff

587
gtk2.spec Normal file
View File

@ -0,0 +1,587 @@
#
# spec file for package gtk2
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# When updating the binary version, do not forget to also update baselibs.conf
%define gtk_binary_version 2.10.0
%define _name gtk
Name: gtk2
Version: 2.24.33
Release: 0
# FIXME: when updating to next version, check whether we can remove the workaround for bgo#596977 below (removing -fomit-frame-pointer)
Summary: The GTK+ toolkit library (version 2)
License: LGPL-2.1-or-later
Group: System/Libraries
URL: http://www.gtk.org/
#Source0: http://download.gnome.org/sources/gtk+/2.24/%%{_name}-%%{version}.tar.xz
Source: %{_name}-%{version}.tar.xz
Source2: README.SUSE
Source3: gtkrc
Source4: baselibs.conf
Source5: macros.gtk2
Source99: gtk2-rpmlintrc
# PATCH-FIX-OPENSUSE gtk2-GTK_PATH64.patch sbrabec@novell.com - 64-bit dual install. Use GTK_PATH64 environment variable instead of GTK_PATH
Patch0: gtk2-GTK_PATH64.patch
# PATCH-FEATURE-UPSTREAM bugzilla-129753-gtk+-2.8.9-localize-font-style-name.diff bnc129753 bgo319484 mfabian@novell.com - Translate the font styles in the GUI
Patch1: bugzilla-129753-gtk+-2.8.9-localize-font-style-name.diff
# PATCH-FIX-UPSTREAM gtk2-bnc130159-bgo319483-async-selection-in-gtk-font-selection.diff bnc130159 bgo319483 federico@novell.com - Load fonts asynchronously in GtkFontSelection to make it appear faster for CJK languages
Patch2: gtk2-bnc130159-bgo319483-async-selection-in-gtk-font-selection.diff
# PATCH-FIX-OPENSUSE gtk-path-local.patch Search in /usr/local/%%{_lib} by default. bnc369696 bgo534474
Patch3: gtk-path-local.patch
# PATCH-FIX-UPSTREAM gtk2-default-printer.patch bgo#577642 mgorse@suse.com -- Save selected printer as default
Patch4: gtk2-default-printer.patch
# PATCH-FIX-UPSTREAM gtk2-bgo625202-30-bit-drawables-remain-black.patch bgo#625202 ku.b@gmx.de -- 30-bit drawables remain black
Patch5: gtk2-bgo625202-30-bit-drawables-remain-black.patch
# PATCH-FIX-UPSTREAM gtk2-bgo743166-remember-printing-authentication.patch bgo#674264 joschibrauchle@gmx.de -- Credentials from gnome-keyring is not used while printing in GTK 2
Patch6: gtk2-bgo743166-remember-printing-authentication.patch
# PATCH-FEATURE-OPENSUSE gtk2-updateiconcache_sort.patch olh@opensuse.org -- Have gtp-update-icon-cache sort the file list before producing a cache
Patch8: gtk2-updateiconcache_sort.patch
BuildRequires: cairo-devel
BuildRequires: cups-devel
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gdk-pixbuf-devel
BuildRequires: gnome-patch-translation
BuildRequires: gobject-introspection-devel
BuildRequires: gtk-doc
BuildRequires: libtiff-devel
BuildRequires: pkgconfig(atk)
# Needed for patches touching the build system / bootstrapping
BuildRequires: libtool
BuildRequires: pango-devel
BuildRequires: pkgconfig
BuildRequires: translation-update-upstream
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcomposite)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xdamage)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xrandr) >= 1.2.99
BuildRequires: pkgconfig(xrender)
%description
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
%package -n libgtk-2_0-0
Summary: The GTK+ toolkit library (version 2)
# While hicolor is not a Requires strictly speaking, we put it as
# such instead of as a Recommends because many applications just
# assume it's there and we need to have a low-level package to
# bring it in.
Group: System/Libraries
Requires: hicolor-icon-theme
Requires(post): %{name}-tools >= 2.24.20
# gtk+ can work without branding/data/translations. Built in defaults will be used then.
Recommends: %{name}-branding
Recommends: %{name}-data = %{version}
# it's nice to have input modules for various locales installed by default
Recommends: %{name}-immodule-amharic = %{version}
Recommends: %{name}-immodule-inuktitut = %{version}
Recommends: %{name}-immodule-thai = %{version}
Recommends: %{name}-immodule-tigrigna = %{version}
Recommends: %{name}-immodule-vietnamese = %{version}
Recommends: gvfs
# Provide %%{name} to make the lang and immodules packages installable
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
# gail is part of gtk+ as of 2.13.x
Provides: gail = 1.22.1
Obsoletes: gail < 1.22.1
#
%description -n libgtk-2_0-0
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
%package -n typelib-1_0-Gtk-2_0
Summary: Introspection bindings for the GTK+ toolkit library v2
Group: System/Libraries
%description -n typelib-1_0-Gtk-2_0
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides the GObject Introspection bindings for GTK+.
%package immodule-amharic
Summary: Amharic input method for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
Provides: locale(%{name}:am)
%description immodule-amharic
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides an input method for Amharic.
%package immodule-inuktitut
Summary: Inuktitut input method for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
Provides: locale(%{name}:iu)
%description immodule-inuktitut
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides an input method for Inuktitut.
%package immodule-multipress
Summary: Multipress input method for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
%description immodule-multipress
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides an input method which allows text entry via the
multi-press method, as on a mobile phone.
%package immodule-thai
Summary: Thai-Lao input method for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
Provides: locale(%{name}:lo)
Provides: locale(%{name}:th)
%description immodule-thai
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides an input method for Thai-Lao.
%package immodule-tigrigna
Summary: Tigrigna input methods for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
Provides: %{name}-immodules-tigrigna = %{version}
Provides: locale(%{name}:ti)
Obsoletes: %{name}-immodules-tigrigna < %{version}
%description immodule-tigrigna
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides two input methods for Tigrigna.
%package immodule-vietnamese
Summary: Vietnamese input method for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
Provides: locale(%{name}:vi)
%description immodule-vietnamese
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides an input method for Vietnamese.
%package immodule-xim
Summary: X input method for the GTK+ toolkit library v2
Group: System/Libraries
Requires: %{name} = %{version}
Requires(post): %{name}-tools >= 2.24.20
Requires(postun):%{name}-tools >= 2.24.20
Provides: locale(%{name}:ja)
Provides: locale(%{name}:ko)
Provides: locale(%{name}:th)
Provides: locale(%{name}:zh)
%description immodule-xim
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package provides an input method based on the X Input Method.
%package tools
Summary: Auxiliary utilities for the GTK+ toolkit library v2
Group: System/Libraries
Requires(post): update-alternatives
Requires(postun):update-alternatives
%description tools
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
%package data
Summary: Data files for the GTK+ toolkit library v2
Group: System/Libraries
BuildArch: noarch
%description data
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
%package branding-upstream
Summary: Upstream theme configuration for the GTK+ toolkit library v2
Group: System/Libraries
Requires: libgtk-2_0-0 = %{version}
Supplements: (%{name} and branding-upstream)
Conflicts: %{name}-branding
Provides: %{name}-branding = %{version}
BuildArch: noarch
#BRAND: Provides /etc/gtk-2.0/gtkrc, to define default theme and icon theme.
#BRAND: Do not forget to add proper Requires in branding package if changing
#BRAND: those.
%description branding-upstream
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
%package devel
Summary: Development files for the GTK+ toolkit library v2
Group: Development/Libraries/X11
Requires: libgtk-2_0-0 = %{version}
# gtk-builder-convert needs this.
Requires: python3-xml
Requires: typelib-1_0-Gtk-2_0 = %{version}
# gail is part of gtk+ as of 2.13.x
Provides: gail-devel = 1.22.1
Obsoletes: gail-devel < 1.22.1
Provides: gtk2-doc = %{version}
Obsoletes: gtk2-doc < %{version}
#
%description devel
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
This package contains the development files for GTK+ 2.x.
%lang_package
%prep
%setup -q -n %{_name}-%{version}
translation-update-upstream
translation-update-upstream po-properties gtk20-properties
# remove incomplete translations caused by translation-update-upstream (global LINGUAS file, two domains)
for LNG in po/*.po ; do
LNG=`basename ${LNG%%.po}`
if ! test -f po-properties/$LNG.po ; then
echo "Removing incomplete $LNG from LINGUAS."
sed -i "/^$LNG\$/d" po/LINGUAS
fi
done
gnome-patch-translation-prepare
%if "%{_lib}" == "lib64"
cp -a %{SOURCE2} .
# WARNING: This patch does not patch not installed demos and tests.
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch8 -p1
sed -i "s|/usr/bin/env python|%{_bindir}/python3|" ./gtk/gtk-builder-convert
gnome-patch-translation-update
%build
NOCONFIGURE=1 ./autogen.sh
export CFLAGS="%{optflags}"
export CFLAGS="$CFLAGS -fstack-protector"
%ifarch ppc64
export CFLAGS="$CFLAGS -mminimal-toc"
%endif
# fix crash in gdm, nautilus, etc. (bgo#596977)
export CFLAGS=`echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g'`
%configure \
--disable-static \
--enable-man \
--with-xinput=xfree \
--enable-introspection \
--enable-gtk-doc
make %{?_smp_mflags}
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
%if 0%{?suse_version} <= 1130
rm %{buildroot}%{_datadir}/locale/kg/LC_MESSAGES/*
%endif
%find_lang gtk20
%find_lang gtk20-properties
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/gtk-2.0
touch %{buildroot}%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules.cache
%if "%{_lib}" == "lib64"
mv %{buildroot}%{_bindir}/gtk-query-immodules-2.0 %{buildroot}%{_bindir}/gtk-query-immodules-2.0-64
%endif
# Alternatives for gtk-update-icon-cache (binary and manpage)
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mv %{buildroot}%{_bindir}/gtk-update-icon-cache %{buildroot}%{_bindir}/gtk-update-icon-cache-2.0
ln -s -f %{_sysconfdir}/alternatives/gtk-update-icon-cache %{buildroot}%{_bindir}/gtk-update-icon-cache
mv %{buildroot}%{_mandir}/man1/gtk-update-icon-cache.1 %{buildroot}%{_mandir}/man1/gtk-update-icon-cache-2.0.1
ln -s -f %{_sysconfdir}/alternatives/gtk-update-icon-cache.1%{ext_man} %{buildroot}%{_mandir}/man1/gtk-update-icon-cache.1%{ext_man}
# Install rpm macros
mkdir -p %{buildroot}%{_rpmmacrodir}
cp %{SOURCE5} %{buildroot}%{_rpmmacrodir}
%fdupes %{buildroot}%{_datadir}
%fdupes %{buildroot}%{_libdir}
###########################################################################
# Note: when updating scriptlets, don't forget to also update baselibs.conf
###########################################################################
# Convenient %%define for the scriplets
%if "%{_lib}" == "lib64"
%define _gtk_query_immodules %{_bindir}/gtk-query-immodules-2.0-64
%else
%define _gtk_query_immodules %{_bindir}/gtk-query-immodules-2.0
%endif
%define _gtk_query_immodules_update_cache %{_gtk_query_immodules} --update-cache
%post -n libgtk-2_0-0
/sbin/ldconfig
%if 0
# In case libgtk-2_0-0 gets installed before gtk2-tools, we don't want to fail.
# So we make the call to gtk-query-immodules-2.0 dependent on the existence of
# the binary. This is why we also have a %%post for gtk2-tools.
%endif
if test -f %{_gtk_query_immodules}; then
%{_gtk_query_immodules_update_cache}
fi
%post immodule-amharic
%{_gtk_query_immodules_update_cache}
%post immodule-inuktitut
%{_gtk_query_immodules_update_cache}
%post immodule-multipress
%{_gtk_query_immodules_update_cache}
%post immodule-thai
%{_gtk_query_immodules_update_cache}
%post immodule-tigrigna
%{_gtk_query_immodules_update_cache}
%post immodule-vietnamese
%{_gtk_query_immodules_update_cache}
%post immodule-xim
%{_gtk_query_immodules_update_cache}
%post tools
%if 0
# If we install gtk2-tools for the first time, then we should run it in case
# libgtk-2_0-0 was installed first (ie, if
# %%{_libdir}/gtk-2.0/%%{gtk_binary_version} already exists) which means
# gtk-query-immodules-2.0 couldn't run there.
%endif
if [ $1 = 1 ]; then
test -d %{_libdir}/gtk-2.0/%{gtk_binary_version}
if test $? -eq 0; then
%{_gtk_query_immodules_update_cache}
fi
fi
%if 0
# If the gtk-update-icon-cache group is in automatic mode, then this will also
# switch all symlinks automatically
%endif
update-alternatives --install %{_bindir}/gtk-update-icon-cache gtk-update-icon-cache %{_bindir}/gtk-update-icon-cache-2.0 2 \
--slave %{_mandir}/man1/gtk-update-icon-cache.1.gz gtk-update-icon-cache.1.gz %{_mandir}/man1/gtk-update-icon-cache-2.0.1.gz
%filetriggerin tools -- %{_datadir}/icons
if [ "$(realpath %{_bindir}/gtk-update-icon-cache)" = "%{_bindir}/gtk-update-icon-cache-2.0" ]; then
for ICON_THEME in $(cut -d / -f 5 | sort -u); do
if [ -f "%{_datadir}/icons/${ICON_THEME}/index.theme" ]; then
%{_bindir}/gtk-update-icon-cache --quiet --force "%{_datadir}/icons/${ICON_THEME}"
fi
done
fi
%filetriggerpostun tools -- %{_datadir}/icons
if [ "$(realpath %{_bindir}/gtk-update-icon-cache)" = "%{_bindir}/gtk-update-icon-cache-2.0" ]; then
for ICON_THEME in $(cut -d / -f 5 | sort -u); do
if [ -f "%{_datadir}/icons/${ICON_THEME}/index.theme" ]; then
%{_bindir}/gtk-update-icon-cache --quiet --force "%{_datadir}/icons/${ICON_THEME}"
fi
done
fi
%if 0
# No need to call gtk-query-immodules-2.0 in postun:
# - if it's an upgrade, it will have been called in post
# - if it's an uninstall, we don't care about this anymore
%endif
%postun -n libgtk-2_0-0 -p /sbin/ldconfig
%postun immodule-amharic
%{_gtk_query_immodules_update_cache}
%postun immodule-inuktitut
%{_gtk_query_immodules_update_cache}
%postun immodule-multipress
%{_gtk_query_immodules_update_cache}
%postun immodule-thai
%{_gtk_query_immodules_update_cache}
%postun immodule-tigrigna
%{_gtk_query_immodules_update_cache}
%postun immodule-vietnamese
%{_gtk_query_immodules_update_cache}
%postun immodule-xim
%{_gtk_query_immodules_update_cache}
%postun tools
%if 0
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
%endif
if [ ! -f %{_bindir}/gtk-update-icon-cache-2.0 ]; then
update-alternatives --remove gtk-update-icon-cache %{_bindir}/gtk-update-icon-cache-2.0
fi
%files -n libgtk-2_0-0
%license COPYING
%doc AUTHORS NEWS
%if "%{_lib}" == "lib64"
%doc README.SUSE
%endif
%dir %{_sysconfdir}/gtk-2.0
%dir %{_libdir}/gtk-2.0
%dir %{_libdir}/gtk-2.0/%{gtk_binary_version}
%dir %{_libdir}/gtk-2.0/%{gtk_binary_version}/engines
%{_libdir}/gtk-2.0/%{gtk_binary_version}/engines/libpixmap.so
%dir %{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-cedilla.so
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-cyrillic-translit.so
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ipa.so
%dir %{_libdir}/gtk-2.0/%{gtk_binary_version}/printbackends
%{_libdir}/gtk-2.0/%{gtk_binary_version}/printbackends/libprintbackend-cups.so
%{_libdir}/gtk-2.0/%{gtk_binary_version}/printbackends/libprintbackend-file.so
%{_libdir}/gtk-2.0/%{gtk_binary_version}/printbackends/libprintbackend-lpr.so
%ghost %{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules.cache
%dir %{_libdir}/gtk-2.0/modules
%{_libdir}/gtk-2.0/modules/libgail.so
%{_libdir}/libgailutil.so.*
%{_libdir}/libgdk-x11-2.0.so.*
%{_libdir}/libgtk-x11-2.0.so.*
%files -n typelib-1_0-Gtk-2_0
%{_libdir}/girepository-1.0/Gdk-2.0.typelib
%{_libdir}/girepository-1.0/GdkX11-2.0.typelib
%{_libdir}/girepository-1.0/Gtk-2.0.typelib
%files immodule-amharic
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-am-et.so
%files immodule-inuktitut
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-inuktitut.so
%files immodule-multipress
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-multipress.so
%config %{_sysconfdir}/gtk-2.0/im-multipress.conf
%files immodule-thai
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-thai.so
%files immodule-tigrigna
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ti-er.so
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ti-et.so
%files immodule-vietnamese
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-viqr.so
%files immodule-xim
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-xim.so
%files tools
%{_bindir}/gtk-query-immodules-2.0*
%{_bindir}/gtk-update-icon-cache-2.0
%{_bindir}/gtk-update-icon-cache
%ghost %{_sysconfdir}/alternatives/gtk-update-icon-cache
%ghost %{_sysconfdir}/alternatives/gtk-update-icon-cache.1%{?ext_man}
%{_mandir}/man1/gtk-query-immodules-2.0*.1%{?ext_man}
%{_mandir}/man1/gtk-update-icon-cache-2.0.1%{?ext_man}
%{_mandir}/man1/gtk-update-icon-cache.1%{?ext_man}
%files data
%{_datadir}/themes/Default/
%{_datadir}/themes/Emacs/
%{_datadir}/themes/Raleigh/
%files branding-upstream
%config %{_sysconfdir}/gtk-2.0/gtkrc
%files lang -f gtk20.lang -f gtk20-properties.lang
%files devel
%doc %{_datadir}/gtk-doc/html/gail-libgail-util/
%doc %{_datadir}/gtk-doc/html/gdk2/
%doc %{_datadir}/gtk-doc/html/gtk2/
%{_bindir}/gtk-builder-convert
%{_bindir}/gtk-demo
%{_mandir}/man1/gtk-builder-convert.1*
%{_datadir}/aclocal/gtk-2.0.m4
%{_datadir}/gir-1.0/*.gir
%dir %{_datadir}/gtk-2.0
%{_datadir}/gtk-2.0/demo/
%{_includedir}/gail-1.0/
%{_includedir}/gtk-2.0/
%{_includedir}/gtk-unix-print-2.0/
%{_libdir}/gtk-2.0/include/
%{_libdir}/gtk-2.0/modules/libferret.so
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libgailutil.so
%{_libdir}/libgdk-x11-2.0.so
%{_libdir}/libgtk-x11-2.0.so
%{_rpmmacrodir}/macros.gtk2
%changelog

11
gtkrc Normal file
View File

@ -0,0 +1,11 @@
#
# gtkrc file allows you to define system wide defaults for all GTK+ applications.
# This file is branding specific.
#
# For complete list of available settings see devhelp documentation in
# gtk2-doc package, section GTK+ Core Reference -> Resource Files
#
# You most probably want:
#gtk-theme-name = ""
#gtk-icon-theme-name = ""
#gtk-fallback-icon-theme = "gnome"

35
macros.gtk2 Normal file
View File

@ -0,0 +1,35 @@
# RPM macros for packages installing a GTK+ IM module
#
###
#
# When a package installs a GTK+ IM module, it should use all
# three macros:
#
# - %gtk2_immodule_requires in the preamble
# - %gtk2_immodule_post in %post
# - %gtk2_immodule_postun in %postun
#
###
%gtk2_immodule_requires \
Requires(post): gtk2-tools >= 2.24.20 \
Requires(postun): gtk2-tools >= 2.24.20
# On install, update the cache
%gtk2_immodule_post \
%if "%_lib" == "lib64" \
%{_bindir}/gtk-query-immodules-2.0-64 --update-cache \
%else \
%{_bindir}/gtk-query-immodules-2.0 --update-cache \
%endif
# On uninstall, update the cache. Note: we ignore upgrades (already
# handled in %post of the new package).
%gtk2_immodule_postun \
if [ $1 -eq 0 ]; then \
%if "%_lib" == "lib64" \
%{_bindir}/gtk-query-immodules-2.0-64 --update-cache \
%else \
%{_bindir}/gtk-query-immodules-2.0 --update-cache \
%endif \
fi