public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in x11-libs/gtk+/files: gtk+-3.4.4-isnan.patch gtk+-2.24.13-gtk3-bookmarks.patch
@ 2012-11-05  1:10 Alexandre Rostovtsev (tetromino)
  0 siblings, 0 replies; only message in thread
From: Alexandre Rostovtsev (tetromino) @ 2012-11-05  1:10 UTC (permalink / raw
  To: gentoo-commits

tetromino    12/11/05 01:10:44

  Added:                gtk+-3.4.4-isnan.patch
                        gtk+-2.24.13-gtk3-bookmarks.patch
  Log:
  Fix 3.4.4 build failure with uclibc (bug #441634, thanks to Anthony Basile). For 2.24.13-r1, share bookmarks with gtk3, and do not install obsolete env.d file (bug #431018, thanks to Hans). UI tests in gtk2 fail if immodules are not already installed (bug #413185, thanks to Patrick Lauer).
  
  (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)

Revision  Changes    Path
1.1                  x11-libs/gtk+/files/gtk+-3.4.4-isnan.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.4-isnan.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.4-isnan.patch?rev=1.1&content-type=text/plain

Index: gtk+-3.4.4-isnan.patch
===================================================================
From d6aee922bb5da8254fafdf605951cf5b0150537d Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 15 May 2012 13:09:24 +0200
Subject: [PATCH] Bug 676087-configure.ac: isnan() and isinf() are macros, not
 functions

The isnan() and isinf() are C99 macros not functions so use
AC_CHECK_DECL instead of AC_CHECK_FUNCS for those.
---
 configure.ac       | 3 ++-
 gdk/fallback-c89.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 857d015..c801dd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -751,7 +751,8 @@ AC_TYPE_UID_T
 
 # Check for round(), rint(), isnan(), isinf() and nearbyint()
 AC_CHECK_LIB(m,round,,)
-AC_CHECK_FUNCS(round rint isnan isinf nearbyint)
+AC_CHECK_FUNCS(round rint nearbyint)
+AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
 
 # Checks for gdkspawn
 AC_CHECK_HEADERS(crt_externs.h)
diff --git a/gdk/fallback-c89.c b/gdk/fallback-c89.c
index 35dea77..b150044 100644
--- a/gdk/fallback-c89.c
+++ b/gdk/fallback-c89.c
@@ -19,7 +19,7 @@
 
 #include <float.h>
 
-#ifndef HAVE_ISNAN
+#ifndef HAVE_DECL_ISNAN
 /* it seems of the supported compilers only
  * MSVC does not have isnan(), but it does
  * have _isnan() which does the same as isnan()
@@ -31,7 +31,7 @@ isnan (double x)
 }
 #endif
 
-#ifndef HAVE_ISINF
+#ifndef HAVE_DECL_ISINF
 /* Unfortunately MSVC does not have finite()
  * but it does have _finite() which is the same
  * as finite() except when x is a NaN
-- 
1.7.12.4




1.1                  x11-libs/gtk+/files/gtk+-2.24.13-gtk3-bookmarks.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-2.24.13-gtk3-bookmarks.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-2.24.13-gtk3-bookmarks.patch?rev=1.1&content-type=text/plain

Index: gtk+-2.24.13-gtk3-bookmarks.patch
===================================================================
From de89546e30db83e6e10f72062b3b5c38814bb64d Mon Sep 17 00:00:00 2001
From: Cosimo Cecchi <cosimoc@gnome.org>
Date: Fri, 27 Apr 2012 12:57:50 -0400
Subject: [PATCH] Use bookmarks file from gtk-3.0 XDG config dir if present

Will read from old location if new location isn't found, and will always
write back to the original location the file was read from.

Adapted from commit ceb3fecd117293387547c284e8294e4cddaa8f17 on the
master branch, based on a patch from
William Jon McCann <jmccann@redhat.com>
---
 gtk/gtkfilesystem.c | 69 +++++++++++++++++++++++++++++++++++------------------
 1 file changed, 46 insertions(+), 23 deletions(-)

diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c
index f2897d2..4871904 100644
--- a/gtk/gtkfilesystem.c
+++ b/gtk/gtkfilesystem.c
@@ -92,6 +92,7 @@ struct GtkFileSystemPrivate
 
   /* This list contains GtkFileSystemBookmark structs */
   GSList *bookmarks;
+  GFile *bookmarks_file;
 
   GFileMonitor *bookmarks_monitor;
 };
@@ -206,6 +207,9 @@ gtk_file_system_finalize (GObject *object)
       g_slist_free (priv->bookmarks);
     }
 
+  if (priv->bookmarks_file)
+    g_object_unref (priv->bookmarks_file);
+
   G_OBJECT_CLASS (_gtk_file_system_parent_class)->finalize (object);
 }
 
@@ -239,7 +243,7 @@ _gtk_file_system_class_init (GtkFileSystemClass *class)
 }
 
 static GFile *
-get_bookmarks_file (void)
+get_legacy_bookmarks_file (void)
 {
   GFile *file;
   gchar *filename;
@@ -251,6 +255,19 @@ get_bookmarks_file (void)
   return file;
 }
 
