[gedit] Fix dbus and dconf issues for OS X



commit 0bf049d429da9ee53cac4b593e95ca1288e3b855
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Tue Jan 17 22:24:18 2012 +0100

    Fix dbus and dconf issues for OS X

 gedit/gedit-app-osx.c                              |    2 +-
 gedit/gedit-dbus.c                                 |   10 +++++-
 osx/README                                         |   18 +++++++--
 osx/gedit.bundle                                   |    1 +
 osx/jhbuild/gedit.modules                          |   21 ++++++++++-
 .../patches/dbus-relocatable-services.patch        |   37 ++++++++++++++++++++
 osx/launcher.sh                                    |    1 +
 osx/makebundle.sh                                  |   10 +++--
 osx/template.dmg                                   |  Bin 19345408 -> 19345408 bytes
 9 files changed, 88 insertions(+), 12 deletions(-)
---
diff --git a/gedit/gedit-app-osx.c b/gedit/gedit-app-osx.c
index 294c604..1c0f652 100644
--- a/gedit/gedit-app-osx.c
+++ b/gedit/gedit-app-osx.c
@@ -371,7 +371,7 @@ on_osx_open_files (GtkOSXApplication  *osxapp,
 	while (paths && *paths)
 	{
 		locations = g_slist_prepend (locations,
-		                             g_file_new_for_uri (*paths));
+		                             g_file_new_for_path (*paths));
 		++paths;
 	}
 	
diff --git a/gedit/gedit-dbus.c b/gedit/gedit-dbus.c
index 72a79c9..85c4702 100644
--- a/gedit/gedit-dbus.c
+++ b/gedit/gedit-dbus.c
@@ -1639,6 +1639,7 @@ GeditDBusResult
 gedit_dbus_run (GeditDBus *dbus)
 {
 	GeditCommandLine *command_line;
+	GMainContext *ctx;
 
 	g_return_val_if_fail (GEDIT_IS_DBUS (dbus), GEDIT_DBUS_RESULT_PROCEED);
 
@@ -1664,6 +1665,11 @@ gedit_dbus_run (GeditDBus *dbus)
 		}
 	}
 
