Developers/Setup
The OLPC's software environment is a heavily modified Fedora 7 Linux system running a custom GUI shell (Sugar). To develop for the platform you will eventually need access to a platform which runs in a manner substantially similar to the OLPC environment. To put it simply, you will likely need to have Sugar running on a computer.
There are two major approaches to running Sugar, running it natively on your machine, and running it in an emulated environment. Which approach you choose will depend on a number of factors, including:
- whether you are just wanting to check the platform out, or are setting up for long-term development work (i.e how much time you want to invest in getting the best possible setup)
- what type of hardware you have available to you
- how comfortable you are with working with traditional Linux tools such as ssh, and vim/nano editors
- what type of development work you are interested in doing
If you can neither run an emulated machine or run Sugar natively, it is still possible that you may be able to develop for the platform by #Cross Coding.
About Emulation
There are a number of tools which allow you to run an image of one operating system in a window on another system. If you have powerful hardware available and want to get started as fast as possible, choosing an emulated approach is probably for you.
If you are running a reasonably powerful Linux, Windows or Mac OS X machine, you can likely use one of these tools to run an emulated image. Emulation is a computationally intensive operation, it requires a powerful (modern) host machine with lots of RAM and lots of storage space. Each official image you wish to use will require about 2GB of disk storage with ancillary files and unpacking requirements.
Emulation Packages/Products
Emulation is a hot topic these days, there are lots of emulation systems available, some no-cost, some Open Source, some commercial. We cannot hope to support all of these systems, so we have focused our efforts on small subset of systems:
- Qemu (with the KQemu Accelerator)
- Our best-supported emulation system
- With the KQemu package provides reasonably fast emulation
- Open Source and runs well on Linux and Windows machines
- Basic setup is reasonably easy
- Allows for working in "overlays"
- Command-line interface everywhere, GUI available for Windows
- Works directly with offical builds
- VMWare / VirtualBox
- Commercial emulation packages with no-cost "players" for images
- Somewhat easier setup than Qemu, particularly for advanced networking on Linux hosts
- Require converted images, which are not always kept up-to-the-minute and do not include experimental/testing builds
- Beta version of VMWare available for Mac OS X
Which emulation system you choose is mostly a matter of preference and suitability for your system.
Emulation for Development
- Developing directly on an official image
- Suitable for developers who wish to develop in EToys, or who are comfortable with command-line Linux editors (such as vim or nano)
- Building sugar-jhbuild on an emulated desktop
- Runs an emulated Developer's Desktop image, i.e. a regular Linux distribution running in a window on your desktop can be used if your host system is not a compatible Linux distribution (e.g. Windows, OS-X, older Linux)
Emulation for Compilation
- Using an image (preferably with an overlay) to do binary compilation in a "throw-away" environment
Emulation for Testing
Suitable for developers who want to develop on their host machine and then see the results in the emulator. Emulation tools often have the ability to share folders with the emulated machines, but simple scp, rsync or source-code-controls work as well.
Emulated OLPC-XO
The recommended platform for "checking out" the Sugar environment, testing activities and for initial development of new activities. By installing an emulation package on your (reasonably powerful) host desktop, you can run an emulated version of the Sugar environment which is essentially the same code as runs on the real laptops.
An emulated XO does not provide tools such as SVG editors or Integrated Development Environments. You will normally run such software on your host machine and push the results onto the emulated machine.
The emulated XO has certain limitations with regard to the specialized hardware in the XO. See the Developer's FAQ below for some pointers on how to simulate the special hardware.
Native Sugar
sugar-jhbuild
This is what the core development team uses and is one of the most pleasant ways to work. Compared with using an Emulated XO, installing sugar takes more time and space to set up, and can be difficult to maintain, but results in a more flexible better environment. If you are intending to work on the core system/activities you will likely need to use sugar-jhbuild to set up your environment. See Sugar with sugar-jhbuild to get going. The 'native' environment for sugar-jhbuild is Fedora 7 and Ubuntu (feisty or gutsy).
This approach also works nicely under emulation (Qemu, Parallels, VirtualBox or VMWare) on Linux, Windows or Mac OS host operating systems. This allows you to work without rebooting even when using sugar-jhbuild, and without risk of corrupting your host operating system.
On 32-bit Linux
To get a working Sugar using jhbuild you will need to be running an OS that provides compatible versions of the various libraries that Sugar requires (basically a very up-to-date Linux platform).
As of 2007-12-13 the distributions known to be able to support sugar-jhbuild are:
- Fedora 7
- Ubuntu Feisty Fawn (or Greater).
- Gentoo (with a trivial work-around)
At the moment, a Fedora 7 install with sugar-jhbuild is probably the most "sure" approach to getting a working full-speed (non-emulated) working environment for developing on Sugar with the latest libraries and solid upgrade path. As most of the core developers are working on Fedora boxes with sugar-jhbuild it is the most likely environment to be supported and continue to receive support.
On 64-bit Linux
As of 2007-12-13 it is possible to build Sugar on 64-bit Linux with trivial workarounds/fixes. This has been confirmed on Gentoo amd64 and Debian Lenny (with the caveats below).
Sugar seems to be working on Debian Lenny (2007-11-05), though Python 2.5, even when installed, is not detected. Comment out the line jhbuild.commands.run('sanitycheck', config, []), line 95, to get it to install.
Native Sugar Packages on Linux
As Sugar stabilizes and is ported to more distributions, it should be possible to use your Linux distribution's package management system to install Sugar. Distributions with ports so far:
- Ubuntu Gutsy -- Note that we need more testing of this package-set, please let us know your experiences
If you don't see your distribution here, ask your distribution maintainers, or if you have the skills, create the packages yourself and submit them.
A real XO laptop
Hardware Developer's Program - while there are only a small number of test units being produced, developers can submit proposals to receive one of those units for testing and development.
You can also, if you live in the US or Canada, and have sufficient funds, until Dec 31, 2007 use the Give 1 Get 1 program to acquire a production-run machine (and donate one to a child).
Live CDs
The Live CDs allow you to convert a "regular" machine into a Sugar-running machine without touching the hard disk of the machine. This allows you to play with and test how the software runs with your hardware. It also lets you demonstrate and test your software at full speed.
Cross Coding
If you can neither run an emulated machine or run Sugar natively, it is still possible that you may be able to develop for the platform by developing your code on one machine and then porting it to the platform when you are finished.
Cross coding generally works best when you are working in a relatively constrained and abstracted environment. Of the stacks available on the Sugar platform, the following are well suited to Cross Coding activities:
- Browser -- Mozilla/Firefox-derived web browser
- EToys -- Squeak/Smalltalk multimedia environment
- Pygame -- raster-graphics game development framework
- Flash -- Gnash or Adobe-Flash engine
You may be able to install just the software involved in that stack in order to test and develop your game. You can then have a development partner do porting and testing to a Sugar environment.