So, this "guide" can be shortened to:
- create a new user (empathy-dev)
- install jhbuild
- jhbuild build empathy
- echo "export PATH=/opt/gnome/sbin:/opt/gnome/bin:$PAT
H" >> /home/empathy-dev/.bashrc
- echo "export XDG_DATA_DIRS=/opt/gnome/share:/usr/shar
e:$XDG_DATA_DIRS" >> /home/empathy-dev/.bashrc
- slogin -X empathy-dev@localhost
In order to do development on Empathy, I've created another user on my system (creatively named "empathy-dev") and run my development versions of programs, libraries, and services through this user. This has a couple major benefits:
- zero downtime - I frequently restart Empathy during development. Running the default system version of Empathy as my regular user means I can stay online as I develop.
- fault isolation - if I horribly break my development environment (eg, the bleeding-edge libraries I depend upon introduce major bugs), it doesn't affect my system stability
It was somewhat non-trivial to create a good setup, so I thought other people might find this handy.
Throughout this short guide, I use references to
/opt/gnome, which is the standard jhbuild
$PREFIX. So substitute your development
$PREFIXas necessary. I make a point to not use the standard Unix development
/usr/local) so that my regular user doesn't run the development programs or libraries (for stability and sanity; see below).
Skip the remaining steps this guide - it's needlessly complicated
First, we need to set up a few bits and pieces so your shell and D-Bus know where to find the development programs and config. I use a fairly standard D-Bus local session config file.
The important (and only non-standard, I think) part is:
This allows the programs installed in our
$PREFIXto launch necessary services (eg, Mission Control, the Telepathy Connection Managers) through D-Bus activation.
Download this file, adjust it as necessary, and put it in
Add this to the end of your development user's
# let programs find any new icons, default config files, etc.
# automatically start a D-Bus session bus
alias dbus-setup="dbus-launch --config-file=$HOME/.dbus-1/session-loca
if [ $? -eq 0 ]; then
echo "\nSet up D-Bus session for $USER:";
eval export $session_setup
echo "\nFAILED setting up D-Bus session for $USER";
Once you've got that set up, it's easy to launch the development version of Empathy as a different user:
slogin -X empathy-dev@localhost
Then, just run empathy and marvel at its independence from your main user's instance. However, if you haven't installed a newer version of empathy in
$PREFIX/bin, this will just fall back to your system-installed version.
Fix this by setting up jhbuild and running "jhbuild build empathy". Find something to do for about 20 minutes. When you come back, if our dependencies haven't failed to build, you'll be able to run the latest version of Empathy as empathy-dev, without getting in the way of your system user.
dbus-launch will keep the dbus-daemon (and anything it activates) running by default after your development user logs out. There's a
--exit-with-sessionoption, but for some reason, if I use it here, about 30% of my keystrokes at the shell don't arrive. I'm flabbergasted, but it seemed completely tied to this
dbus-launchoption (I tried several times each way).