[gimp/osx-build: 26/55] Run GIMP in a D-Bus session



commit d4831766aebb050142518f71716eff2b3ef2dd6d
Author: Sven Claussner <sclaussner src gnome org>
Date:   Sun May 25 01:23:57 2014 +0200

    Run GIMP in a D-Bus session
    
    For instance see bug 683177: when trying to access the online help
    users got an error message, that GIO backends were missing and they
    needed to install GVFS.
    Actually the GIO backend GVFS is there, but had no D-Bus connection
    (GVFS relies on D-Bus behind the scenes).
    This fix updates some packages and ensures that GIMP always runs in a
    D-Bus session and thus the online help is accessible.

 build/osx/gimp.modules              |   25 ++++++++----------
 build/osx/launcher-2.8-python.sh    |   49 ++++++++++++++--------------------
 build/osx/launcher-master-python.sh |   49 ++++++++++++++--------------------
 3 files changed, 51 insertions(+), 72 deletions(-)
---
diff --git a/build/osx/gimp.modules b/build/osx/gimp.modules
old mode 100755
new mode 100644
index e20897e..235e5a1
--- a/build/osx/gimp.modules
+++ b/build/osx/gimp.modules
@@ -373,8 +373,6 @@
        </autotools>
 
        <autotools id="glib" autogenargs="--with-libiconv=native --enable-gtk-doc=no">
-               <!-- branch module="glib/2.39/glib-2.39.1.tar.xz" version="2.39.1" 
hash="sha256:d08c976f5560693946251361f186e3c9243c8195a95417127c1b1970c8371153"> 
-                       </branch -->
                <branch repo="git.gnome.org" module="glib" revision="glib-2-40" />
                <dependencies>
                        <dep package="libffi" />
@@ -494,9 +492,9 @@
        </autotools>
 
        <autotools id="gvfs" autogen-sh="configure"
-               autogenargs="--disable-avahi --disable-fuse --disable-hal --disable-cdda --disable-obexftp 
--disable-gphoto2 --disable-samba --disable-udev --disable-gdu --disable-udisks2 --disable-libsystemd-login 
--disable-gudev --disable-afc --disable-goa --disable-bluray --disable-libmtp --enable-http --enable-archive 
--enable-afp --disable-silent-rules">
-               <branch module="gvfs/1.19/gvfs-1.19.1.tar.xz" version="1.19.1"
-                       hash="sha256:014ea3b244cb6bb6d375f3751c35aad86abbbd7353e9761581e750f3c11d5db3">
+               autogenargs="--disable-avahi --disable-fuse --disable-hal --disable-cdda --disable-obexftp 
--disable-gphoto2 --enable-samba --disable-udev --disable-gdu --disable-udisks2 --disable-libsystemd-login 
--disable-gudev --disable-afc --disable-goa --disable-bluray --disable-libmtp --enable-http --enable-archive 
--enable-afp --disable-silent-rules">
+               <branch module="gvfs/1.21/gvfs-1.21.2.tar.xz" version="1.21.2"
+                       hash="sha256:aadf18dea818bdd1fd14856e56a30171bd9f89ce5e36591ab8c74d10199e0142">
                        <!--<patch 
file="https://dl.dropboxusercontent.com/u/942685/files/gvfs/patch-gconf-gapplookupgconf.h.diff"; 
                                strip="0"/> -->
                </branch>
@@ -745,7 +743,7 @@
 
        <autotools id="dbus" autogen-sh="configure"
                autogenargs="--disable-doxygen-docs --disable-xml-docs --disable-selinux --without-x 
--disable-tests --enable-verbose-mode --enable-asserts">
-               <branch module="dbus/dbus-1.7.8.tar.gz" version="1.7.8" repo="dbus">
+               <branch module="dbus/dbus-1.8.2.tar.gz" version="1.8.2" repo="dbus">
                </branch>
                <dependencies>
                </dependencies>
@@ -765,7 +763,7 @@
 
        <autotools id="dbus-glib" autogen-sh="configure"
                autogenargs="--enable-asserts --enable-verbose-mode">
