rpms/gtk+/EL-5 gtk+-1.2.10-ahiguti.patch, NONE, 1.1 gtk+-1.2.10-unused-deps.patch, NONE, 1.1 gtk+-1.2.10-multilib.patch, 1.1, 1.2 gtk+.spec, 1.5, 1.6 gtk+-1.2.6-ahiguti.patch, 1.1, NONE

Paul Howarth pghmcfc at fedoraproject.org
Tue Apr 21 13:43:24 UTC 2009


Author: pghmcfc

Update of /cvs/pkgs/rpms/gtk+/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1378

Modified Files:
	gtk+-1.2.10-multilib.patch gtk+.spec 
Added Files:
	gtk+-1.2.10-ahiguti.patch gtk+-1.2.10-unused-deps.patch 
Removed Files:
	gtk+-1.2.6-ahiguti.patch 
Log Message:
Resync with Fedora

gtk+-1.2.10-ahiguti.patch:

--- NEW FILE gtk+-1.2.10-ahiguti.patch ---
Return-Path: a-higuti at math.sci.hokudai.ac.jp
Delivery-Date: Thu Sep 23 14:52:43 1999
Return-Path: <a-higuti at math.sci.hokudai.ac.jp>
Received: from localhost (IDENT:otaylor at localhost [127.0.0.1])
	by fresnel.labs.redhat.com (8.9.3/8.9.3) with ESMTP id OAA00891
	for <otaylor at localhost>; Thu, 23 Sep 1999 14:52:41 -0400
Received: from lacrosse.redhat.com
	by localhost with POP3 (fetchmail-5.0.0)
	for otaylor at localhost (single-drop); Thu, 23 Sep 1999 14:52:42 -0400 (EDT)
Received: from mail.redhat.com (mail.redhat.com [199.183.24.239])
	by lacrosse.corp.redhat.com (8.9.3/8.9.3) with ESMTP id OAA19205
	for <otaylor at lacrosse.redhat.com>; Thu, 23 Sep 1999 14:01:27 -0400
Received: from math.sci.hokudai.ac.jp (seki.math.sci.hokudai.ac.jp [133.50.152.8])
	by mail.redhat.com (8.8.7/8.8.7) with ESMTP id OAA13383
	for <otaylor at redhat.com>; Thu, 23 Sep 1999 14:01:49 -0400
Received: from heathcliff (a-higuti at hilbert.math.sci.hokudai.ac.jp [133.50.152.11])
	by math.sci.hokudai.ac.jp (8.8.8/3.6W01/06/98) with SMTP id DAA23889
	for <otaylor at redhat.com>; Fri, 24 Sep 1999 03:01:10 +0900 (JST)
Date: Fri, 24 Sep 1999 03:01:10 +0900 (JST)
Message-Id: <199909231801.DAA23889 at math.sci.hokudai.ac.jp>
From: a-higuti at math.sci.hokudai.ac.jp (Akira Higuchi)
To: otaylor at redhat.com
Subject: Adding more gdk_isw* macros
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Status:  O
Lines: 528
Xref: fresnel.labs.redhat.com prog-gtk:648

Hello Owen,

I'm working on adding CJK support to gnome apps, and I need your advice.

As you know, gtk+-1.2 has some support for CJK. It's sufficient for most
gnome apps to be internationalized, but some problems remain. The most
problem is that there is no way of doing word wrapping for CJK strings.

For example, gtk-xmhtml shows Japanese text very uglily, because Japanese
sentences are recognized as very long words. (a Japanese sentence 
contain any spaces in most cases.) The same problem is in gtk+ itself, too;
Word wrapping in GtkLabel and GtkText doesn't work correctly for CJK text,
because of the same reason as above.

