Sugar on Gentoo Linux: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Udated build instructions for Gentoo users...)
Line 1: Line 1:
==Installation==
==Installation==


[[Sugar]] can be built on Gentoo using the sugar-jhbuild tool. These instructions are being updated on 2007-02-28 to reflect current build practice as successfully completed by the PyCon sprint. Test machine was an up-to-date x86 laptop with minimal ~x86 features added to support the Sugar environment.
It was really easy to get [[Sugar]] going under gentoo using sugar-jhbuild. The instructions on this page have been tested under Gentoo 2006.1 ~x86


==Prerequisites==


You will need to emerge rather a lot of software, with many of the packages being ~x86 or hard-masked. For any package which is hard-masked, you will have to add the package to your /etc/portage/package.unmask file (which you may need to create).
=== Emerge(1) the prerequisites ===


Please keep in mind that unmasking hard-masked files is strongly discouraged by Gentoo, and the project will generally *not* provide support for problems encountered with the software (i.e. ask on the Sugar lists before you ask on the Gentoo lists for hard-masked packages).
There are a number of packages required to get going. All of these, with the
exception of jhbuild, are in the portage tree.


To unmask a hard-masked package, add a line such as the following to your /etc/portage/package.unmask file:
emerge -av dev-util/git cvs subversion docbook-sgml-utils gtk-doc avahi expat gstreamer xulrunner pycurl networkmanager


=net-misc/networkmanager-0.6.4_pre20061028-r1
I have definitely missed one or two as I started with a full xorg-x11 desktop with gnome already installed, please add them to this list if you find any!
=dev-libs/libnl-1.0_pre6
=net-misc/dhcdbd-1.14-r1
=dev-lang/python-2.5-r1


To unmask an ~x86-masked package, add a line such as the following to your /etc/portage/package.keywords file:
Note: as of 2007-01-24 the networkmanager package and a number of its dependencies are now hard-masked by Gentoo due to bug reports To emerge these dependencies you will need to add the packages to /etc/portage/package.unmask. This is generally *not* recommended on Gentoo for anyone not willing to deal with problems that arise themselves.


dev-lang/python ~x86
Also note the following message during building:
dev-python/setuptools ~x86
net-libs/xulrunner ~x86
net-misc/networkmanager ~x86
dev-libs/libnl ~x86
net-misc/dhcdbd ~x86
dev-python/dbus-python ~x86


Note that you can use the full format (including comparison operator and version) as specified in the package.unmask file above as well.
cryptsetup requires dm-crypt support!
Please enable dm-crypt support in your kernel config, found at:
(for 2.6 kernels)
Device Drivers
Multi-Device Support
Device mapper support
[*] Crypt Target Support
and recompile your kernel if you want this package to work with this kernel. Many kernels will have the module already, try:


You will also likely need to specify USE flags for a number of packages. These are added to the /etc/portage/package.use file in a format like so:
modprobe dm-crypt


dev-util/subversion -apache2
and see if you have the kernel module already.
net-dns/avahi dbus python
dev-python/gnome-python-extras firefox
x11-base/xorg-server kdrive


=== Python 2.5 is Required ===
Many of the packages are also not available without using the "unstable" flag for x86 (i.e. adding the package to /etc/portage/package.keywords).


You will need to upgrade your Gentoo installation to Python 2.5, then upgrade all of the packages dependent on Python (normally Python modules):
The Xephyr nested X11 server is required. This server is provided by the "kdrive" sub-package in xorg-x11. You will need to add:


emerge -avDt >=dev-lang/python2.5
x11-base/xorg-server kdrive
python-updater


Note that Python is a core component of Gentoo's portage package management system. As such it is potentially possible that you could damage your system by using an unsupported Python version. Probably not a huge risk, but be careful!
to your /etc/portage/package.use file and then do:


=== Emerge(1) the prerequisites ===
emerge -avDt --newuse xorg-server


Sugar requires a large number of standard Gentoo packages, you will need to emerge all of them in order to build the package:
to get the package built.


emerge -avDt \
dev-util/git\
cvs subversion\
docbook-sgml-utils\
gtk-doc\
avahi\
expat\
gstreamer\
xulrunner\
pycurl\
networkmanager\
gnome-python-desktop\
gnome-python-extras\
>=dev-python/dbus-python-0.80.1\
darcs

You will also likely need to compile the xorg-server module with a new USE flag "kdrive", which specifies the creation of the "nested X servers", (particularly the "Xephyr" server which Sugar uses) specified in the /etc/portage/package.use:

emerge -avDt --newuse xorg-server

You will also need the "dm-crypt" module compiled into your kernel. To check for the presence of the module:

modprobe dm-crypt

if this fails, enable the option in your kernel and rebuild the kernel with genkernel (or whatever you prefer for your kernel building pleasure):

Device Drivers
Multi-Device Support
Device mapper support
[*] Crypt Target Support
=== Getting and building jhbuild ===
=== Getting and building jhbuild ===


Line 54: Line 89:
You do *not* need to run jhbuild directly. sugar-jhbuild just requires the package in order to function.
You do *not* need to run jhbuild directly. sugar-jhbuild just requires the package in order to function.


