Sugar on Ubuntu Linux/Older Ubuntu versions

From OLPC
< Sugar on Ubuntu Linux
Revision as of 04:21, 2 March 2008 by Mchua (talk | contribs) (moved sugar instructions for non-gutsy (old) ubuntu to subpage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

apt-get the prerequisites

You need a number of packages from the Ubuntu repositories. Some of these packages are not available for the stock Ubuntu install, and you will need to enable the universe and multiverse repositories. (You can do this by either using the Synaptic Package Manager, or simply editing /etc/apt/sources.list, but don't forget to reload afterwards.)

Dapper 6.06

 sudo apt-get install build-essential cvs docbook-utils subversion libgtk2.0-dev libidl-dev \
   gnome-common gtk-doc-tools libxt-dev automake1.7 automake1.8 automake1.9 python-gtk2-dev \
   python2.4-avahi git-core cogito python-dev avahi-utils \
   libgconf2-dev xserver-xephyr libgnome2-dev libmatchbox-dev python-cairo-dev \
   libtiff4-dev python-gnome2-dev libxdamage-dev libxdamage1 libxcomposite-dev \
   libgnomeui-dev libtool libfribidi-dev libgsf-1-dev libbz2-dev libwmf-dev \
   libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgnomeprintui2.2-dev \
   libenchant-dev libnspr-dev darcs libxslt1.1 libxslt1-dev firefox firefox-dev \
   libasound2-dev sqlite3 libsqlite3-dev libssl-dev libncurses5-dev \
   bison flex libtheora-dev libtheora-bin libboost-dev

Edgy 6.10

 sudo apt-get install build-essential cvs docbook-utils subversion libgtk2.0-dev libidl-dev \
   gnome-common gtk-doc-tools libxt-dev automake1.7 automake1.8 automake1.9 python-gtk2-dev \
   python-avahi git-core cogito python-dev avahi-utils \
   libgconf2-dev xserver-xephyr libgnome2-dev libmatchbox-dev python-cairo-dev \
   libtiff4-dev python-gnome2-dev libxdamage-dev libxdamage1 libxcomposite-dev \
   libgnomeui-dev libtool libfribidi-dev libgsf-1-dev libbz2-dev libwmf-dev \
   libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgnomeprintui2.2-dev \
   libenchant-dev libnspr-dev darcs libxslt1.1 libxslt1-dev firefox firefox-dev \
   libasound2-dev sqlite3 libsqlite3-dev libssl-dev libncurses5-dev \
   bison flex libtheora-dev libtheora-bin libboost-dev

Feisty 7.04

 sudo aptitude install libloudmouth1-0 libloudmouth1-dev libdbus-glib-1-2 \
   libdbus-glib-1-dev darcs libsqlite3-dev libtheora-dev libxml2-utils libboost-dev \
   automake1.7 bison flex cvs libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev \
   libssl-dev xserver-xephyr libgtk2.0-dev libfribidi-dev libgsf-1-dev \
   libenchant-dev libasound2-dev libtiff4-dev libxt-dev docbook-xsl \
   libgconf2-dev libgnutls-dev intltool libpoppler-dev libpoppler-glib-dev \
   g++ python2.5-dev libtool gtk-doc-tools python-gtk2 python-gtk2-dev \
   python-avahi libavahi-client-dev libavahi-glib-dev liboil0.3-dev \
   libxslt1-dev libglade2-dev automake1.9 python-cairo-dev python-all-dev \
   libncurses5-dev gstreamer0.10-alsa python-gst0.10 subversion python-vte \
   ncurses-dev libsvn-dev gnome-doc-utils python-numpy python-numpy-dev \
   python-json libcurl3-dev libgnome-vfs-dev libxres-dev libxres1

Build non-packaged code

On my Feisty Ubuntu box, I had to install the g++ compiler to get some of the following packages to work. Use the following if you have any trouble:

sudo apt-get install g++
./sugar-jhbuild buildone -a loudmouth
./sugar-jhbuild buildone -a datastore
./sugar-jhbuild buildone -a xapian-core         # note: you need libxapian15, not libxapian13
./sugar-jhbuild buildone -a xapian-bindings
./sugar-jhbuild buildone -a pyxapian
./sugar-jhbuild buildone -a artwork
./sugar-jhbuild buildone -a hippo-canvas
./sugar-jhbuild buildone -a sugar
./sugar-jhbuild buildone -a presence-service


Troubleshooting

Users of older Ubuntu versions may run into trouble following the instructions for Gutsy. Here's how to fix some more common ones.

automake version mismatch

The following solution also applies in other situations. I ran into it when attempting:

./sugar-jhbuild build-base

make died while building fontconfig on a Ubuntu Dapper box with a missing separator error.

During the building task you may get the following error:

error during stage configure of matchbox-window-manager:....[9/12]

This error happens because Ubuntu uses the automake 1.4 version in contrast with matchbox-window-manager which uses the automake 1.9 version. In order to bypass this error you can execute the following command:

sudo update-alternatives --config automake

You will get the following list with the asterisk being at the 1 selection

There are 3 alternatives which provide `automake'.
  Selection    Alternative
 +    1        /usr/bin/automake-1.4
      2        /usr/bin/automake-1.7
 *    3        /usr/bin/automake-1.9
Press enter to keep the default[*], or type selection number:

Here you should press the button 3 and the try again to build sugar.

Mozilla Build Error

You may get stuck at a Mozilla build error - I did on Edgy AMD64. Two ways to resolve the problem, either:

 sudo aptitude install libxul-dev

which may not work, or copy the Mozilla or Firefox .pc files in /usr/lib/pkgconfig to xulrunner-*.pc files (You may only need to create xulrunner-gtkmozembed.pc and not the rest...). Either way, then, build with ./sugar-jhbuild build -s mozilla to skip building Mozilla from source. I have not yet completed a full Sugar build, though, so these instructions may just be masking a problem. --RP

Building libabiword

If you get an error like

 *** Building libabiword *** [24/35]

<...>

    I can't seem to figure out which platform you are using.

    You should probably try using the autoconfiscated build system (rather
    than this, the deprecated and unsupported diving make system) by running
    configure (creating it with autogen.sh if need be) and using GNU Make.
    Using configure is a requirement for all known platforms that aren't some form
    of Windows, QNX Neutrino, or MacOS X.

just choose the "configure" option. This error shows up (probably) because AbiWord has a regular Makefile setup for building on Windows in addition to AutoConf stuff for nearly every other platform, so it is just "faking out" jhbuild in all likelyhood.

git, the SCM

On Ubuntu 6.06 Dapper Drake, git has been deprecated. You have to run the following command to get git to work properly.

sudo update-alternatives --config git
Select option #2: git-scm

network manager error

If, after running ./sugar-jhbuild run you get the following error:

DBusException: Connection ":1.12" is not allowed to own
the service "org.freedesktop.NetworkManagerInfo" due to
security policies in the configuration file

you have two solutions

Method 1 : Install NetworkManager

You want to ensure that the NetworkManager is

  • installed
sudo apt-get install network-manager
  • reachable by console applications, in file /etc/dbus-1/system.d/NetworkManager.conf add
<allow own="org.freedesktop.NetworkManagerInfo"/>

after

<policy at_console="true">
  • started, by restarting the whole dbus
sudo /etc/init.d/dbus restart

Method 2 : Only provide .conf file

Copy the configuration file to /etc/dbus-1/system.d . Restart the dbus as above.

os.py not finding sugar-emulator folder

The error message is:

 ./sugar-jhbuild run
 Traceback (most recent call last):
 File "./sugar-jhbuild", line 11, in ?
   main.main(sys.argv[1:])
 File "/home/barbolo/Desktop/sugar/sugar-jhbuild/main.py", line 104, in main
   jhbuild.commands.run(command, config, args)
 File "/home/barbolo/Desktop/sugar/sugar-jhbuild/build-scripts/jhbuild/jhbuild/commands/__init__.py", line 74, in run
   return cmd.execute(config, args)
 File "/home/barbolo/Desktop/sugar/sugar-jhbuild/build-scripts/jhbuild/jhbuild/commands/base.py", line 238, in execute
   os.execlp(args[0], *args)
 File "/usr/lib/python2.4/os.py", line 324, in execlp
   execvp(file, args)
 File "/usr/lib/python2.4/os.py", line 341, in execvp
   _execvpe(file, args)
 File "/usr/lib/python2.4/os.py", line 379, in _execvpe
   func(fullname, *argrest)
 OSError: [Errno 2] No such file or directory

The solution:

Edit the archive sugar-jhbuild/main.py:

Change line 101:

args.append('sugar-emulator')

for

args.append('/home/barbolo/Desktop/sugar/sugar-jhbuild/source/sugar/sugar-emulator')


Note that /home/barbolo/Desktop/sugar is where my sugar-jhbuild folder is located, so you may change it!

Testing sugar

When using sugar-jhbuild, you can use:

./sugar-jhbuild run

If you want to run Sugar from the source tree enter in a jhbuild shell:

./sugar-jhbuild shell 

Then use:

sugar-shell