+static GFile *
+get_bookmarks_file (void)
+{
+  GFile *file;
+  gchar *filename;
+
+  filename = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "bookmarks", NULL);
+  file = g_file_new_for_path (filename);
+  g_free (filename);
+
+  return file;
+}
+
 static GSList *
 read_bookmarks (GFile *file)
 {
@@ -301,6 +318,8 @@ save_bookmarks (GFile  *bookmarks_file,
   GError *error = NULL;
   GString *contents;
   GSList *l;
+  GFile *parent_file;
+  gchar *path;
 
   contents = g_string_new ("");
 
@@ -322,16 +341,22 @@ save_bookmarks (GFile  *bookmarks_file,
       g_free (uri);
     }
 
-  if (!g_file_replace_contents (bookmarks_file,
-				contents->str,
-				strlen (contents->str),
-				NULL, FALSE, 0, NULL,
-				NULL, &error))
+  parent_file = g_file_get_parent (bookmarks_file);
+  path = g_file_get_path (parent_file);
+  if (g_mkdir_with_parents (path, 0700) == 0)
     {
-      g_critical ("%s", error->message);
-      g_error_free (error);
+      if (!g_file_replace_contents (bookmarks_file,
+                                    contents->str,
+                                    strlen (contents->str),
+                                    NULL, FALSE, 0, NULL,
+                                    NULL, &error))
+        {
+          g_critical ("%s", error->message);
+          g_error_free (error);
+        }
     }
-
+  g_free (path);
+  g_object_unref (parent_file);
   g_string_free (contents, TRUE);
 }
 
@@ -579,6 +604,14 @@ _gtk_file_system_init (GtkFileSystem *file_system)
   /* Bookmarks */
   bookmarks_file = get_bookmarks_file ();
   priv->bookmarks = read_bookmarks (bookmarks_file);
+  if (!priv->bookmarks)
+    {
+      /* Use the legacy file instead */
+      g_object_unref (bookmarks_file);
+      bookmarks_file = get_legacy_bookmarks_file ();
+      priv->bookmarks = read_bookmarks (bookmarks_file);
+    }
+
   priv->bookmarks_monitor = g_file_monitor_file (bookmarks_file,
 						 G_FILE_MONITOR_NONE,
 						 NULL, &error);
@@ -591,7 +624,7 @@ _gtk_file_system_init (GtkFileSystem *file_system)
     g_signal_connect (priv->bookmarks_monitor, "changed",
 		      G_CALLBACK (bookmarks_file_changed), file_system);
 
-  g_object_unref (bookmarks_file);
+  priv->bookmarks_file = g_object_ref (bookmarks_file);
 }
 
 /* GtkFileSystem public methods */
@@ -1097,7 +1130,6 @@ _gtk_file_system_insert_bookmark (GtkFileSystem  *file_system,
   GSList *bookmarks;
   GtkFileSystemBookmark *bookmark;
   gboolean result = TRUE;
-  GFile *bookmarks_file;
 
   priv = GTK_FILE_SYSTEM_GET_PRIVATE (file_system);
   bookmarks = priv->bookmarks;
@@ -1134,10 +1166,7 @@ _gtk_file_system_insert_bookmark (GtkFileSystem  *file_system,
   bookmark->file = g_object_ref (file);
 
   priv->bookmarks = g_slist_insert (priv->bookmarks, bookmark, position);
-
-  bookmarks_file = get_bookmarks_file ();
-  save_bookmarks (bookmarks_file, priv->bookmarks);
-  g_object_unref (bookmarks_file);
+  save_bookmarks (priv->bookmarks_file, priv->bookmarks);
 
   g_signal_emit (file_system, fs_signals[BOOKMARKS_CHANGED], 0);
 
@@ -1153,7 +1182,6 @@ _gtk_file_system_remove_bookmark (GtkFileSystem  *file_system,
   GtkFileSystemBookmark *bookmark;
   GSList *bookmarks;
   gboolean result = FALSE;
-  GFile *bookmarks_file;
 
   priv = GTK_FILE_SYSTEM_GET_PRIVATE (file_system);
 
@@ -1193,9 +1221,7 @@ _gtk_file_system_remove_bookmark (GtkFileSystem  *file_system,
       return FALSE;
     }
 
-  bookmarks_file = get_bookmarks_file ();
-  save_bookmarks (bookmarks_file, priv->bookmarks);
-  g_object_unref (bookmarks_file);
+  save_bookmarks (priv->bookmarks_file, priv->bookmarks);
 
   g_signal_emit (file_system, fs_signals[BOOKMARKS_CHANGED], 0);
 
@@ -1239,7 +1265,6 @@ _gtk_file_system_set_bookmark_label (GtkFileSystem *file_system,
 {
   GtkFileSystemPrivate *priv;
   gboolean changed = FALSE;
-  GFile *bookmarks_file;
   GSList *bookmarks;
 
   DEBUG ("set_bookmark_label");
@@ -1263,9 +1288,7 @@ _gtk_file_system_set_bookmark_label (GtkFileSystem *file_system,
 	}
     }
 
-  bookmarks_file = get_bookmarks_file ();
-  save_bookmarks (bookmarks_file, priv->bookmarks);
-  g_object_unref (bookmarks_file);
+  save_bookmarks (priv->bookmarks_file, priv->bookmarks);
 
   if (changed)
     g_signal_emit_by_name (file_system, "bookmarks-changed", 0);
-- 
1.8.0






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-05  1:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05  1:10 [gentoo-commits] gentoo-x86 commit in x11-libs/gtk+/files: gtk+-3.4.4-isnan.patch gtk+-2.24.13-gtk3-bookmarks.patch Alexandre Rostovtsev (tetromino)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox