mardi 13 octobre 2009

First use of Sugar Coating.

In order to be able to do a good job porting OOo4Kids on Sugar, we tried to try it out with one project we've done during school. Nothing big, only a "Raytracer" that draws a Sphere in 3D (that does far much than that, but we will only use this fonction for now).

First, we made a proper compilation on the XO-1 (recompilation of our libs and the project itself, not that hard) and then tried to add it to the activities (and by the way adding our activity to the journal) of Sugar using the HelloWorldActivity as a sample, that worked but we had a problem: it opened a window for the activity and one another for our Raytracer, so that was quite a mess.

Then we tried the Sugar Coating method (by the way, thank to the Sugar-labs who gave us this hint on #sugar). The sugar coating is a method that adds a Linux binary to Sugar Activities (available on and on We that followed what the script was telling us to do and the first problem was solved but the Sugar coating doesn't handle the journal and the toolbox, so we will have to take that from the HelloWorldActivity tutorial and add it to the Sugar Coating.

lundi 12 octobre 2009

Second Step: Roadmap for OOo4Kids

As we said, OOo4Kids has a few elements that will make the sugarization harder than in HelloWorld's case. The two most important are:
-Really heavy in term of size (not even counting the sources);
-C/C++, not directly compatible with the sugar special elements (the journal for exemple).
Therefore, we will need to make sure few things are done for everything to work properly. Here is a rough roadmap of everything that will be needed:

Step 1 - get a Sugar-compatible executable.
The best way to do this would be to recompile it using Sugar on a Stick. There is also the possibility of using the Sugar Coating method, even though it might have an impact over the performances.

Step 2 - Establishing the Bundle
We will need to prepare the OOo4Kids.activity directory that will contain everything that is related to the program. Every requirement is detailed here. There are many files to fill, but nothing too difficult.

Step 3 - Organisation of OOo4Kids' libraries
The organisation of OOo4Kids' libraries, images, scripts... will have to be modified in order to "fit" in the bundle. It will need to be a bit different than a classic installation because of the whole concept of Bundle.

Step 4 - Linking OOo4Kids to the journal
For OOo4Kids to become a real XO activity, it needs to be working tgether with the journal. Unfortunately, as the journal as been thinked in python, it seems according to the documentation that the only way of interacting with the journal is, of course, using python methods. We will have to think of a workaround to make things work properly.

Step 5 - Little Details

Almost done: what's left is building the MANIFEST file (find . -type f | sed 's,^./,,g' > MANIFEST ), restarting Sugar, and make sure everything works fine.

mercredi 7 octobre 2009

First Step: Sugarizing Hello World

Everything related to Sugar's activities is located in /home/olpc/Activity . Each folder represents one activity and everything that is related to it is present in the proper folder.

Example in HelloWorldActivity.activity:

Once everyfile is in it's due place (follow the tutorial shown on the previous post for more details), one needs to restart Sugar by pressing ctrl+alt+erase. The activity won't appear on the desktop... yet.

But if you go check in the activity list...

... and click the little star, then the icon will automatically be added to the circle on the desktop.

From here on, you can freely launch the HelloWorld Activity, and have proper entries inside the journal each time you end this activity.

If you followed the tutorial, you might think: "Yeah, this doesn't seem that hard." Unfortunately, HelloWorld being the smallest application ever (here, consisting on one tiny, tiny little .py file), this of course was pretty quick and easy to do. Now for something like OOo4Kids, this will be much, much harder, for many reasons, and not only because of it's size.

Prologue: Work Environment

Time to take care of the most important part of our training period: making OOo4Kids run on a XO. And, more than that, make it compatible with every Sugar application such as the journal and the desktop... Because of course, a mere recompilation of OOo4Kids on Sugar would fix the first issue pretty easily, which is not much fun.

So, how do one sugarize an application, and what does it gives in the end? Let's start with sugarizing HelloWorld. A fully documented and described tutorial is available here ( ). It works perfectly fine and gives a nice result - I will just allow myself to do a "step-by-step howto" with some images.

First, we will need to open a terminal to be able to navigate in the systeme. The most simple is to use the terminal activity...

... but a /dev/tty2 is fine too (open it by pressing ctrl+alt+group/neighborhood, return to sugar by pressing ctrl+alt+home)

Most of the work will be done using the terminal, until OOo4Kids runs fine on the XO.

We got the XO-1!

We finally got the two XO-1 this week! We thank the Sugar-labs for those and we will work with the XO from tomorrow and talk about our progress as soon as we can! Thank again!
The next step is: getting accostumed to the XO and the Sugar environment. Get to know it, to be able to use it casually: this shouldn't be so hard. We will begin OOo4Kids' sugarisation in the next few days, and report results here.