-               <branch module="dbus-glib/dbus-glib-0.100.tar.gz" version="0.100"
+               <branch module="dbus-glib/dbus-glib-0.102.tar.gz" version="0.102"
                        repo="dbus" />
                <dependencies>
                        <dep package="dbus" />
@@ -1038,14 +1036,14 @@
        <autotools id="berkeleydb" autogen-sh="dist/configure"
                autogen-template="pwd; cd build_unix; pwd; ../%(autogen-sh)s --prefix %(prefix)s --libdir 
%(libdir)s %(autogenargs)s"
                makeargs="-C build_unix" makeinstallargs="-C build_unix install">
-               <branch module="berkeley-db/db-6.0.20.tar.gz" version="6.0.20"
-                       repo="oracle" checkoutdir="db-6.0.20" />
+               <branch module="berkeley-db/db-6.0.30.tar.gz" version="6.0.30"
+                       repo="oracle" checkoutdir="db-6.0.30" />
        </autotools>
 
        <autotools id="python" autogenargs="--enable-shared"
                autogen-sh="configure">
-               <branch repo="python" module="2.7.5/Python-2.7.5.tar.xz"
-                       version="2.7.5">
+               <branch repo="python" module="2.7.6/Python-2.7.6.tar.xz"
+                       version="2.7.6">
                </branch>
                <dependencies>
                        <dep package="berkeleydb" />
@@ -1066,9 +1064,8 @@
 
        <autotools id="gobject-introspection">
                <branch
-                       module="gobject-introspection/1.38/gobject-introspection-1.38.0.tar.xz"
-                       version="1.38.0"
-                       hash="sha256:3575e5d353c17a567fdf7ffaaa7aebe9347b5b0eee8e69d612ba56a9def67d73">
+                       module="gobject-introspection/1.40/gobject-introspection-1.40.0.tar.xz"
+                       version="1.40.0">
                </branch>
                <dependencies>
                        <dep package="glib" />
diff --git a/build/osx/launcher-2.8-python.sh b/build/osx/launcher-2.8-python.sh
index f3cee9a..da68ea1 100755
--- a/build/osx/launcher-2.8-python.sh
+++ b/build/osx/launcher-2.8-python.sh
@@ -54,9 +54,7 @@ export FONTCONFIG_FILE="$bundle_etc/fonts/fonts.conf"
 export GEGL_PATH="$bundle_lib/gegl-0.2"
 
 # Set up Python
-
 echo "Enabling internal Python..."
-
 export PYTHONHOME="$bundle_res"
 
 # Add bundled Python modules
@@ -67,26 +65,8 @@ PYTHONPATH="$bundle_lib/pygtk/2.0:$PYTHONPATH"
 
 # Include gimp python modules
 PYTHONPATH="$bundle_lib/gimp/2.0/python:$PYTHONPATH"
-export PYTHONPATH
-
-# Activate D-Bus
-
-#echo "Activating dbus..."
-
-# Launch dbus if needed
-#dbusenv="$TMPDIR/gimp-$USER.dbus"
-
-#if [ -f "$dbusenv" ]; then
-#    source "$dbusenv"
-#fi
 
-#if [ -z "$DBUS_SESSION_BUS_PID" ] || ! ps -p "$DBUS_SESSION_BUS_PID" >/dev/null; then
-#    "$bundle_bin/dbus-launch" --config-file "$bundle_etc/dbus-1/session.conf" > "$dbusenv"
-#    source "$dbusenv"
-#fi
-
-#export DBUS_SESSION_BUS_PID
-#export DBUS_SESSION_BUS_ADDRESS
+export PYTHONPATH
 
 # Specify Ghostscript directories
 # export GS_RESOURCE_DIR="$bundle_res/share/ghostscript/9.06/Resource"
@@ -96,24 +76,35 @@ export PYTHONPATH
 
 # set up character encoding aliases
 if test -f "$bundle_lib/charset.alias"; then
-export CHARSETALIASDIR="$bundle_lib"
+ export CHARSETALIASDIR="$bundle_lib"
 fi
 
 # Extra arguments can be added in environment.sh.
 EXTRA_ARGS=
 if test -f "$bundle_res/environment.sh"; then
-source "$bundle_res/environment.sh"
+ source "$bundle_res/environment.sh"
 fi
 
 # Strip out the argument added by the OS.
 if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
