Difference between revisions of "Sugar"

From ArchWiki
Jump to: navigation, search
(updated a bulk of stuff)
(33 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Desktop environments (English)]]
+
[[Category:Desktop environments]]
[[Category:HOWTOs (English)]]
+
[[Category:Desktop environments (Русский)]]
 
+
[[it:Sugar]]
== Introduction ==
+
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.
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).
+
  
 
But wait..where art thou, O Sugar?
 
But wait..where art thou, O Sugar?
Line 9: Line 8:
 
That's right. To lead such a good life, you need at least some Sugar-related packages in at least [[AUR]].
 
That's right. To lead such a good life, you need at least some Sugar-related packages in at least [[AUR]].
  
== Getting Started ==
+
Sugar has a special [http://wiki.sugarlabs.org/go/Taxonomy Taxonomy] to name the parts of its system. The desktop itself constitute the '''glucose''' group. This is the basic system an activity can reasonably expect to be present when installing Sugar. But to really use the environment, you need activities. Basic and sample activities are part of '''fructose'''. Then, '''sucrose''' is constituted by both {{Ic|glucose}} and {{Ic|fructose}} and represents what should be distributed as a basic sugar desktop environment. Note that {{Ic|ribose}} (the underlaying operating system) is here replaced by Arch.{{Ic|Honey}} (the extra activities) are not currently provided in AUR but can be installed as shown in the [[#Building]] section.
[[User:Schivmeister|I]] have begun noting down the dependencies, and if I do get the time to complete scripting the entire '''sugar''' group, I will put them all up on [[AUR]] as soon as I am able to.
+
  
''"I hope we can remove these first-person references soon" -- [[User:Schivmeister|schiv]] on himself''
+
== Getting started: Glucose ==
 +
=== Building from AUR ===
  
And yes, YOU should not be lazy and carry on independently from the information herein.
+
Install [https://aur.archlinux.org/packages.php?ID=32989 sugar] from the [[AUR]].
  
 
=== Building a Bundle ===
 
=== Building a Bundle ===
Line 31: Line 30:
 
  pkgdesc="The Sugar environment toolkit"
 
  pkgdesc="The Sugar environment toolkit"
 
  groups=('sugar-desktop' 'sugar-desktop-base')
 
  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 :)''
 +
 +
=== 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
  
 
=== Building a Modular Group ===
 
=== Building a Modular Group ===
Line 38: Line 79:
 
   
 
   
 
  espeak :-> [community]
 
  espeak :-> [community]
  squeak :-> [unsupported] + outdated + needs patching for sugar
+
  squeak :-> [unsupported]
  evince :-> [extra] + needs patching for sugar
+
  evince :-> [extra]
 
  pyabiword :-> [unsupported]
 
  pyabiword :-> [unsupported]
 
  python-cjson :-> [community]
 
  python-cjson :-> [community]
 
  python-telepathy :-> [community]
 
  python-telepathy :-> [community]
  gst-plugins-espeak :-> [unsupported]
+
  gstreamer0.10-espeak :-> [unsupported]
 
  olpcsound :-> [unsupported]
 
  olpcsound :-> [unsupported]
 
  telepathy-glib :-> [community]
 
  telepathy-glib :-> [community]
Line 51: Line 92:
 
  hippo-canvas :-> [unsupported]
 
  hippo-canvas :-> [unsupported]
  
And the ''bash-fu'' to install all existing packages (if you have saved the above in a file called '''sugar.todo'''):
+
== Activities ==
  
~# pacman -S $(grep ":->" sugar.todo | grep -v unsupported | awk '{print $1}')
+
=== Fructose ===
  
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'''.
+
All {{Ic|fructose}} activities are available on the AUR. To install them, you may issue
 +
yaourt sugar-activity
 +
or equivalent and select the activities you want to install.
 +
Currently provided activities are
 +
browse
 +
calculate
 +
chat
 +
imageviewer
 +
jukebox
 +
log
 +
pippy
 +
read
 +
terminal
 +
turtleart
 +
write
 +
etoys
  
The following are "Level 2" dependencies (required by the above):
+
=== Etoys ===
  
  abiword-devel :-> [unsupported] + required by pyabiword
+
{{Ic|etoys}} is provided separately as it is part of glucose but also include the fructose activity. You may install it using
 +
  yaourt -S etoys
 +
or an equivalent AUR helper.
  
== The Applications ==
+
=== Building===
Again, from inspection of the Sugar-supported build systems, the following are the Sugar components that we ''should'' be distributing:
+
  
hulahop
+
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 {{ic|setup.py}} that calls functions shipped with sugar. Below is a typical {{ic|PKGBUILD}}:
  sugar-toolkit
+
{{hc|PKGBUILD|2=
datastore
+
  # Contributor: Name <name@mail.com>
presence-service
+
pkgname=sugar-activity-calculate
sugar
+
_realname=Calculate
sugar-base
+
pkgver=30
artwork
+
pkgrel=1
imageviewer-activity
+
pkgdesc="A calculator for Sugar."
web-activity
+
arch=('i686' 'x86_64')
log-activity
+
url="http://www.sugarlabs.org/"
terminal-activity
+
license=('GPL')
turtleart-activity
+
groups=('sucrose' 'fructose')
etoys
+
depends=('sugar')
chat-activity
+
source=(http://download.sugarlabs.org/sources/sucrose/fructose/${_realname}/${_realname}-$pkgver.tar.bz2)
pippy-activity
+
md5sums=('011bd911516f27d05194320164c7dcd7')
read-activity
+
 
calculate
+
build() {
jukebox
+
  cd "$srcdir/${_realname}-$pkgver"
write
+
  ./setup.py install --prefix="$pkgdir/usr" &#124;&#124; return 1
 +
}
 +
# vim:set ts=2 sw=2 et:
 +
}}
 +
You may need {{Ic|squeak}} to run some activities (like {{Ic|etoys}}).
 +
 
 +
===Notes===
 +
 
 +
* Activity building procedure is not made for packaging and using {{Ic|--prefix}} 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 {{Ic|sugar}} so it accepts an argument such as {{Ic|<nowiki>--destdir=</nowiki>}}.
  
Things to ponder about:
+
* I ''suggest'' that we prefix sugar activities packages in AUR with {{Ic|sugar-activity-}}.
  
* Should we prepend "sugar" to ''all'' the individual packages (some of the names are pretty generic) eg.'''sugar-hulahop'''?
+
* You may need to install {{Ic|python-pygame}} if activities do not start up.
** Even if the name has ''not'' been taken by another package in the repos/AUR?
+

Revision as of 10:26, 30 August 2012

A product of the OLPC initiative, 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.

But wait..where art thou, O Sugar?

That's right. To lead such a good life, you need at least some Sugar-related packages in at least AUR.

Sugar has a special Taxonomy to name the parts of its system. The desktop itself constitute the glucose group. This is the basic system an activity can reasonably expect to be present when installing Sugar. But to really use the environment, you need activities. Basic and sample 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. Note that ribose (the underlaying operating system) is here replaced by Arch.Honey (the extra activities) are not currently provided in AUR but can be installed as shown in the #Building section.

Getting started: Glucose

Building from AUR

Install sugar from the AUR.

Building a Bundle

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.

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 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:

pkgname=sugar-bundle
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.:

pkgname=sugar-toolkit
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 :)

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

Building a Modular Group

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 ..

espeak			 :-> [community]
squeak			 :-> [unsupported]
evince			 :-> [extra]
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]

Activities

Fructose

All fructose activities are available on the AUR. To install them, you may issue

yaourt sugar-activity

or equivalent and select the activities you want to install. Currently provided activities are

browse
calculate
chat
imageviewer
jukebox
log
pippy
read
terminal
turtleart
write
etoys

Etoys

etoys is provided separately as it is part of glucose but also include the fructose activity. You may install it using

yaourt -S etoys

or an equivalent AUR helper.

Building

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 setup.py that calls functions shipped with sugar. Below is a typical PKGBUILD:

PKGBUILD
# 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" || return 1
}
# vim:set ts=2 sw=2 et:

You may need squeak to run some activities (like etoys).

Notes

  • Activity building procedure is not made for packaging and using --prefix 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 sugar so it accepts an argument such as --destdir=.
  • I suggest that we prefix sugar activities packages in AUR with sugar-activity-.
  • You may need to install python-pygame if activities do not start up.