Difference between revisions of "Platform Team/Polyol"

From Sugar Labs
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
 
{{TOCright}}
 
</noinclude>
 
 
 
== Summary ==
 
== Summary ==
  
Intermediate level [http://library.gnome.org/devel/gobject/stable/ GObject] based libraries group.
+
A set of C libraries to help with coding non-Python Sugar activities.
 
 
See [[Documentation Team/Services/Scalable development model|Scalable development model]] to learn more about the initial intentions of Polyol.
 
  
 
== Concepts ==
 
== Concepts ==
Line 13: Line 7:
 
[[File:polyol.png|500px]]
 
[[File:polyol.png|500px]]
  
'''Glucose'''<br>Sugar core processes.
+
* '''Glucose processes'''
 
+
*: Sugar core processes and dbus services.
'''Polyol'''<br>Intermediate level libraries:
+
* '''DBus'''
* Glucose compatibility libraries (ds, shell, collab) will support several (popular among sugar deployments) glucose releases
+
*: All communication between glucose level and activity process goes via dbus.
* Other libraries are not tied to glucose directly
+
* '''Polyol'''
Key features of this level:
+
*: Intermediate level libraries:
* All libraries are written in Vala, i.e., based on pure GObjects, and could be used by non-python-based activities.
+
*:* Glucose compatibility libraries (ds, shell, collab) will support several (popular among sugar deployments) glucose releases
* Each Polyol component has its own release schedule, i.e., there are no Polyol official releases (it looks like in Gentoo).
+
*:* Other libraries are not tied to glucose directly
* Activities could use these libraries on separate basis e.g. activity could use recent ''gui'' (to get access to last UI widgets) and old version of ''ds'' (because activity was coded against this particular version and new version has backward compatibility breakage in API).
+
*: Key features:
* Activities (mostly not native sugar activities) could use only one library e.g. activity could use only ''ds'' library thus do not fetch additional dependencies like telepathy (via ''collab'') and gtk+ (via ''gui'').
+
*:* All libraries are written in Vala, i.e., based on pure GObjects, and could be used by non-python-based activities.
 +
*:* Activities (mostly not native sugar activities) could use only one library e.g. activity could use only ''ds'' library thus do not fetch additional dependencies like gtk+ (via ''gui'').
 +
* '''Activity process'''
 +
*: Regular activities would not use glucose directly, rather they would only access glucose through the Polyol level.
  
'''Activity'''<br>Regular activities would not use glucose directly, rather they would only access glucose through the Polyol level.<br>There is no need to code special activities, the sugar-toolkit API will be preserved, and activity developers will benefit because Polyol will support the recent sugar-toolkit API, e.g., they could use the new toolbars design even on Sugar 0.82.
+
== Components ==
  
== Core libraries ==
+
All libraries are C based and could contain bindings for various programming languages. Libraries use the same [http://git.sugarlabs.org/projects/polyol sources tree].
  
All core libraries are C based and could contain bindings for various programming languages.
+
==== env ====
 
 
=== [[Activity_Team/Services/Env|env]] ===
 
  
 
Access to various sugar environment settings.
 
Access to various sugar environment settings.
  
=== [[Activity_Team/Services/Shell|shell]] ===
+
==== shell ====
  
 
Compatibility level library to sugar-shell.
 
Compatibility level library to sugar-shell.
  
=== [[Activity_Team/Services/Collab|collab]] ===  
+
==== collab ====  
  
 
High level client API for what activity developers might need to code collab activities.
 
High level client API for what activity developers might need to code collab activities.
  
=== [[Activity_Team/Services/Ds|ds]] ===  
+
==== ds ====  
  
 
High level client API to sugar-datastore.
 
High level client API to sugar-datastore.
  
=== [[Activity_Team/Services/Gui|gui]] ===
+
==== gui ====
  
 
A set of first level GUI widgets to simplify process of activity creation.
 
A set of first level GUI widgets to simplify process of activity creation.
  
== Programming language glue libraries ==
+
==== toolkit ====
 +
 
 +
Everything what developers need to start developing native sugar activities. Library depends on all other Polyol components and contains glue level code that simplify creating sugar activities from scratch. This library (and all its dependencies) is an analog of python based sugar-toolkit library.
 +
 
 +
Bindings for this library (in contrast with bindings for other Polyol components) could contain not only wrappers for library itself, but also particular language specific code that makes process of creating sugar activities in this language more comfortable.
 +
 
 +
== Build from sources ==
 +
 
 +
Install required dependencies
 +
* [http://cmake.org/ cmake] >= 2.6
 +
* [http://live.gnome.org/Libgee gee] >= 0.5
 +
 
 +
Download last [https://packages.sugarlabs.org/package/files?package=polyol&project=sdk tarball].
 +
 
 +
Build it:
 +
 
 +
cd <sources-root> && cmake [<nowiki>-D<var-name>=<var-value></nowiki>] . && make && make install
 +
 
 +
Useful cmake variables:
 +
* ''MAINTAINER_MODE'', set to ''TRUE'' to recreate generated files, default is ''FALSE''
 +
* ''CMAKE_C_FLAGS''
 +
* ''CMAKE_INSTALL_PREFIX'', default is ''/usr/local''
 +
* ''PYTHON_SITEDIR'', path within ''CMAKE_INSTALL_PREFIX'' to install python libraries, default is ''lib''
 +
* ''COMPONENTS'', '';'' separated list of components to build, default is all components
 +
* ''BINDINGS'', '';'' separated list of bindings to build, default is all bindings
 +
 
 +
For each component, Polyol will install ''.pc'' file. So, after installing polyol, be sure that ''pkg-config'' will find ''.pc'' files e.g. setup ''PKG_CONFIG_PATH'' variable before using polyol.
 +
 
 +
== Pitfalls ==
  
These are not C based but written in specific programming language libraries. They are glue level libraries that contain programming language specific code to start developing sugar activities. Libraries don't contain bindings for core, bindings are part of particular core library.
+
* Python binding libraries cannot be linked with C libraries from sugar-toolkit.
 +
*: Polyol names contain the {{Code|sugar}} prefix to reuse sugar-artwork as-is.
  
=== [[Activity_Team/Services/Toolkit-python|toolkit-python]] ===
+
== Sources ==
  
Everything what developers need to start developing sugar activities in Python.
+
* [http://git.sugarlabs.org/sdk/polyol Gitorious project].

Latest revision as of 08:16, 2 July 2012

Summary

A set of C libraries to help with coding non-Python Sugar activities.

Concepts

Polyol.png

  • Glucose processes
    Sugar core processes and dbus services.
  • DBus
    All communication between glucose level and activity process goes via dbus.
  • Polyol
    Intermediate level libraries:
    • Glucose compatibility libraries (ds, shell, collab) will support several (popular among sugar deployments) glucose releases
    • Other libraries are not tied to glucose directly
    Key features:
    • All libraries are written in Vala, i.e., based on pure GObjects, and could be used by non-python-based activities.
    • Activities (mostly not native sugar activities) could use only one library e.g. activity could use only ds library thus do not fetch additional dependencies like gtk+ (via gui).
  • Activity process
    Regular activities would not use glucose directly, rather they would only access glucose through the Polyol level.

Components

All libraries are C based and could contain bindings for various programming languages. Libraries use the same sources tree.

env

Access to various sugar environment settings.

shell

Compatibility level library to sugar-shell.

collab

High level client API for what activity developers might need to code collab activities.

ds

High level client API to sugar-datastore.

gui

A set of first level GUI widgets to simplify process of activity creation.

toolkit

Everything what developers need to start developing native sugar activities. Library depends on all other Polyol components and contains glue level code that simplify creating sugar activities from scratch. This library (and all its dependencies) is an analog of python based sugar-toolkit library.

Bindings for this library (in contrast with bindings for other Polyol components) could contain not only wrappers for library itself, but also particular language specific code that makes process of creating sugar activities in this language more comfortable.

Build from sources

Install required dependencies

Download last tarball.

Build it:

cd <sources-root> && cmake [-D<var-name>=<var-value>] . && make && make install

Useful cmake variables:

  • MAINTAINER_MODE, set to TRUE to recreate generated files, default is FALSE
  • CMAKE_C_FLAGS
  • CMAKE_INSTALL_PREFIX, default is /usr/local
  • PYTHON_SITEDIR, path within CMAKE_INSTALL_PREFIX to install python libraries, default is lib
  • COMPONENTS, ; separated list of components to build, default is all components
  • BINDINGS, ; separated list of bindings to build, default is all bindings

For each component, Polyol will install .pc file. So, after installing polyol, be sure that pkg-config will find .pc files e.g. setup PKG_CONFIG_PATH variable before using polyol.

Pitfalls

  • Python binding libraries cannot be linked with C libraries from sugar-toolkit.
    Polyol names contain the sugar prefix to reuse sugar-artwork as-is.

Sources