EnvironmentSetup/Sugar

Back to Environment Setup

'''Please do not translate the page yet

Intro
Here will be described :


 * what you must install, in order to build OOo4Kids on Sugar ;
 * how to create an installable Bundle ;
 * how to finally install it (and how to deinstall it too).

Thanks in advance to help us and contribute to this wiki.

Setup
FIXME : complete me, add everything you must install for the build

=> see the current Linux Intel 32 bits installset, extremely close.

Checkout the sources
You must use subversion client to checkout the sources (svn is the binary name).

The command :

svn co svn://svn.adullact.net/svnroot/ooo4kids1/trunk myOOo4Kids

-> will create a myOOo4Kids directory, containing the whole tree. Count 2 GB for the sources, and 15 GB for a full set after the build.

Configure
Note : the configure command line must be entered in one line.

The "\" symbols are there for readability, and mean new line


 * --with-OOo4Kids and --with-xo-build are the important options
 * If you want to build one locale only, just remove the one you don't want in "--with-lang="locale1 locale2 ..."

By default, pre-installed, named installed package format is choosen on Sugar.

Note: If building on Debian (or whatever other Linux), and if you want to build an XO tree as installed package format, just think to do before configure : export SUGAR_BUNDLE_PATH="something but not empty string"

And the "installed" package format will be used. Other solution : become root and create /usr/share/sugar subdir

Once everything above is ready, run configure this way :

./configure        --with-lang=ALL \ --enable-fontconfig \ --with-system-python \ --with-system-libxml \ --with-package-format=installed \ --with-system-libxml \ --enable-opengl \ --without-fonts \ --disable-gnome-vfs \ --disable-gtk \ --with-xo-build \ --with-OOo4Kids

And you'll be able to go one step forward ...

The bootstrap (compilation of dmake)
Simply do :

./bootstrap

If successfull, dmake will be built for your machine.

Important : this step has to be done once only. It means, that if you rebuild OOo4Kids later, with the same tree. Just redo "source LinuxX86Env.Set.sh to retrieve the build environment, OOo4Kids sources need.

Build OOo4Kids for Sugar
First, you need to add all the environment variables created during configure in your shell. Simply do :

source LinuxX86Env.Set.sh

The speed of the build depends on your machine. The parallel build has been tested, and no problem so far, but not everybody owns an i7 920 + 6GB of RAM and SSD hard disk ;)

So if you are unsure, just do, from the root dir (containing all the sources ) :

dmake

Count : 10 hours hours on a Pentium IV 1.5 GHz + 1GB or RAM, less for a more powerfull machine, and around 16h for a 1GHz machine + 1GB or RAM (approximatively). Please add your score on the wiki page ;)

=> If nothing wrong occurs, at the end, the final product, will stand in instsetoo_native/unxlngi6.pro directory.

''' Create the .xo archive
An .xo archive is in fact a .zip archive, containing the files + a correct MANIFEST. The previous step was to create the MANIFEST, so now the last thin g to do is to create the .xo :

cd instsetoo_native/util/OOo4Kids_languagepack/installed/install/${YOUR_LOCALE}

Inside, you'll have a OOo4Kids.activity subdirectory.

Just type (e.g. for en_US locale) :

zip -r OOo4Kids-1.3_en-US.xo OOo4Kids.activity

At the end, create the .md5 checksum (usefull to control th file integrity after the download) :

md5sum OOo4Kids-1.3_en-US.xo > OOo4Kids-1.3_en-US.xo.md5

And that's all : your OOo4kids.activity is ready to be installed !!

Language packs
The idea is to build en-US + es here, for the OLPC project needs.

At the end, to build them, do :

1) cd the right place :

cd instsetoo_native/util 2) build the language packs

dmake ooolanguagepack

3) Go inside the right dir, containing all the nee files for a given locale :

cd instsetoo_native/util/OOo4Kids_languagepack/installed/install/${YOUR_LOCALE}

As example, we'll add the es locale to the en-US, and we'll provide the .xo for both es/en-US

cd instsetoo_native/unxlngi6.pro/OOo4Kids_languagepack/installed/install/es

Copy the files at the right location :

cp -R OOo4Kids.activity ../../../../OOo4Kids/installed/install/en-US

And the spanish files should be added at the right location !

Now, we'll have to re-create the MANIFEST -> see the instruction below in "Creating a Bundle on Sugar"

Creating a Bundle on Sugar
Important : everything must be done as olpc user, so first, become this user:


 * to become user olpc, type: su - olpc
 * If you are prompted for a password, trying using: su

Once you have a proper Sugar-compatible tree :
 * cp the whole tree in this directory, so you l'll obtain home/olpc/Activities/Oo4Kids.activity
 * cd /home/olpc/Activities/OOo4Kids.activity

python setup.py dev
 * setup the bundle for development

If the po directory is missing, don't forget to create it :

mkdir po

Then, create the manifest (a file that lists all the files needed for the Activity) by inputting:

find. -type f | sed 's,^./,,g' > MANIFEST

There you have all that is necessary in order to create your XO bundle. Just use the following command:

./setup.py dist_xo

You might have to use this command if you are urged to do so:

./setup.py fix_manifest

At the end, if no problem occurs, the bundle is ready in dist ( full path = /home/olpc/Activities/OOo4Kids.activity/dist )

Installing a Bundle on Sugar
If you successfully created the OOo4Kids-1.xo bundle, you'll be able to install it. The previous command line created a dist subdir, and the .xo archive (a zipped tree + MANIFEST ) is inside.

cd /home/olpc/Activities/OOo4Kids.activity/dist

And then, you can now install the bundle by simply typing:

sugar-install-bundle yourbundle.xo

NOTE : if the install fails, the other way is to unzip the .xo archive in /home/olpc/Activities directory, means you'll obtain :

/home/olpc/Activities/OOo4Kids.activity

At the end. To see the OOo4Kids icon in the activities, just reboot, or if you prefer do (in a terminal) :

init 3 ( type enter ) init 5

'''And you should be able to launch OOo4Kids. Enjoy and don't forget to report us feedback !!'''

Aditional links
OLPC France

Install Sugar in a VirtualBox

Other Sugar links