[empathy] Run from the source directory without installing



commit aeab15ec37370f3c3aa8b4e1a4aec480109a6803
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Tue Mar 6 00:04:51 2012 +0100

    Run from the source directory without installing
    
    Use the tools/empathy-env wrapper to set an appropriate environment
    and launch the compiled programs without installing them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671447

 HACKING              |    8 ++++----
 data/.gitignore      |    1 +
 data/Makefile.am     |    8 ++++++++
 tools/.gitignore     |    1 +
 tools/Makefile.am    |    7 ++++++-
 tools/empathy-env.in |    9 +++++++++
 6 files changed, 29 insertions(+), 5 deletions(-)
---
diff --git a/HACKING b/HACKING
index bae9b0b..b486e33 100644
--- a/HACKING
+++ b/HACKING
@@ -6,16 +6,16 @@ Empathy is split in different processes:
 - src/empathy-debugger: debug tool
 
 Each process can be run directly from source without having to be installed to
-its prefix. You just have to define the environment variable EMPATHY_SRCDIR
-to the path of your empathy source dir. For example:
-  export EMPATHY_SRCDIR=/home/cassidy/gnome/empathy
+its prefix. You just have to define an appropriate environment using the
+wrapper found in the tools/ directory.. For example:
+  ./tools/empathy-env ./src/empathy
 
 The chat and call UI are automatically started by telepathy-mission-control
 when receiving or requesting a chat/call. In order to use your custom version
 you have to kill any existing instance of empathy-{chat,call} and then start
 it with EMPATHY_PERSIST=1 to prevent it from auto exiting if there is no
 channel to handle. For example:
-  EMPATHY_PERSIST=1 ./src/empathy-chat
+  EMPATHY_PERSIST=1 ./tools/empathy-env ./src/empathy-chat
 
 Debugging can be turned on using EMPATHY_DEBUG=all and logged to a file
 with EMPATHY_LOGFILE=/tmp/empathy.log
diff --git a/data/.gitignore b/data/.gitignore
index e004da8..2c0f332 100644
--- a/data/.gitignore
+++ b/data/.gitignore
@@ -2,6 +2,7 @@ empathy.desktop
 empathy.desktop.in
 org.gnome.Empathy.gschema.valid
 org.gnome.Empathy.gschema.xml
+gschemas.compiled
 org.freedesktop.Telepathy.Client.Empathy.Chat.service
 org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service
 org.freedesktop.Telepathy.Client.Empathy.Call.service
diff --git a/data/Makefile.am b/data/Makefile.am
index f3da574..a2be750 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -15,6 +15,13 @@ gsettings_SCHEMAS = $(gsettings_files:.xml.in=.xml)
 @INTLTOOL_XML_NOMERGE_RULE@
 @GSETTINGS_RULES@
 
+# We need to compile schemas at make time
+# to run from source tree
+gschemas.compiled: $(gsettings_SCHEMAS:.xml=.valid)
+	$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --targetdir=. .
+
+all-local: gschemas.compiled
+
 convertdir = $(datarootdir)/GConf/gsettings
 convert_DATA = \
 	empathy.convert
@@ -82,4 +89,5 @@ DISTCLEANFILES = 		\
 	$(schemas_DATA)		\
 	$(servicefile_DATA)	\
 	$(gsettings_SCHEMAS)	\
+	gschemas.compiled	\
 	$(NULL)
diff --git a/tools/.gitignore b/tools/.gitignore
index 2578e98..d6ba5d9 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -1,3 +1,4 @@
 _gen
 extensions.html
 telepathy-glib-env
+empathy-env
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 96cc60f..49bcb04 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,11 +1,15 @@
 abs_top_builddir = @abs_top_builddir@
 
-noinst_SCRIPTS = telepathy-glib-env
+noinst_SCRIPTS = telepathy-glib-env empathy-env
 
 telepathy-glib-env: telepathy-glib-env.in Makefile
 	sed -e 's![ ]abs_top_builddir[@]!$(abs_top_builddir)!' $< > $@
 	chmod +x $@
 
+empathy-env: empathy-env.in Makefile
+	sed -e 's![ ]abs_top_builddir[@]!$(abs_top_builddir)!' $< > $@
+	chmod +x $@
+
 EXTRA_DIST = \
     c-constants-gen.py \
     check-coding-style.mk \
@@ -34,6 +38,7 @@ EXTRA_DIST = \
     telepathy.am \
     telepathy-glib.supp \
     telepathy-glib-env.in \
+    empathy-env.in \
     test-wrapper.sh \
     with-session-bus.sh \
     xincludator.py
diff --git a/tools/empathy-env.in b/tools/empathy-env.in
new file mode 100644
index 0000000..3de4779
--- /dev/null
+++ b/tools/empathy-env.in
@@ -0,0 +1,9 @@
+#!/bin/sh
+abs_top_builddir="@abs_top_builddir@"
+export abs_top_builddir
+EMPATHY_SRCDIR=$abs_top_builddir
+export EMPATHY_SRCDIR
+GSETTINGS_SCHEMA_DIR="${EMPATHY_SRCDIR}/data/"
+export GSETTINGS_SCHEMA_DIR
+
+exec "$@"



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