In order to fix it, we need more gdk_isw* functions than we already have
in gdki18n.h. (I regret I didn't add them before gtk+-1.2 was released.)
I attach herewith a patch which fixes it, but I think it's not acceptable
to adding a new macro to a stable version of gtk+. (is it?)

The question I want to ask you is: what's the best way of fixing the
problem without adding these macros to gdki18n.h? A solution is to add
these macros to each *.c files (in GtkLabel, GtkText, and gtkxmhtml etc.)
rather than gtki18n.h, but it's very ugly I think. 

Please don't say "wait until gscript is completed" ;-(  I don't want to
wait for a long time. (Please let me know if I can help you with gscript
BTW. I've not hacked gscript yet, because it seems to be too early to be
hacked by other than you.)

Thanks,
Akira Higuchi
---------------- x8 ---------------- x8 ---------------- x8 ----------------
diff -up gtk+-1.2.10/gdk/gdki18n.h.ahiguti gtk+-1.2.10/gdk/gdki18n.h
--- gtk+-1.2.10/gdk/gdki18n.h.ahiguti	2000-01-24 03:58:21.000000000 +0100
+++ gtk+-1.2.10/gdk/gdki18n.h	2008-10-02 10:43:26.000000000 +0200
@@ -51,4 +51,32 @@
 #  define gdk_iswspace(c) ((wchar_t)(c) <= 0xFF && isspace(c))
 #endif
 
+/* The following 9 macros are added in gtk+ 1.2.X. Don't use them without
+ * checking GTK_CHECK_VERSION. For example,
+ *	#if GTK_CHECK_VERSION (1,2,X)
+ *	    ... code which uses gdk_iswalpha(), gdk_iswcntrl(), etc. ...
+ *      #endif
+ */
+#if !defined(G_HAVE_BROKEN_WCTYPE) && (defined(G_HAVE_WCTYPE_H) || defined(G_HAVE_WCHAR_H)) && !defined(X_LOCALE)
+#  define gdk_iswalpha(c)  iswalpha(c)
+#  define gdk_iswcntrl(c)  iswcntrl(c)
+#  define gdk_iswdigit(c)  iswdigit(c)
+#  define gdk_iswlower(c)  iswlower(c)
+#  define gdk_iswgraph(c)  iswgraph(c)
+#  define gdk_iswprint(c)  iswprint(c)
+#  define gdk_iswpunct(c)  iswpunct(c)
+#  define gdk_iswupper(c)  iswupper(c)
+#  define gdk_iswxdigit(c) iswxdigit(c)
+#else
+#  define gdk_iswalpha(c)  ((wchar_t)(c) <= 0xFF && isalpha(c))
+#  define gdk_iswcntrl(c)  ((wchar_t)(c) <= 0xFF && iscntrl(c))
+#  define gdk_iswdigit(c)  ((wchar_t)(c) <= 0xFF && isdigit(c))
+#  define gdk_iswlower(c)  ((wchar_t)(c) <= 0xFF && islower(c))
+#  define gdk_iswgraph(c)  ((wchar_t)(c) >  0xFF || isgraph(c))
+#  define gdk_iswprint(c)  ((wchar_t)(c) >  0xFF || isprint(c))
+#  define gdk_iswpunct(c)  ((wchar_t)(c) <= 0xFF && ispunct(c))
+#  define gdk_iswupper(c)  ((wchar_t)(c) <= 0xFF && isupper(c))
+#  define gdk_iswxdigit(c) ((wchar_t)(c) <= 0xFF && isxdigit(c))
+#endif
+
 #endif /* __GDK_I18N_H__ */
diff -up gtk+-1.2.10/gtk/gtkentry.c.ahiguti gtk+-1.2.10/gtk/gtkentry.c
--- gtk+-1.2.10/gtk/gtkentry.c.ahiguti	2001-04-02 04:14:54.000000000 +0200
+++ gtk+-1.2.10/gtk/gtkentry.c	2008-10-02 10:43:26.000000000 +0200
@@ -2036,11 +2036,21 @@ gtk_entry_move_word (GtkEditable *editab
     }
 }
 
+static gboolean
+alnum_or_ideogram (GtkEntry *entry, guint index)
+{
+  GdkWChar ch;
+  ch = entry->text[index];
+  if (entry->use_wchar)
+    return !(gdk_iswpunct (ch) || gdk_iswcntrl (ch) || gdk_iswspace (ch));
+  else
+    return !(ispunct (ch) || iscntrl (ch) || isspace (ch));
+}
+
 static void
 gtk_move_forward_word (GtkEntry *entry)
 {
   GtkEditable *editable;
-  GdkWChar *text;
   gint i;
 
   editable = GTK_EDITABLE (entry);
@@ -2054,21 +2064,12 @@ gtk_move_forward_word (GtkEntry *entry)
 
   if (entry->text && (editable->current_pos < entry->text_length))
     {
-      text = entry->text;
-      i = editable->current_pos;
-	  
-      if ((entry->use_wchar) ? (!gdk_iswalnum (text[i])) : (!isalnum (text[i])))
-	for (; i < entry->text_length; i++)
-	  {
-	    if ((entry->use_wchar) ? gdk_iswalnum (text[i]) : isalnum (text[i]))
-	      break;
-	  }
-
+      for (i = editable->current_pos; i < entry->text_length; i++)
+	if (alnum_or_ideogram (entry, i))
+	  break;
       for (; i < entry->text_length; i++)
-	{
-	  if ((entry->use_wchar) ? (!gdk_iswalnum (text[i])) : (!isalnum (text[i])))
-	    break;
-	}
+	if (!alnum_or_ideogram (entry, i))
+	  break;
 
       editable->current_pos = i;
     }
@@ -2078,7 +2079,6 @@ static void
 gtk_move_backward_word (GtkEntry *entry)
 {
   GtkEditable *editable;
-  GdkWChar *text;
   gint i;
 
   editable = GTK_EDITABLE (entry);
@@ -2092,26 +2092,19 @@ gtk_move_backward_word (GtkEntry *entry)
 
   if (entry->text && editable->current_pos > 0)
     {
-      text = entry->text;
-      i = editable->current_pos - 1;
-      if ((entry->use_wchar) ? (!gdk_iswalnum (text[i])) : (!isalnum (text[i])))
-	for (; i >= 0; i--)
+      for (i = editable->current_pos - 1; i >= 0; i--)
+	if (alnum_or_ideogram (entry, i))
+	  break;
+      for (; i >= 0; i--)
+	if (!alnum_or_ideogram (entry, i))
 	  {
-	    if ((entry->use_wchar) ? gdk_iswalnum (text[i]) : isalnum (text[i]))
-	      break;
+	    i++;
+	    break;
 	  }
-      for (; i >= 0; i--)
-	{
-	  if ((entry->use_wchar) ? (!gdk_iswalnum (text[i])) : (!isalnum (text[i])))
-	    {
-	      i++;
-	      break;
-	    }
-	}
-	  
+
       if (i < 0)
 	i = 0;
-	  
+  
       editable->current_pos = i;
     }
 }
diff -up gtk+-1.2.10/gtk/gtklabel.c.ahiguti gtk+-1.2.10/gtk/gtklabel.c
--- gtk+-1.2.10/gtk/gtklabel.c.ahiguti	2001-04-02 05:12:38.000000000 +0200
+++ gtk+-1.2.10/gtk/gtklabel.c	2008-10-02 10:43:26.000000000 +0200
@@ -56,6 +56,7 @@ struct _GtkLabelWord
   GtkLabelWord *next;
   gint uline_y;
   GtkLabelULine *uline;
+  gboolean paragraph_break;
 };
 
 struct _GtkLabelULine
