[csw-devel] SF.net SVN: gar:[16543] csw/mgar/pkg/gtk2/branches/2.24-raos

guengel at users.sourceforge.net guengel at users.sourceforge.net
Sat Dec 17 10:15:47 CET 2011


Revision: 16543
          http://gar.svn.sourceforge.net/gar/?rev=16543&view=rev
Author:   guengel
Date:     2011-12-17 09:15:46 +0000 (Sat, 17 Dec 2011)
Log Message:
-----------
gtk2/branches/2.24-raos: Use $(sysconfdir)/64 on 64bit platforms instead of the source code patch.

Modified Paths:
--------------
    csw/mgar/pkg/gtk2/branches/2.24-raos/Makefile

Added Paths:
-----------
    csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch

Removed Paths:
-------------
    csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
    csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Use-distinct-files-for-gtk.immodules-on-32-64bit-lib.patch

Modified: csw/mgar/pkg/gtk2/branches/2.24-raos/Makefile
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/Makefile	2011-12-17 08:03:49 UTC (rev 16542)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/Makefile	2011-12-17 09:15:46 UTC (rev 16543)
@@ -50,13 +50,6 @@
 # This disables a check that I wasn't able to fix
 PATCHFILES += 0000-Disable-gtk_test_create_widget-g_type_from_name-GtkT.patch
 
-# This patch makes gtk look for
-#
-# - gtk.immodules-64 on 64bit ISAs
-#
-# - gtk.immodules on 32bit ISAs
-PATCHFILES += 0000-Use-distinct-files-for-gtk.immodules-on-32-64bit-lib.patch
-
 # This patch adds a command line option `--update-modules` to
 # gtk-query-immodules-2.0 which has the default location of
 # gtk.immodules hardcoded and takes 32/64bit ISAs into account.
@@ -417,6 +410,13 @@
 
 BUILD64 = 1
 
+# This is because gtk.immodules resides in $(sysconfdir)/gtk-2.0. If
+# we don't take the memory model into account, 32/64 bit libs would
+# get the wrong IM Modules list in gtk.immodules (see also the pango
+# recipe).
+sysconfdir-suffix-64 = /64
+sysconfdir = /etc/opt/csw$(sysconfdir-suffix-$(MEMORYMODEL))
+
 # We need the binaries to query 64 bit modules
 MERGE_DIRS_isa-extra = $(bindir) $(libdir)
 

