Difference between revisions of "Sugar"

From ArchWiki
Jump to: navigation, search
m (Activities)
(update interlanguage links)
(Tag: wiki-scripts)
 
(52 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Desktop environments (English)]]
+
[[Category:Desktop environments]]
[[Category:HOWTOs (English)]]
+
[[it:Sugar]]
A product of the [http://en.wikipedia.org/wiki/One_Laptop_per_Child OLPC] initiative, [http://en.wikipedia.org/wiki/Sugar_(GUI) Sugar] is a Desktop Environment akin to [[KDE]] and [[GNOME]], but geared towards children and education. If you have a young son, daughter, brother, sister, puppy or alien, the best way to introduce them to the world of Arch Linux is by deploying an Arch/Sugar platform and then forgetting about it. That's the beauty of Arch Linux (TM) - Deploy and Forget (But Know How to Deploy).
+
[[ja:Sugar]]
 +
[[ru:Sugar]]
 +
A product of the [[Wikipedia:One Laptop per Child|OLPC]] initiative, [[Wikipedia:Sugar (software)|Sugar]] is a Desktop Environment akin to [[KDE]] and [[GNOME]], but geared towards children and education.
  
But wait..where art thou, O Sugar?
+
Sugar has a special [http://wiki.sugarlabs.org/go/Taxonomy Taxonomy] to name the parts of its system. The graphical interface itself constitute the '''Glucose''' group. This is the core system can reasonably expect to be present when installing Sugar. But to really use the environment, you need activities (some sort of applications). Base activities are part of '''Fructose'''. Then, '''Sucrose''' is constituted by both Glucose and Fructose and represents what should be distributed as a basic sugar desktop environment. Extra activities are part of '''Honey'''. Note that Ribose (the underlaying operating system) is here replaced by Arch.
  
That's right. To lead such a good life, you need at least some Sugar-related packages in at least [[AUR]].
+
== Installation ==
  
== Getting Started ==
+
* For the core system (''Glucose''), install {{Pkg|sugar}}. It provides the graphical interface and a desktop session, but not very useful on its own.
=== Building from AUR ===
+
* The {{Grp|sugar-fructose}} group contains the base activities (''Fructose'') including a web browser, a text editor, a media player and a terminal emulator.
 +
* The {{Pkg|sugar-runner}} package provides a helper script that makes it possible to launch Sugar within another desktop environment, or from the command line directly.
  
The esiest way is to use ''yaourt'' or a similar aur helper.
+
=== From Activity Library ===
yaourt -S sugar
 
  
=== Building a Bundle ===
+
The [http://wiki.sugarlabs.org/go/Activity_Library Sugar Activity Library] provides many [http://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles Activity Bundles] packaged as zip files with the ".xo" extension. These bundles can be downloaded and installed to the user's directory from Sugar, but the installation does not ensure that the dependencies are satisfied. Therefore it's not the recommended way to install activities, because they likely fail to start due missing dependencies. Commonly used dependencies:
[http://wiki.sugarlabs.org/go/Development_Team/Jhbuild This] is a cool build system provided by the developers that allows one to download and build Sugar ''almost'' in its entirety. You will be told what you need, and of course, it will not help if what you need has not yet been packaged for us mighty Archers.
+
* For web activities, install {{Pkg|webkit2gtk}} from the official repositories.
 +
* For GTK+ 2 based activities, install {{AUR|sugar-toolkit-gtk2}} from AUR.
  
The resulting project can then be offered as a bundle. This method of building should not be encouraged, since it is not "modular". A likely analogy is the [[E17#Installing_E17_using_easy_e17.sh|easy-e17 script]], except that we are in the opposite situation whereby there are no modular packages and thus no group - yet. Adding the provision is a safety measure, .eg:
+
In order to check why the activity fails to start, look at the log file located at {{ic|~/.sugar/default/logs/[app_id]-1.log}}.
  
pkgname=sugar-bundle
+
== Starting Sugar ==
pkgdesc="The Sugar environment and applications built with jhbuild"
 
provides=('sugar-desktop') # as in provides=('e')
 
conflicts=('sugar-desktop')
 
  
But as soon as someone uploads a component of the build/Sugar as a separate package, it must be part of the group (and the bundle package will automatically conflict), eg.:
+
Sugar can be started either graphically, using a [[display manager]], or manually from the console.
  
pkgname=sugar-toolkit
+
'''Graphically'''
pkgdesc="The Sugar environment toolkit"
 
groups=('sugar-desktop' 'sugar-desktop-base')
 
  
''Note: It might be possible to use the new split functions of makepkg here, in which case it will end up as a modular build :)''
+
Select the session ''Sugar'' from the display manager's session menu.
  
=== Building a Modular Group ===
+
'''Manually'''
This is the more appropriate route to take. Here is the current list of noted dependencies, acquired by inspecting the build trees of distributions supported by Sugar (Gentoo in particular):
 
  
# Syntax: pkgname .. :-> location + comment1 + comment2 ..
+
If {{Pkg|sugar-runner}} installed, Sugar can be launched with the {{ic|sugar-runner}} command.
 
espeak :-> [community]
 
squeak :-> [unsupported] + outdated + needs patching for sugar
 
evince :-> [extra] + needs patching for sugar
 
pyabiword :-> [unsupported]
 
python-cjson :-> [community]
 
python-telepathy :-> [community]
 
gstreamer0.10-espeak :-> [unsupported]
 
olpcsound :-> [unsupported]
 
telepathy-glib :-> [community]
 
xulrunner :-> [extra]
 
telepathy-gabble :-> [community]
 
telepathy-salut :-> [community]
 
hippo-canvas :-> [unsupported]
 
  
And the ''bash-fu'' to install all existing packages (if you have saved the above in a file called '''sugar.todo'''):
+
Alternative method is to add {{ic|exec sugar}} to the {{ic|~/.xinitrc}} file. After that, Sugar can be launched with the {{ic|startx}} command (see [[xinitrc]] for additional details).  After setting up the {{ic|~/.xinitrc}} file, it can also be arranged to [[Start X at login]].
  
~# pacman -S $(grep ":->" sugar.todo | grep -v unsupported | awk '{print $1}')
+
== See also ==
  
The above basically filters the output, first matching a string with '''grep''', then leaving out matches with '''grep -v''', and finally showing only the first coloumn of ''stdout'' with '''awk'''.
+
* [http://sugarlabs.org/ The Official Website of Sugar]
 
+
* [http://activities.sugarlabs.org/ Activities for Sugar]
The following are "Level 2" dependencies:
 
 
 
abiword-devel :-> [unsupported] + required by pyabiword
 
 
 
== The Applications ==
 
=== Depedency tree===
 
Below is the dependency tree of sugar 0.86
 
|--sugar
 
    |--hicolor-icon-theme
 
    |--shared-mime-info
 
    |--metacity
 
    |--libwnck
 
    |--pygtksourceview2
 
    |--sugar-artwork
 
    |--python-xklavier
 
    |  |--libxklavier
 
    |  |--pygobject
 
    |  |--gtk2
 
    |--sugar-toolkit
 
      |--alsa-lib
 
      |--gnome-python-desktop
 
      |--hippo-canvas
 
      |  |--librsvg
 
      |    |--gtk2
 
      |    |--libcroco
 
      |--sugar-datastore
 
      |  |--dbus-python
 
      |  |--xapian-python-bindings
 
      |  |--python-cjson
 
      |  |--sugar-base
 
      |    |--pygobject
 
      |    |--python-decorator
 
      |--sugar-presence-service
 
          |--telepathy-gabble
 
          |--telepathy-salut
 
          |--python-telepathy
 
          |--sugar-base
 
          |  |--pygobject
 
          |  |--python-decorator
 
          |--gnome-python
 
            |--pygtk
 
            |--pyorbit
 
            |--libgnomeui
 
                |--libsm
 
 
 
===Activities===
 
 
 
Now you have a working Sugar environment, it is time to populate it with activities such as a browser, a calculator, an image viewer or games and toys. They almost all have the same building procedure, a {{Filename|setup.py}} that calls functions shipped with sugar. Below is a typical {{Filename|PKGBUILD}}:
 
{{File|name=PKGBUILD|content=
 
# Contributor: Name <name@mail.com>
 
pkgname=sugar-activity-calculate
 
_realname=Calculate
 
pkgver=30
 
pkgrel=1
 
pkgdesc="A calculator for Sugar."
 
arch=('i686' 'x86_64')
 
url="http://www.sugarlabs.org/"
 
license=('GPL')
 
groups=('sucrose' 'fructose')
 
depends=('sugar')
 
source=(http://download.sugarlabs.org/sources/sucrose/fructose/${_realname}/${_realname}-$pkgver.tar.bz2)
 
md5sums=('011bd911516f27d05194320164c7dcd7')
 
 
 
build() {
 
  cd "$srcdir/${_realname}-$pkgver"
 
  ./setup.py install --prefix="$pkgdir/usr" &#124;&#124; return 1
 
}
 
# vim:set ts=2 sw=2 et:
 
}}
 
You may need <tt>squeak</tt> to run some activities (like <tt>etoys</tt>).
 
 
 
===Notes===
 
 
 
* Activity building procedure is not made for packaging and using <tt>--prefix</tt> can be dangerous if the application uses this path internally. I think the correct way to do this would be to patch the installation procedure in <tt>sugar</tt> so it accept an argument such as <tt>--destdir=</tt>.
 
 
 
* I ''suggest'' that we prefix sugar activities packages in AUR with <tt>sugar-activity-</tt>.
 
 
 
* About groups according to the official site, the desktop itself consitute the <tt>glucose</tt> group. Main activities are part of <tt>fructose</tt>. And <tt>sucrose</tt> is constituted by both <tt>glucose</tt> and <tt>fructose</tt> and represents what should be distributed as a basic sugar desktop environment.
 
 
 
* Below is a list of basic activities we should probably provide in AUR:
 
imageviewer
 
browse
 
terminal
 
turtleart
 
etoys
 
chat
 
pippy
 
read
 
calculate
 
jukebox
 
write
 

Latest revision as of 07:53, 4 August 2017

A product of the OLPC initiative, Sugar is a Desktop Environment akin to KDE and GNOME, but geared towards children and education.

Sugar has a special Taxonomy to name the parts of its system. The graphical interface itself constitute the Glucose group. This is the core system can reasonably expect to be present when installing Sugar. But to really use the environment, you need activities (some sort of applications). Base activities are part of Fructose. Then, Sucrose is constituted by both Glucose and Fructose and represents what should be distributed as a basic sugar desktop environment. Extra activities are part of Honey. Note that Ribose (the underlaying operating system) is here replaced by Arch.

Installation

  • For the core system (Glucose), install sugar. It provides the graphical interface and a desktop session, but not very useful on its own.
  • The sugar-fructose group contains the base activities (Fructose) including a web browser, a text editor, a media player and a terminal emulator.
  • The sugar-runner package provides a helper script that makes it possible to launch Sugar within another desktop environment, or from the command line directly.

From Activity Library

The Sugar Activity Library provides many Activity Bundles packaged as zip files with the ".xo" extension. These bundles can be downloaded and installed to the user's directory from Sugar, but the installation does not ensure that the dependencies are satisfied. Therefore it's not the recommended way to install activities, because they likely fail to start due missing dependencies. Commonly used dependencies:

  • For web activities, install webkit2gtk from the official repositories.
  • For GTK+ 2 based activities, install sugar-toolkit-gtk2AUR from AUR.

In order to check why the activity fails to start, look at the log file located at ~/.sugar/default/logs/[app_id]-1.log.

Starting Sugar

Sugar can be started either graphically, using a display manager, or manually from the console.

Graphically

Select the session Sugar from the display manager's session menu.

Manually

If sugar-runner installed, Sugar can be launched with the sugar-runner command.

Alternative method is to add exec sugar to the ~/.xinitrc file. After that, Sugar can be launched with the startx command (see xinitrc for additional details). After setting up the ~/.xinitrc file, it can also be arranged to Start X at login.

See also