@@ -396,6 +397,7 @@ gtk_label_word_alloc (void)
   word->beginning = NULL;
   word->next = NULL;
   word->uline = NULL;
+  word->paragraph_break = FALSE;
 
   return word;
 }
@@ -441,6 +443,7 @@ gtk_label_split_text (GtkLabel *label)
       if (str == label->label_wc || str[-1] == '\n')
 	{
 	  /* Paragraph break */
+	  word->paragraph_break = TRUE;
 	  word->space = 0;
 	  
 	  max_line_width = MAX (line_width, max_line_width);
@@ -488,6 +491,7 @@ gtk_label_split_text (GtkLabel *label)
     {
       word = gtk_label_word_alloc ();
       
+      word->paragraph_break = TRUE;
       word->space = 0;
       word->beginning = str;
       word->length = 0;
@@ -500,6 +504,13 @@ gtk_label_split_text (GtkLabel *label)
   return MAX (line_width, max_line_width);
 }
 
+static gboolean
+is_ideogram (GdkWChar wc)
+{
+  return !(gdk_iswalnum (wc) || gdk_iswspace (wc) ||
+	   gdk_iswpunct (wc) || gdk_iswcntrl (wc));
+}
+
 /* this needs to handle white space better. */
 static gint
 gtk_label_split_text_wrapped (GtkLabel *label)
@@ -526,6 +537,7 @@ gtk_label_split_text_wrapped (GtkLabel *
       if (str == label->label_wc || str[-1] == '\n')
 	{
 	  /* Paragraph break */
+	  word->paragraph_break = TRUE;
 	  word->space = 0;
 	  
 	  max_line_width = MAX (line_width, max_line_width);
@@ -546,24 +558,30 @@ gtk_label_split_text_wrapped (GtkLabel *
 	  else
 	    word->space = space_width * nspaces;
 	}
-      else
+      else if (gdk_iswspace (str[-1]))
 	{
 	  /* Regular inter-word space */
 	  word->space = space_width;
 	}
+      else
+	{
+	  word->space = 0;
+	}
       
       word->beginning = str;
       word->length = 0;
       p = word->beginning;
       while (*p && !gdk_iswspace (*p))
 	{
+	  if (word->length > 0 && (is_ideogram (p[-1]) || is_ideogram (*p)))
+	    break;
 	  word->length++;
 	  p++;
 	}
       word->width = gdk_text_width_wc (GTK_WIDGET (label)->style->font, str, word->length);
       
       str += word->length;
-      if (*str)
+      if (*str && gdk_iswspace (*str))
 	str++;
       
       line_width += word->space + word->width;
@@ -600,7 +618,7 @@ gtk_label_pick_width (GtkLabel *label,
   width = 0;
   for (word = label->words; word; word = word->next)
     {
-      if (word->space == 0
+      if (word->paragraph_break
 	  || (line_width
 	      && (line_width >= min_width
 		  || line_width + word->width + word->space > max_width)))
@@ -716,7 +734,8 @@ gtk_label_finalize_lines_wrap (GtkLabel 
   GtkLabelWord *word, *line, *next_line;
   GtkWidget *widget;
   gchar *ptrn;
-  gint x, y, space, extra_width, add_space, baseline_skip;
+  gint x, y, space, num_words, extra_width, add_space, baseline_skip;
+  gboolean deliver_equivalently;
   
   g_return_if_fail (label->wrap);
   
@@ -724,20 +743,24 @@ gtk_label_finalize_lines_wrap (GtkLabel 
   y = 0;
   baseline_skip = (GTK_WIDGET (label)->style->font->ascent +
 		   GTK_WIDGET (label)->style->font->descent + 1);
+  deliver_equivalently = FALSE;
   
   for (line = label->words; line != 0; line = next_line)
     {
-      space = 0;
+      space = num_words = 0;
       extra_width = max_line_width - line->width;
       
       for (next_line = line->next; next_line; next_line = next_line->next)
 	{
-	  if (next_line->space == 0)
+	  if (next_line->paragraph_break)
 	    break;		/* New paragraph */
 	  if (next_line->space + next_line->width > extra_width)
 	    break;
+	  if (next_line->space == 0)
+	    deliver_equivalently = TRUE; /* An ideogram is found. */
 	  extra_width -= next_line->space + next_line->width;
 	  space += next_line->space;
+	  num_words++;
 	}
       
       line->x = 0;
@@ -747,14 +770,18 @@ gtk_label_finalize_lines_wrap (GtkLabel 
       
       for (word = line->next; word != next_line; word = word->next)
 	{
-	  if (next_line && next_line->space)
+	  if (next_line && !next_line->paragraph_break &&
+	      label->jtype == GTK_JUSTIFY_FILL &&
+	      (deliver_equivalently ? num_words : space) > 0)
 	    {
-	      /* Not last line of paragraph --- fill line if needed */
-	      if (label->jtype == GTK_JUSTIFY_FILL) {
+	      /* Not last line of paragraph --- fill line */
+	      if (deliver_equivalently)
+		add_space = (extra_width + num_words / 2) / num_words;
+	      else
 		add_space = (extra_width * word->space + space / 2) / space;
-		extra_width -= add_space;
-		space -= word->space;
-	      }
+	      extra_width -= add_space;
+	      space -= word->space;
+	      num_words--;
 	    }
 	  
 	  word->x = x + word->space + add_space;
@@ -925,7 +952,7 @@ gtk_label_expose (GtkWidget      *widget
 
       for (word = label->words; word; word = word->next)
 	{
-	  gchar save = word->beginning[word->length];
+	  GdkWChar save = word->beginning[word->length];
 	  word->beginning[word->length] = '\0';
 	  gtk_label_paint_word (label, x, y, word, &event->area);
 	  word->beginning[word->length] = save;
diff -up gtk+-1.2.10/gtk/gtktext.c.ahiguti gtk+-1.2.10/gtk/gtktext.c
--- gtk+-1.2.10/gtk/gtktext.c.ahiguti	2001-03-15 21:15:12.000000000 +0100
+++ gtk+-1.2.10/gtk/gtktext.c	2008-10-02 10:43:27.000000000 +0200
@@ -101,6 +101,13 @@ enum {
   ARG_WORD_WRAP
 };
 
+typedef enum {
+  CHAR_CLASS_SPACE,
+  CHAR_CLASS_ALNUM,
+  CHAR_CLASS_IDEOGRAM,
+  CHAR_CLASS_OTHERS     /* punct, cntrl */
+} CharClass;
+
 typedef struct _TextProperty          TextProperty;
 typedef struct _TabStopMark           TabStopMark;
 typedef struct _PrevTabCont           PrevTabCont;
@@ -300,6 +307,8 @@ static LineParams find_line_params (GtkT
 				    const GtkPropertyMark *mark,
 				    const PrevTabCont *tab_cont,
 				    PrevTabCont *next_cont);
+static void find_word_wrap_position (GtkText* text, LineParams *lp);
+static CharClass char_class (GtkText* text, guint index);
 static void recompute_geometry (GtkText* text);
 static void insert_expose (GtkText* text, guint old_pixels, gint nchars, guint new_line_count);
 static void delete_expose (GtkText* text,
@@ -4111,27 +4120,21 @@ gtk_text_move_forward_word (GtkText *tex
   
   undraw_cursor (text, FALSE);
   
-  if (text->use_wchar)
+  while (!LAST_INDEX (text, text->cursor_mark))
     {
-      while (!LAST_INDEX (text, text->cursor_mark) && 
-	     !gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index)))
-	advance_mark (&text->cursor_mark);
-      
-      while (!LAST_INDEX (text, text->cursor_mark) && 
-	     gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index)))
-	advance_mark (&text->cursor_mark);
+      CharClass cc = char_class (text, text->cursor_mark.index);
+      if (cc == CHAR_CLASS_ALNUM || cc == CHAR_CLASS_IDEOGRAM)
+	break;
+      advance_mark (&text->cursor_mark);
     }
-  else
+  while (!LAST_INDEX (text, text->cursor_mark))
     {
-      while (!LAST_INDEX (text, text->cursor_mark) && 
-	     !isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index)))
-	advance_mark (&text->cursor_mark);
-      
-      while (!LAST_INDEX (text, text->cursor_mark) && 
-	     isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index)))
-	advance_mark (&text->cursor_mark);
+      CharClass cc = char_class (text, text->cursor_mark.index);
+      if (cc != CHAR_CLASS_ALNUM && cc != CHAR_CLASS_IDEOGRAM)
+	break;
+      advance_mark (&text->cursor_mark);
     }
-  
+
   find_cursor (text, TRUE);
   draw_cursor (text, FALSE);
 }
@@ -4143,25 +4146,19 @@ gtk_text_move_backward_word (GtkText *te
   
   undraw_cursor (text, FALSE);
   
-  if (text->use_wchar)
+  while (text->cursor_mark.index > 0)
     {
-      while ((text->cursor_mark.index > 0) &&
-	     !gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1)))
-	decrement_mark (&text->cursor_mark);
-      
-      while ((text->cursor_mark.index > 0) &&
-	     gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1)))
-	decrement_mark (&text->cursor_mark);
+      CharClass cc = char_class (text, text->cursor_mark.index - 1);
+      if (cc == CHAR_CLASS_ALNUM || cc == CHAR_CLASS_IDEOGRAM)
+	break;
+      decrement_mark (&text->cursor_mark);
     }
-  else
+  while (text->cursor_mark.index > 0)
     {
-      while ((text->cursor_mark.index > 0) &&
-	     !isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1)))
-	decrement_mark (&text->cursor_mark);
-      
-      while ((text->cursor_mark.index > 0) &&
-	     isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1)))
-	decrement_mark (&text->cursor_mark);
+      CharClass cc = char_class (text, text->cursor_mark.index - 1);
+      if (cc != CHAR_CLASS_ALNUM && cc != CHAR_CLASS_IDEOGRAM)
+	break;
+      decrement_mark (&text->cursor_mark);
     }
   
   find_cursor (text, TRUE);