=== Python 2.5 is Required ===

You will need to upgrade your Gentoo installation to Python 2.5. Note that Python is used to run the portage package management system. You will likely need to set ~amd64 or ~x86 for dev-lang/python in your /etc/portage/package.keywords and add it to your /etc/portage/package.unmask.

After emerging Python 2.5 you will need to run:

python-updater

to rebuild your python modules.


=== Using Sugar-jhbuild ===
=== Using Sugar-jhbuild ===

Revision as of 04:41, 1 March 2007

Installation

Sugar can be built on Gentoo using the sugar-jhbuild tool. These instructions are being updated on 2007-02-28 to reflect current build practice as successfully completed by the PyCon sprint. Test machine was an up-to-date x86 laptop with minimal ~x86 features added to support the Sugar environment.

Prerequisites

You will need to emerge rather a lot of software, with many of the packages being ~x86 or hard-masked. For any package which is hard-masked, you will have to add the package to your /etc/portage/package.unmask file (which you may need to create).

Please keep in mind that unmasking hard-masked files is strongly discouraged by Gentoo, and the project will generally *not* provide support for problems encountered with the software (i.e. ask on the Sugar lists before you ask on the Gentoo lists for hard-masked packages).

To unmask a hard-masked package, add a line such as the following to your /etc/portage/package.unmask file:

=net-misc/networkmanager-0.6.4_pre20061028-r1 =dev-libs/libnl-1.0_pre6 =net-misc/dhcdbd-1.14-r1 =dev-lang/python-2.5-r1

To unmask an ~x86-masked package, add a line such as the following to your /etc/portage/package.keywords file:

dev-lang/python ~x86 dev-python/setuptools ~x86 net-libs/xulrunner ~x86 net-misc/networkmanager ~x86 dev-libs/libnl ~x86 net-misc/dhcdbd ~x86 dev-python/dbus-python ~x86

Note that you can use the full format (including comparison operator and version) as specified in the package.unmask file above as well.

You will also likely need to specify USE flags for a number of packages. These are added to the /etc/portage/package.use file in a format like so:

dev-util/subversion -apache2 net-dns/avahi dbus python dev-python/gnome-python-extras firefox x11-base/xorg-server kdrive

Python 2.5 is Required

You will need to upgrade your Gentoo installation to Python 2.5, then upgrade all of the packages dependent on Python (normally Python modules):

emerge -avDt >=dev-lang/python2.5 python-updater

Note that Python is a core component of Gentoo's portage package management system. As such it is potentially possible that you could damage your system by using an unsupported Python version. Probably not a huge risk, but be careful!

Emerge(1) the prerequisites

Sugar requires a large number of standard Gentoo packages, you will need to emerge all of them in order to build the package:

emerge -avDt \ dev-util/git\ cvs subversion\ docbook-sgml-utils\ gtk-doc\ avahi\ expat\ gstreamer\ xulrunner\ pycurl\ networkmanager\ gnome-python-desktop\ gnome-python-extras\ >=dev-python/dbus-python-0.80.1\ darcs

You will also likely need to compile the xorg-server module with a new USE flag "kdrive", which specifies the creation of the "nested X servers", (particularly the "Xephyr" server which Sugar uses) specified in the /etc/portage/package.use:

emerge -avDt --newuse xorg-server

You will also need the "dm-crypt" module compiled into your kernel. To check for the presence of the module:

modprobe dm-crypt

if this fails, enable the option in your kernel and rebuild the kernel with genkernel (or whatever you prefer for your kernel building pleasure):

   Device Drivers
     Multi-Device Support
       Device mapper support
         [*] Crypt Target Support

Getting and building jhbuild

Instructions for getting and installing jhbuild can be found at: http://www.gnome.org/~jamesh/jhbuild.html#getting-started

However, note that these instructions are somewhat out of date, jhbuild is now stored in SVN instead of CVS. Check it out with:

 svn co http://svn.gnome.org/svn/jhbuild/trunk jhbuild

You do *not* need to run jhbuild directly. sugar-jhbuild just requires the package in order to function.


Using Sugar-jhbuild

Use of Sugar-jhbuild is detailed on building Sugar from sources. To summarize those instructions:

git-clone git://dev.laptop.org/sugar-jhbuild
cd sugar-jhbuild
./sugar-jhbuild

If you had already checked out sugar-jhbuild previously, make sure your copy is up-to-date before building:

cd sugar-jhbuild
git-pull

The sanity checks are still very basic but, often, good information can be gotten from:

 ./sugar-jhbuild sanitycheck


Troubleshooting

missing db2html

You may find that jhbuild complains about missing 'db2html' in which case you will need to create a symlink from docbook2html:

 ln -s /usr/bin/docbook2html /usr/bin/db2html


missing gconf.def

gnome-python-desktop was complaining about a missing gconf.def:

 IOError: [Errno 2] No such file or directory:
 'sugar-jhbuild/build/share/pygtk/2.0/defs/gconf.defs'

I rectified this with a:

 touch build/share/pygtk/2.0/defs/gconf.defs

and the build completed without problem.


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 from the directory sugar-jhbuild/source/sugar), use:

shell/sugar