Deleted: csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch	2011-12-17 08:03:49 UTC (rev 16542)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch	2011-12-17 09:15:46 UTC (rev 16543)
@@ -1,76 +0,0 @@
-From 780bf4b7fe81f5ecb94858e43fe07c4374a1f441 Mon Sep 17 00:00:00 2001
-From: Rafael Ostertag <rafisol at opencsw.org>
-Date: Mon, 12 Dec 2011 22:00:33 +0100
-Subject: [PATCH] Add --update-modules cmd line option
-
----
- gtk/queryimmodules.c |   36 +++++++++++++++++++++++++++++++++++-
- 1 files changed, 35 insertions(+), 1 deletions(-)
-
-diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
-index 5369c7f..21611e4 100644
---- a/gtk/queryimmodules.c
-+++ b/gtk/queryimmodules.c
-@@ -23,6 +23,7 @@
- 
- #include <glib.h>
- #include <glib/gprintf.h>
-+#include <glib/gstdio.h>
- #include <gmodule.h>
- 
- #include <errno.h>
-@@ -30,6 +31,8 @@
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-+#include <fcntl.h>
-+#include <stdlib.h>
- 
- #ifdef USE_LA_MODULES
- #define SOEXT ".la"
-@@ -164,10 +167,41 @@ query_module (const char *dir, const char *name)
- int main (int argc, char **argv)
- {
-   char *cwd;
--  int i;
-+  int i, fd, retval;
-   char *path;
-+  char *gtk_immodules;
-   gboolean error = FALSE;
- 
-+  /*
-+   * Quick an dirty hack
-+   */
-+  if ( argc == 2 && strcmp("--update-modules", argv[1]) == 0 )
-+    {
-+#if defined(__amd64) || defined(__sparcv9)
-+      gtk_immodules = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules-64", NULL);
-+#else
-+      gtk_immodules = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
-+#endif
-+      fd = g_open(gtk_immodules, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-+      if ( fd == -1 )
-+	{
-+	  g_fprintf(stderr, "Cannot open %s.\n", gtk_immodules);
-+	  exit(1);
-+	}
-+
-+      if ( dup2(fd, STDOUT_FILENO) == -1 )
-+	{
-+	  g_fprintf(stderr, "Unable to redirect STDOUT.\n");
-+	  exit(1);
-+	}
-+
-+      /*
-+       * cheat, to make it think there are no arguments given
-+       */
-+      argc = 1;
-+    }
-+      
-+
-   g_printf ("# GTK+ Input Method Modules file\n"
- 	    "# Automatically generated file, do not edit\n"
- 	    "# Created by %s from gtk+-%d.%d.%d\n"
--- 
-1.7.6.1
-

Added: csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch	                        (rev 0)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch	2011-12-17 09:15:46 UTC (rev 16543)
@@ -0,0 +1,82 @@
+From c6d567e18c04b779d3d7b587b903c2cbf4d392e5 Mon Sep 17 00:00:00 2001
+From: Rafael Ostertag <rafisol at opencsw.org>
+Date: Sat, 17 Dec 2011 10:12:38 +0100
+Subject: [PATCH] Add --update-modules cmd line option
+
+---
+ gtk/queryimmodules.c |   42 +++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 41 insertions(+), 1 deletions(-)
+
+diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
+index 5369c7f..8287790 100644
+--- a/gtk/queryimmodules.c
++++ b/gtk/queryimmodules.c
+@@ -23,6 +23,7 @@
+ 
+ #include <glib.h>
+ #include <glib/gprintf.h>
++#include <glib/gstdio.h>
+ #include <gmodule.h>
+ 
+ #include <errno.h>
+@@ -30,6 +31,8 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#include <fcntl.h>
++#include <stdlib.h>
+ 
+ #ifdef USE_LA_MODULES
+ #define SOEXT ".la"
+@@ -164,10 +167,47 @@ query_module (const char *dir, const char *name)
+ int main (int argc, char **argv)
+ {
+   char *cwd;
+-  int i;
++  int i, fd, retval;
+   char *path;
++  char *gtk_immodules;
+   gboolean error = FALSE;
+ 
++  /*
++   * Quick an dirty hack.
++   *
++   * This will allow us to create the gtk.immodules in the default
++   * place by providing `--update-modules' as cmd line argument,
++   * without worrying where this might be when calling
++   * gtk-query-immodules-2.0 from a postinstall script.
++   *
++   * The basic idea is to redirect STDOUT to the default file and then
++   * let the normal flow of the program continue like there was no cmd
++   * line argument. Be aware, that this only works when no other cmd
++   * line options were passed.
++   */
++  if ( argc == 2 && strcmp("--update-modules", argv[1]) == 0 )
++    {
++      gtk_immodules = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
++      fd = g_open(gtk_immodules, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++      if ( fd == -1 )
++	{
++	  g_fprintf(stderr, "Cannot open %s.\n", gtk_immodules);
++	  exit(1);
++	}
++
++      if ( dup2(fd, STDOUT_FILENO) == -1 )
++	{
++	  g_fprintf(stderr, "Unable to redirect STDOUT.\n");
++	  exit(1);
++	}
++
++      /*
++       * cheat, to make it think there are no arguments given
++       */
++      argc = 1;
++    }
++      
++
+   g_printf ("# GTK+ Input Method Modules file\n"
+ 	    "# Automatically generated file, do not edit\n"
+ 	    "# Created by %s from gtk+-%d.%d.%d\n"
+-- 
+1.7.6.1
+

Deleted: csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Use-distinct-files-for-gtk.immodules-on-32-64bit-lib.patch
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Use-distinct-files-for-gtk.immodules-on-32-64bit-lib.patch	2011-12-17 08:03:49 UTC (rev 16542)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Use-distinct-files-for-gtk.immodules-on-32-64bit-lib.patch	2011-12-17 09:15:46 UTC (rev 16543)
@@ -1,35 +0,0 @@
-From d7e51a17837834806952718835254927669e55e6 Mon Sep 17 00:00:00 2001
-From: Rafael Ostertag <rafisol at opencsw.org>
-Date: Mon, 12 Dec 2011 20:10:28 +0100
-Subject: [PATCH] Use distinct files for gtk.immodules on 32/64bit libs
-
----
- gtk/gtkrc.c |   11 +++++++++++
- 1 files changed, 11 insertions(+), 0 deletions(-)
-
-diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
-index 82a6470..38b0176 100644
---- a/gtk/gtkrc.c
-+++ b/gtk/gtkrc.c
-@@ -450,7 +450,18 @@ gtk_rc_get_im_module_file (void)
-       if (im_module_file)
- 	result = g_strdup (im_module_file);
-       else
-+	/*
-+	 * Because we install 32/64 bit libraries concurrently, we
-+	 * need to have a separate gtk.immodules files.
-+	 *
-+	 * - gtk.immodules is for 32bit libs
-+	 * - gtk.immodules-64 is for 64bit libs
-+	 */
-+#if defined(__sparcv9) || defined(__amd64)
-+	result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules-64", NULL);
-+#else
- 	result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
-+#endif
-     }
- 
-   return result;
--- 
-1.7.6.1
-

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list