Mono: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:


mkbundle2 --config /etc/mono/config --deps --static -o MonkeysMemory.exe monkeysmemory.exe Sugar_0.0.1.dll NDesk.DBus.GLib.dll NDesk.DBus.dll
mkbundle2 --config /etc/mono/config --deps --static -o MonkeysMemory.exe monkeysmemory.exe Sugar_0.0.1.dll NDesk.DBus.GLib.dll NDesk.DBus.dll

In this example "monkeysmemory.exe" is the original binary file that use the IL (Intermediate Language), while "MonkeysMemory.exe" is the binary file that can be run without runtime installed.


Normally the use of --static flag normally have some licence restiction, but here can be use without limitation.
Normally the use of --static flag normally have some licence restiction, but here can be use without limitation.

In your bundle you need to put some glue shared library that are used by Mono runtime like this:
* libgdksharpglue-2.so
* libgladesharpglue-2.so
* libglibsharpglue-2.so
* libgtksharpglue-2.so
* libMonoPosixHelper.so
* libpangosharpglue-2.so



=How to run a Mono activity=
=How to run a Mono activity=

Revision as of 06:25, 28 December 2007

This article is a stub. You can help the OLPC project by expanding it.

Sugar activities are usually written in Python using the Python Activity API. This page documents how it is possible to use Mono to write a Sugar activity. With Mono, you can use any underlying language like C# or Boo.

Overview

XO Bundle and Mono Bundle

To write an OLPC Mono activity, you need to prepare a .xo Bundle including all required libraries. This is necessary because the Mono runtime is not officially supported by the OS images.

If you use mono, you know that the compiler not traslate the source code to the assembly language, but in IL (Intermediate Language) that need a runtime to be run. Since you don't have the runtime installed on the XO, you need to create a mono bundle so all the runtime is packed in one executable.

To do this you need to have the program already in binary format and use the mkbundle2 utility to create the stand-alone application.

mkbundle2 --config /etc/mono/config --deps --static -o MonkeysMemory.exe monkeysmemory.exe Sugar_0.0.1.dll NDesk.DBus.GLib.dll NDesk.DBus.dll

In this example "monkeysmemory.exe" is the original binary file that use the IL (Intermediate Language), while "MonkeysMemory.exe" is the binary file that can be run without runtime installed.

Normally the use of --static flag normally have some licence restiction, but here can be use without limitation.

In your bundle you need to put some glue shared library that are used by Mono runtime like this:

  • libgdksharpglue-2.so
  • libgladesharpglue-2.so
  • libglibsharpglue-2.so
  • libgtksharpglue-2.so
  • libMonoPosixHelper.so
  • libpangosharpglue-2.so


How to run a Mono activity

You can find a sample activity written using Mono.

Interface with the native subsystem

Create new application

Sugarize existing application

More documentation will be released as soon as possible.