@@ -4782,27 +4779,8 @@ find_line_params (GtkText* text,
 		      GtkPropertyMark saved_mark = lp.end;
 		      guint saved_characters = lp.displayable_chars;
 		      
-		      lp.displayable_chars += 1;
-		      
-		      if (text->use_wchar)
-			{
-			  while (!gdk_iswspace (GTK_TEXT_INDEX (text, lp.end.index)) &&
-				 (lp.end.index > lp.start.index))
-			    {
-			      decrement_mark (&lp.end);
-			      lp.displayable_chars -= 1;
-			    }
-			}
-		      else
-			{
-			  while (!isspace(GTK_TEXT_INDEX (text, lp.end.index)) &&
-				 (lp.end.index > lp.start.index))
-			    {
-			      decrement_mark (&lp.end);
-			      lp.displayable_chars -= 1;
-			    }
-			}
-		      
+		      find_word_wrap_position (text, &lp);
+
 		      /* If whole line is one word, revert to char wrapping */
 		      if (lp.end.index == lp.start.index)
 			{
@@ -4850,6 +4828,54 @@ find_line_params (GtkText* text,
   return lp;
 }
 
+static CharClass
+char_class (GtkText* text, guint index)
+{
+  GdkWChar wc;
+  wc = GTK_TEXT_INDEX (text, index);
+  if (text->use_wchar)
+    {
+      if (gdk_iswspace (wc))
+	return CHAR_CLASS_SPACE;
+      else if (gdk_iswalnum (wc))
+	return CHAR_CLASS_ALNUM;
+      else if (gdk_iswpunct (wc) || gdk_iswcntrl (wc))
+	return CHAR_CLASS_OTHERS;
+      else
+	return CHAR_CLASS_IDEOGRAM;
+    }
+  else
+    {
+      if (isspace (wc))
+	return CHAR_CLASS_SPACE;
+      else if (isalnum (wc))
+	return CHAR_CLASS_ALNUM;
+      else if (ispunct (wc) || iscntrl (wc))
+	return CHAR_CLASS_OTHERS;
+      else
+	return CHAR_CLASS_IDEOGRAM;
+    }
+}
+
+static void
+find_word_wrap_position (GtkText* text, LineParams *lp)
+{
+  while (lp->end.index > lp->start.index &&
+	 char_class (text, lp->end.index) != CHAR_CLASS_SPACE &&
+	 char_class (text, lp->end.index) != CHAR_CLASS_IDEOGRAM &&
+	 char_class (text, lp->end.index - 1) != CHAR_CLASS_IDEOGRAM)
+    {
+      decrement_mark (&lp->end);
+      lp->displayable_chars -= 1;
+    }
+
+  /* lp->end.index points the position to be cut just now. If it's not a
+   * space, move it to the next display line. */
+  if (lp->end.index > lp->start.index &&
+      char_class (text, lp->end.index) != CHAR_CLASS_SPACE)
+    decrement_mark (&lp->end);
+}
+
 static void
 expand_scratch_buffer (GtkText* text, guint len)
 {
---------------- x8 ---------------- x8 ---------------- x8 ----------------

--------------------------------------
Akira Higuchi
Dept. of Mathematics, Hokkaido Univ.
Hokkaido, Japan
Email: a-higuti at math.sci.hokudai.ac.jp

gtk+-1.2.10-unused-deps.patch:

--- NEW FILE gtk+-1.2.10-unused-deps.patch ---
--- gtk+-1.2.10/gdk/Makefile.am	2009-04-17 17:02:02.000000000 +0100
+++ gtk+-1.2.10/gdk/Makefile.am	2009-04-17 17:05:49.000000000 +0100
@@ -22,10 +22,9 @@
 	-release $(LT_RELEASE) \
 	-export-dynamic \
 	-no-undefined -Wl,--no-undefined \
-	@GLIB_DEPLIBS@	\
+	$(filter-out -lgmodule -ldl, @GLIB_DEPLIBS@) \
 	@x_ldflags@	\
 	@x_libs@	\
-	-lm		\
 @STRIP_END@
 
 #
--- gtk+-1.2.10/gtk/Makefile.am	2009-04-17 20:46:56.000000000 +0100
+++ gtk+-1.2.10/gtk/Makefile.am	2009-04-17 20:52:24.000000000 +0100
@@ -32,9 +32,9 @@
 	-release $(LT_RELEASE) 					\
 	-export-dynamic						\
 	-no-undefined -Wl,--no-undefined			\
-	@GLIB_DEPLIBS@ 						\
+	$(filter-out -ldl, @GLIB_DEPLIBS@)			\
 	@x_ldflags@						\
-	@x_libs@ 						\
+	$(filter-out -lXi -lXext, @x_libs@)			\
 	-lm							\
 @STRIP_END@
 #	$(top_builddir)/gdk/libgdk.la

gtk+-1.2.10-multilib.patch:

Index: gtk+-1.2.10-multilib.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gtk+/EL-5/gtk+-1.2.10-multilib.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gtk+-1.2.10-multilib.patch	11 Jan 2007 16:30:33 -0000	1.1
+++ gtk+-1.2.10-multilib.patch	21 Apr 2009 13:43:21 -0000	1.2
@@ -1,12 +1,22 @@
---- gtk+-1.2.10/gtk-config.in.multilib	2007-01-11 10:22:17.000000000 -0500
-+++ gtk+-1.2.10/gtk-config.in	2007-01-11 10:33:01.000000000 -0500
-@@ -5,8 +5,11 @@
- glib_thread_libs="@glib_thread_libs@"
- glib_thread_cflags="@glib_thread_cflags@"
+diff -up gtk+-1.2.10/gtk-config.in.multilib gtk+-1.2.10/gtk-config.in
+--- gtk+-1.2.10/gtk-config.in.multilib	2000-10-21 20:20:40.000000000 +0200
++++ gtk+-1.2.10/gtk-config.in	2008-10-02 09:52:59.000000000 +0200
+@@ -1,12 +1,16 @@
+ #!/bin/sh
+ 
+-glib_libs="@glib_libs@"
+-glib_cflags="@glib_cflags@"
+-glib_thread_libs="@glib_thread_libs@"
+-glib_thread_cflags="@glib_thread_cflags@"
++[ -z "$PKG_CONFIG" ] && PKG_CONFIG="pkg-config"
  
 -prefix=@prefix@
 -exec_prefix=@exec_prefix@
-+[ -z "$PKG_CONFIG" ] && PKG_CONFIG="pkg-config"
++glib_libs=`${PKG_CONFIG} --libs glib gmodule`
++glib_cflags=`${PKG_CONFIG} --cflags glib gmodule`
++glib_thread_libs=`${PKG_CONFIG} --libs gthread`
++glib_thread_cflags=`${PKG_CONFIG} --cflags gthread`
++
 +prefix=`${PKG_CONFIG} --variable prefix gtk+`
 +exec_prefix=`${PKG_CONFIG} --variable exec_prefix gtk+`
 +libdir=`${PKG_CONFIG} --variable libdir gtk+`
@@ -14,7 +24,7 @@
  exec_prefix_set=no
  
  usage()
-@@ -91,14 +94,14 @@
+@@ -91,14 +95,14 @@ if test "$lib_gthread" = "yes"; then
  fi
  
  if test "$echo_cflags" = "yes"; then
@@ -32,3 +42,11 @@
            if test -z "$my_glib_libs" ; then
              my_glib_libs="$i"
            else
+@@ -107,6 +111,6 @@ if test "$echo_libs" = "yes"; then
+         fi
+       done
+ 
+-      echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm
++      echo $libdirs -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm
+ fi      
+ 


Index: gtk+.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtk+/EL-5/gtk+.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- gtk+.spec	11 Jan 2007 16:30:33 -0000	1.5
+++ gtk+.spec	21 Apr 2009 13:43:21 -0000	1.6
@@ -1,89 +1,89 @@
-
-Summary: The GIMP ToolKit
-Name: 	 gtk+
-Epoch:	 1
-Version: 1.2.10
-Release: 56%{?dist}
-
-License: LGPL
-Group:	 System Environment/Libraries
-URL:	 http://www.gtk.org/
-Source:  ftp://ftp.gimp.org/pub/gtk/v1.2/gtk+-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Source1: gtkrc-default
-Source2: gtk+-pofiles.tar.gz
-Source3: gtkrc.ja.utf8
-Source4: gtkrc.ko.utf8
-Source5: gtkrc.zh_CN.utf8
-Source6: gtkrc.zh_TW.utf8
-
-Patch1: gtk+-1.2.6-ahiguti.patch
-Patch5: gtk+-1.2.8-wrap-alnum.patch
-# Supress alignment warnings on ia64
-Patch10: gtk+-1.2.10-alignment.patch
+Summary:	The GIMP ToolKit
+Name:		gtk+
+Epoch:		1
+Version:	1.2.10
+Release:	68%{?dist}
+License:	LGPLv2+
+Group:		System Environment/Libraries
+URL:		http://www.gtk.org/
+Source0:	ftp://ftp.gimp.org/pub/gtk/v1.2/gtk+-%{version}.tar.gz
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+Provides:	gtk1 = %{version}-%{release}
+
+Source1:	gtkrc-default
+Source2:	gtk+-pofiles.tar.gz
+Source3:	gtkrc.ja.utf8
+Source4:	gtkrc.ko.utf8
+Source5:	gtkrc.zh_CN.utf8
+Source6:	gtkrc.zh_TW.utf8
+
+Patch1:		gtk+-1.2.10-ahiguti.patch
+Patch5:		gtk+-1.2.8-wrap-alnum.patch
+# Suppress alignment warnings on ia64
+Patch10:	gtk+-1.2.10-alignment.patch
 # Improve exposure compression
-Patch11: gtk+-1.2.10-expose.patch
+Patch11:	gtk+-1.2.10-expose.patch
 # Handle focus tracking for embedded window properly
-Patch12: gtk+-1.2.10-focus.patch
+Patch12:	gtk+-1.2.10-focus.patch
 # Find gtkrc files for the current encoding better
-Patch13: gtk+-1.2.10-encoding.patch
+Patch13:	gtk+-1.2.10-encoding.patch
 # Don't screw up CTEXT encoding for UTF-8
-Patch14: gtk+-1.2.10-ctext.patch
+Patch14:	gtk+-1.2.10-ctext.patch
 # Don't warn about missing fonts for UTF-8
-Patch15: gtk+-1.2.10-utf8fontset.patch
+Patch15:	gtk+-1.2.10-utf8fontset.patch
 # Accept KP_Enter as a synonym for Return everywhere
-Patch16: gtk+-1.2.10-kpenter.patch
+Patch16:	gtk+-1.2.10-kpenter.patch
 # Allow theme switching to work properly when no windows are realized
-Patch17: gtk+-1.2.10-themeswitch.patch
+Patch17:	gtk+-1.2.10-themeswitch.patch
 # Fix crash when switching themes
-Patch18: gtk+-1.2.10-pixmapref.patch
+Patch18:	gtk+-1.2.10-pixmapref.patch
 # Fix computation of width of missing characters
-Patch19: gtk+-1.2.10-missingchar.patch
+Patch19:	gtk+-1.2.10-missingchar.patch
 # Fix sizes of Ukrainian fontsets
-Patch20: gtk+-1.2.10-ukfont.patch
+Patch20:	gtk+-1.2.10-ukfont.patch
 # Fix file selection delete-dir when changing directory problem
 # also, fix memory corruption problem when changing directories.
-Patch21: gtk+-1.2.10-deletedir.patch
+Patch21:	gtk+-1.2.10-deletedir.patch
 # Improve warning for missing fonts
-Patch22: gtk+-1.2.10-fontwarning.patch
+Patch22:	gtk+-1.2.10-fontwarning.patch
 # Allow themes to make scrollbar trough always repaint
-Patch23: gtk+-1.2.10-troughpaint.patch
+Patch23:	gtk+-1.2.10-troughpaint.patch
 # Fix a crash that can happen in some apps when the current
 # locale is not supported by XLib.
-Patch24: gtk+-1.2.10-localecrash.patch
+Patch24:	gtk+-1.2.10-localecrash.patch
 # Patch from CVS to fix b.g.o #56349
-Patch26: gtk+-1.2.10-dndorder.patch
+Patch26:	gtk+-1.2.10-dndorder.patch
 # Patch from CVS to fix b.g.o #94812
-Patch27: gtk+-1.2.10-clistfocusrow.patch
+Patch27:	gtk+-1.2.10-clistfocusrow.patch
 # Fix GTK+ to obey X server's default bell volume
-Patch28: gtk+-1.2.10-bellvolume.patch
+Patch28:	gtk+-1.2.10-bellvolume.patch
 # Hack up the configure scripts to deal with some obscure
 # breakage with ancient libtool
-Patch29: gtk+-1.2.10-libtool.patch
+Patch29:	gtk+-1.2.10-libtool.patch
 # Add a dependency on libgdk to libgtk (#106677)
-Patch30: gtk+-1.2.10-gtkgdkdep.patch
-Patch31: gtk+-underquoted.patch
-Patch32: gtk+-1.2.10-ppc64.patch
+Patch30:	gtk+-1.2.10-gtkgdkdep.patch
+Patch31:	gtk+-underquoted.patch
+Patch32:	gtk+-1.2.10-ppc64.patch
 # do not allow for undefined symbols in shared libraries -- Rex
-Patch33: gtk+-1.2.10-no_undefined.patch
+Patch33:	gtk+-1.2.10-no_undefined.patch
 # http://bugzilla.redhat.com/222298
-Patch34: gtk+-1.2.10-multilib.patch
-
-BuildRequires: glib-devel >= 1:%{version}
-## auto-req -- Rex
-#Requires:     glib >= 1:%{version}
-BuildRequires: automake14 autoconf213
-BuildRequires: libtool
-BuildRequires: gettext
+Patch34:	gtk+-1.2.10-multilib.patch
+# Remove redundant shared library dependencies
+Patch35:	gtk+-1.2.10-unused-deps.patch
+
+BuildRequires:	glib-devel >= 1:%{version}
+BuildRequires:	automake14 autoconf213
+BuildRequires:	libtool
+BuildRequires:	gettext
 %if 0%{?fedora} > 4 || 0%{?rhel} > 4
-%define x_deps  libX11-devel libXext-devel libXi-devel libXt-devel
+%global x_deps	libX11-devel libXext-devel libXi-devel libXt-devel
 %else
-%define x_deps	xorg-x11-devel
+%global x_deps	xorg-x11-devel
 ## This can be used for legacy too -- Rex
-#define	x_deps	Xree86-devel
+#global	x_deps	XFree86-devel
 %endif
-BuildRequires: %{x_deps} 
+BuildRequires:	%{x_deps} 
 
 %description
 The gtk+ package contains the GIMP ToolKit (GTK+), a library for
@@ -92,16 +92,18 @@
 processing program, but is now used by several other programs as
 well.
 
-%package devel
-Summary: Development tools for GTK+ (GIMP ToolKit) applications
-Group: Development/Libraries
-Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: glib-devel
-Requires: pkgconfig
-Requires: %{x_deps} 
+%package	devel
+Summary:	Development tools for GTK+ (GIMP ToolKit) applications
+Group:		Development/Libraries
+Provides:	gtk1-devel = %{version}-%{release}
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Requires:	glib-devel
+Requires:	pkgconfig
+Requires:	%{x_deps} 
 ## info files not included
 #Requires(post): /sbin/install-info
 #Requires(preun): /sbin/install-info
+
 %description devel
 Libraries, header files and documentation for developing GTK+ 
 (GIMP ToolKit) applications.
@@ -136,75 +138,86 @@
 %patch32 -p1 -b .ppc64
 %patch33 -p1 -b .no_undefined
 %patch34 -p1 -b .multilib
+%patch35 -p1 -b .unused-deps
 
-cp -f %{_datadir}/aclocal/libtool.m4 .
-libtoolize --copy --force
-automake-1.4
-aclocal-1.4
-autoconf-2.13
-autoheader-2.13
+# The original config.{guess,sub} do not work on x86_64
+#
+# The following /usr/lib cannot be %%_libdir !!
+%{__cp} -p /usr/lib/rpm/config.{guess,sub} .
 
+#%{__cp} -f %{_datadir}/aclocal/libtool.m4 .
+#/usr/bin/libtoolize --copy --force
+/usr/bin/automake-1.4
+#/usr/bin/aclocal-1.4
+/usr/bin/autoconf-2.13
+/usr/bin/autoheader-2.13
+
+# Recode docs as UTF-8
+for doc in ChangeLog examples/calendar/calendar.c; do
+	/usr/bin/iconv -f iso-8859-1 -t utf-8 < ${doc} > ${doc}.utf8
+	%{__mv} ${doc}.utf8 ${doc}
+done
 
 %build
+LIBTOOL=%{_bindir}/libtool \
 %configure \
-  --disable-static \
-  --with-xinput=xfree\
-  --with-native-locale
+	--disable-static \
+	--with-xinput=xfree \
+	--with-native-locale
 
-make %{?_smp_mflags} 
+%{__make} %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf %{buildroot}
 
-make install DESTDIR=$RPM_BUILD_ROOT 
+%{__make} install DESTDIR=%{buildroot} LIBTOOL=%{_bindir}/libtool INSTALL="%{__install} -p"
 
 #
 # Make cleaned-up versions of examples and tutorial for installation
 #
 ./mkinstalldirs tmpdocs/tutorial
-install -p -m0644 docs/html/gtk_tut.html docs/html/gtk_tut-[0-9]*.html docs/html/*.gif tmpdocs/tutorial
-for dir in examples/* ; do
-    if [ -d $dir ] ; then
-       ./mkinstalldirs tmpdocs/$dir
-       for file in $dir/* ; do
-          case $file in
-	     *pre1.2.7)
-	        ;;
-	     *)
-                install -p -m0644 $file tmpdocs/$dir
-		;;
-	  esac
-       done
-    fi
+%{__install} -p -m0644 docs/html/gtk_tut.html docs/html/gtk_tut-[0-9]*.html docs/html/*.gif tmpdocs/tutorial
+for dir in examples/*; do
+	if [ -d $dir ]; then
+		./mkinstalldirs tmpdocs/$dir
+		for file in $dir/* ; do
+			case $file in
+			*pre1.2.7)
+				;;
+			*)
+				%{__install} -p -m0644 $file tmpdocs/$dir
+				;;
+			esac
+		done
+	fi
 done
 
-install -p -m644 -D %{SOURCE1} $RPM_BUILD_ROOT/etc/gtk/gtkrc
+%{__install} -p -m644 -D %{SOURCE1} %{buildroot}/etc/gtk/gtkrc
 
 # Install some extra gtkrc files to improve functioning of GTK+
 # in UTF-8 locales for Chinese, Japanese, Korean.
-for i in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} ; do
-  install -p -m0644 $i $RPM_BUILD_ROOT/etc/gtk/
+for i in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
+	%{__install} -p -m0644 $i %{buildroot}/etc/gtk/
 done
 
 # We don't ship the info files
-rm -rf $RPM_BUILD_ROOT%{_infodir}
+%{__rm} -rf %{buildroot}%{_infodir}
 
 # .la fies... die die die.
-rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*.la
+%{__rm} -rf %{buildroot}%{_libdir}/lib*.la
 # despite use of --disable-static, delete static libs that get built anyway
-rm -f  $RPM_BUILD_ROOT%{_libdir}/lib*.a
+%{__rm} -rf %{buildroot}%{_libdir}/lib*.a
 
 %find_lang %{name}
 
 
-# I *know* ||: isn't needed, but this could end up used by legacy
-%check ||:
-make check 
+%check
+%{__make} check LIBTOOL=%{_bindir}/libtool
 
 
 %clean
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf %{buildroot}
 
 
 %post -p /sbin/ldconfig
@@ -216,7 +229,7 @@
 %defattr(-,root,root,-)
 %doc AUTHORS COPYING ChangeLog NEWS README TODO
 %{_libdir}/lib*.so.*
-%dir %{_datadir}/themes
+%dir %{_datadir}/themes/
 %{_datadir}/themes/Default/
 %dir %{_sysconfdir}/gtk/
 %config(noreplace) %{_sysconfdir}/gtk/*
@@ -234,6 +247,45 @@
 
 
 %changelog
+* Fri Apr 17 2009 Paul Howarth <paul at city-fan.org> 1:1.2.10-68
+- remove unused shared library dependencies
+- use install -p to maintain timestamps where reasonable
+- recode docs as UTF-8
+- cosmetic spec changes
+
+* Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> 1:1.2.10-67
+- rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Thu Oct  2 2008 Patrice Dumas <pertusus at free.fr> 1:1.2.10-66
+- rebase the ahiguti patch
+
+* Thu Oct  2 2008 Patrice Dumas <pertusus at free.fr> 1:1.2.10-65
+- remove x_ldflags from gtk-config (#462650)
+
+* Wed Oct  1 2008 Patrice Dumas <pertusus at free.fr> 1:1.2.10-64
+- copy config.* from rpm directory, those shipped with gtk+ are too old
+
+* Wed Oct 01 2008 Rex Dieter <rdieter at fedoraproject.org> 1:1.2.10-63
+- patch_fuzz, fix build (#465033)
+
+* Mon Mar 10 2008 Rex Dieter <rdieter at fedoraproject.org> 1:1.2.10-62
+- Provides: gtk1(-devel)
+
+* Mon Feb 18 2008 Rex Dieter <rdieter at fedoraproject.org> 1:1.2.10-61
+- fix multilib patch (#341401)
+
+* Mon Feb 11 2008 Rex Dieter <rdieter at fedoraproject.org> 1:1.2.10-60 
+- respin (gcc43)
+
+* Tue Aug 21 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1:1.2.10-59
+- respin (BuildID)
+
+* Sat Aug 11 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1:1.2.10-58
+- License: LGPLv2+
+
+* Thu Jan 11 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1:1.2.10-57
+- revert libtool-related breakage 
+
 * Thu Jan 11 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1:1.2.10-56
 - multilib patch (#222298)
 - cleanup auto*/libtool foo 
@@ -466,7 +518,7 @@
 - Up Epoch and release
 
 * Wed Jul 19 2000 Owen Taylor <otaylor at redhat.com>
-- Add BuildPreReq on glib = %{version}
+- Add BuildPreReq on glib = %%{version}
 
 * Thu Jul 13 2000 Prospector <bugzilla at redhat.com>
 - automatic rebuild
@@ -581,7 +633,7 @@
 - Fixed Source: to point to v1.1 
 
 * Tue Aug 04 1998 Michael Fulbright <msf at redhat.com>
-- change %postun to %preun
+- change %%postun to %%preun
 
 * Mon Jun 27 1998 Shawn T. Amundson
 - Changed version to 1.1.0


--- gtk+-1.2.6-ahiguti.patch DELETED ---




More information about the fedora-extras-commits mailing list