-shift 1
+ shift 1
 fi
 
-echo "Launching GIMP..."
-$EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
 
-#"$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
+echo "Launching GIMP in a D-Bus session..."
+
+# Test for an existing D-Bus daemon and if there, reuse it.
+# Otherwise launch a new exclusive D-Bus daemon with an exclusive session 
+# and run GIMP within it.
+# Taken and adapted from  http://dbus.freedesktop.org/doc/dbus-launch.1.html
+if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
+  $bundle_bin/dbus-launch --sh-syntax --exit-with-session \
+  --config-file "$bundle_etc/dbus-1/session.conf" \
+  "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
+else
+  $EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
+fi
+
 
-#echo "Cleaning up..."
-#killall dbus-daemon
+echo "Cleaning up..."
+$bundle_bin/dbus-cleanup-sockets /var/tmp
\ No newline at end of file
diff --git a/build/osx/launcher-master-python.sh b/build/osx/launcher-master-python.sh
index 1b37e4e..7db4ad2 100755
--- a/build/osx/launcher-master-python.sh
+++ b/build/osx/launcher-master-python.sh
@@ -54,9 +54,7 @@ export FONTCONFIG_FILE="$bundle_etc/fonts/fonts.conf"
 export GEGL_PATH="$bundle_lib/gegl-0.3"
 
 # Set up Python
-
 echo "Enabling internal Python..."
-
 export PYTHONHOME="$bundle_res"
 
 # Add bundled Python modules
@@ -67,26 +65,8 @@ PYTHONPATH="$bundle_lib/pygtk/2.0:$PYTHONPATH"
 
 # Include gimp python modules
 PYTHONPATH="$bundle_lib/gimp/2.0/python:$PYTHONPATH"
-export PYTHONPATH
-
-# Activate D-Bus
-
-#echo "Activating dbus..."
-
-# Launch dbus if needed
-#dbusenv="$TMPDIR/gimp-$USER.dbus"
-
-#if [ -f "$dbusenv" ]; then
-#    source "$dbusenv"
-#fi
 
-#if [ -z "$DBUS_SESSION_BUS_PID" ] || ! ps -p "$DBUS_SESSION_BUS_PID" >/dev/null; then
-#    "$bundle_bin/dbus-launch" --config-file "$bundle_etc/dbus-1/session.conf" > "$dbusenv"
-#    source "$dbusenv"
-#fi
-
-#export DBUS_SESSION_BUS_PID
-#export DBUS_SESSION_BUS_ADDRESS
+export PYTHONPATH
 
 # Specify Ghostscript directories
 # export GS_RESOURCE_DIR="$bundle_res/share/ghostscript/9.06/Resource"
@@ -96,24 +76,35 @@ export PYTHONPATH
 
 # set up character encoding aliases
 if test -f "$bundle_lib/charset.alias"; then
-export CHARSETALIASDIR="$bundle_lib"
+ export CHARSETALIASDIR="$bundle_lib"
 fi
 
 # Extra arguments can be added in environment.sh.
 EXTRA_ARGS=
 if test -f "$bundle_res/environment.sh"; then
-source "$bundle_res/environment.sh"
+ source "$bundle_res/environment.sh"
 fi
 
 # Strip out the argument added by the OS.
 if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
-shift 1
+ shift 1
 fi
 
-echo "Launching GIMP..."
-$EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
 
-#"$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
+echo "Launching GIMP in a D-Bus session..."
+
+# Test for an existing D-Bus daemon and if there, reuse it.
+# Otherwise launch a new exclusive D-Bus daemon with an exclusive session 
+# and run GIMP within it.
+# Taken and adapted from  http://dbus.freedesktop.org/doc/dbus-launch.1.html
+if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
+  $bundle_bin/dbus-launch --sh-syntax --exit-with-session \
+  --config-file "$bundle_etc/dbus-1/session.conf" \
+  "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
+else
+  $EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
+fi
+
 
-#echo "Cleaning up..."
-#killall dbus-daemon
+echo "Cleaning up..."
+$bundle_bin/dbus-cleanup-sockets /var/tmp
\ No newline at end of file


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