+	ctx = g_main_context_new ();
+	g_main_context_push_thread_default (ctx);
+
+	dbus->priv->main_loop = g_main_loop_new (ctx, FALSE);
+
 	g_bus_own_name (G_BUS_TYPE_SESSION,
 	                "org.gnome.gedit",
 	                G_BUS_NAME_OWNER_FLAGS_NONE,
@@ -1675,10 +1681,12 @@ gedit_dbus_run (GeditDBus *dbus)
 
 	gedit_debug_message (DEBUG_DBUS, "Own name org.gnome.gedit\n");
 
-	dbus->priv->main_loop = g_main_loop_new (NULL, FALSE);
 	g_main_loop_run (dbus->priv->main_loop);
 	g_main_loop_unref (dbus->priv->main_loop);
 
+	g_main_context_pop_thread_default (ctx);
+	g_main_context_unref (ctx);
+
 	switch (dbus->priv->result)
 	{
 		case GEDIT_DBUS_RESULT_PROCEED:
diff --git a/osx/README b/osx/README
index d666391..4428273 100644
--- a/osx/README
+++ b/osx/README
@@ -1,6 +1,6 @@
 This is a guide to building gedit on OS X. This guide assumes that you are
 already familiar with building gtk+ software on OS X (natively) using jhbuild.
-Please make sure to read http://sourceforge.net/apps/trac/gtk-osx/wiki/Build
+Please make sure to read https://live.gnome.org/GTK%2B/OSX/Building
 before proceeding.
 
 Note: Terminal commands are preceded by dollar signs.
@@ -14,9 +14,19 @@ http://git.gnome.org/browse/gtk-osx/plain/gtk-osx-build-setup.sh
 $ curl -O http://git.gnome.org/browse/gtk-osx/plain/gtk-osx-build-setup.sh
 $ sh gtk-osx-build-setup.sh
 
-Make sure that you are not conflicting anything from fink/macports. If you
-are using fink/macports, you can add the following to your ~/.bashrc to
-remove any PATHS related to fink/macports when using jhbuild:
+Some of the newer releases of gnome software are only providing .xz packages.
+To be able to extract the contents of these packages, you will need to install
+xz utils. The easiest way to install is to use a dmg package available on:
+
+http://macpkg.sourceforge.net/
+
+Make sure to include /usr/local/bin in your PATH and alsothat you are not
+conflicting anything from fink/macports. If you are using fink/macports, you
+can add the following to your ~/.bashrc to remove any PATHS related to 
+fink/macports when using jhbuild:
+
+    # Add /usr/local/bin
+    export PATH="$PATH:/usr/local/bin"
 
     # Remove fink/macports path from PATH and store in local var origpath
     origpath=$(echo $PATH | sed -E -e 's;:?/opt/local/bin;;' -e 's;:?/opt/local/sbin;;')
diff --git a/osx/gedit.bundle b/osx/gedit.bundle
index ec73ad2..3f8734e 100644
--- a/osx/gedit.bundle
+++ b/osx/gedit.bundle
@@ -73,6 +73,7 @@
   <!-- DBUS -->
   <binary>${prefix}/bin/dbus-*</binary>
   <data>${prefix}/etc/dbus-1</data>
+  <data>${prefix}/share/dbus-1</data>
   <binary>${prefix}/libexec/dbus-daemon-launch-helper</binary>
 
   <!-- Copy in peas modules -->
diff --git a/osx/jhbuild/gedit.modules b/osx/jhbuild/gedit.modules
index 633c9c6..9d2cbb6 100644
--- a/osx/jhbuild/gedit.modules
+++ b/osx/jhbuild/gedit.modules
@@ -20,6 +20,9 @@
               href="http://www.abisource.com/downloads/enchant/"; />
   <repository type="tarball" name="sourceware.org"
                 href="ftp://sourceware.org/pub/"/>
+  <repository type="tarball" name="dbus.freedesktop.org"
+	      href="http://dbus.freedesktop.org/releases/"/>
+
   <autotools id="iso-codes" autogen-sh="configure" >
     <branch repo="iso-codes" version="3.32"
             module="iso-codes-3.32.tar.bz2"/>
@@ -104,7 +107,7 @@
     </dependencies>
   </autotools>
 
-  <autotools id="dconf">
+  <autotools id="dconf" autogen-sh="autoreconf">
     <branch module="dconf/0.10/dconf-0.10.0.tar.bz2"
             version="0.10.0"
             hash="sha256:4b034e9e5560ab703f60bb2b6dc1ada7856416660af7dd1207c2c3ab9c9d533b">
@@ -256,6 +259,20 @@
     </dependencies>
   </autotools>
 
+  <autotools id="dbus" autogen-sh='configure'
+	   autogenargs="--disable-selinux --without-x --disable-launchd
+	   --with-session-socket-dir=/var/tmp">
+    <branch module="dbus/dbus-1.4.1.tar.gz"  version="1.4.1"
+	    repo="dbus.freedesktop.org">
+      <patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/dbus-install.patch"/>
+      <patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/dbus-msg-nosignal.patch"; strip="1"/>
+      <patch file="http://git.gnome.org/browse/gedit/plain/osx/jhbuild/patches/dbus-relocatable-services.patch"; strip="1"/>
+    </branch>
+    <after>
+      <dep package="gtk+-3.0"/>
+    </after>
+  </autotools>
+ 
   <autotools id="libgcrypt" autogen-sh="configure" autogenargs="--disable-asm --disable-aesni-support">
     <branch repo='ftp.gnupg.org' version='1.5.0'
 	    module='gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2'/>
@@ -265,7 +282,7 @@
   </autotools>
 
   <autotools id="gedit" autogenargs="DATADIRNAME=share">
-    <branch module="gedit" revision="3.2.6-osx-2"/>
+    <branch repo="git.gnome.org" module="gedit" revision="gnome-3-2-osx"/>
     <dependencies>
       <dep package="meta-gtk-osx-bootstrap"/>
       <dep package="meta-gtk-osx-gtk3"/>
diff --git a/osx/jhbuild/patches/dbus-relocatable-services.patch b/osx/jhbuild/patches/dbus-relocatable-services.patch
new file mode 100644
index 0000000..e51e6df
--- /dev/null
+++ b/osx/jhbuild/patches/dbus-relocatable-services.patch
@@ -0,0 +1,37 @@
+--- a/dbus/dbus-sysdeps-unix.c	2010-12-16 14:53:48.000000000 +0100
++++ b/dbus/dbus-sysdeps-unix.c	2012-01-17 13:24:13.000000000 +0100
+@@ -55,6 +55,7 @@
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <grp.h>
++#include <limits.h>
+ 
+ #ifdef HAVE_ERRNO_H
+ #include <errno.h>
+@@ -3828,7 +3829,25 @@
+ const char *
+ _dbus_replace_install_prefix (const char *configure_time_path)
+ {
+-  return configure_time_path;
++  const char *runtime_prefix;
++  static char retval[PATH_MAX];
++
++  if (!configure_time_path)
++    return NULL;
++
++  runtime_prefix = getenv ("DBUS_REPLACE_INSTALL_PREFIX");
++
++  if (!runtime_prefix ||
++       strncmp (configure_time_path, DBUS_PREFIX "/",
++                strlen (DBUS_PREFIX) + 1)) {
++     strcat (retval, configure_time_path);
++     return retval;
++  }
++
++  strncpy (retval, runtime_prefix, PATH_MAX - 1);
++  strncat (retval, configure_time_path + strlen (DBUS_PREFIX) + 1, PATH_MAX - 1 - strlen (runtime_prefix));
++
++  return retval;
+ }
+ 
+ /* tests in dbus-sysdeps-util.c */
diff --git a/osx/launcher.sh b/osx/launcher.sh
index f34f724..26b84c0 100755
--- a/osx/launcher.sh
+++ b/osx/launcher.sh
@@ -37,6 +37,7 @@ export PYTHONPATH="$bundle_lib/python2.6/site-packages:$PYTHONPATH"
 export PANGO_LIBDIR="$bundle_lib"
 export PANGO_SYSCONFDIR="$bundle_etc"
 export PEAS_PLUGIN_LOADERS_DIR="$bundle_lib/libpeas-1.0/loaders"
+export DBUS_REPLACE_INSTALL_PREFIX="$bundle_res/"
 
 if test -f "$bundle_lib/charset.alias"; then
 	export CHARSETALIASDIR="$bundle_lib"
diff --git a/osx/makebundle.sh b/osx/makebundle.sh
index 75d4a54..410c2c0 100755
--- a/osx/makebundle.sh
+++ b/osx/makebundle.sh
@@ -4,7 +4,9 @@ if [ -d gedit.app ] && [ "$1x" = "-fx" ]; then
 	rm -rf gedit.app
 fi
 
-gtk-mac-bundler gedit.bundle
+if [ ! -d gedit.app ]; then
+    gtk-mac-bundler gedit.bundle
+fi
 
 function do_strip {
     tp=$(file -b --mime-type "$1")
@@ -18,9 +20,9 @@ function do_strip {
     
     strip -o "$name" -S "$1"
     mv -f "$name" "$1"
-    
+
     chmod "$st" "$1"
-	chmod u+w "$1"
+    chmod u+w "$1"
 }
 
 echo "Removing unneeded files from bundle"
@@ -33,7 +35,7 @@ done
 echo "Strip debug symbols from bundle binaries"
 
 # Strip debug symbols
-for i in $(find gedit.app/Contents/Resources -type f -regex '\.(so|dylib)$'); do
+for i in $(find -E gedit.app/Contents/Resources -type f -regex '.*\.(so|dylib)$'); do
     do_strip "$i"
 done
 
diff --git a/osx/template.dmg b/osx/template.dmg
index 9f79d71..6225747 100644
Binary files a/osx/template.dmg and b/osx/template.dmg differ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]