Changes

no edit summary
Line 3: Line 3:  
== Introduction ==
 
== Introduction ==
   −
[[Activities]] in the [[Sugar]] environment are packaged into a self-contained '''"bundles"'''.  Each bundle contains all the resources and executable code (other than system-provided base libraries) which the activity needs to execute.  Any resources or executable code that is not provided by the base system must be packaged within the bundle.  Activity bundles are the end result of, and use a different directory structure than, [[Creating_an_activity|activity development]]
+
[[Activities]] in the [[Sugar]] environment are packaged into a self-contained '''"bundles"'''.  Each bundle contains all the resources and executable code (other than system-provided base libraries) which the activity needs to execute.  Any resources or executable code that is not provided by the base system must be packaged within the bundle.  Activity bundles are the end result of, and use a different directory structure than, [[olpc:Creating_an_activity|activity development]]
    
; See also  
 
; See also  
* [[Bitfrost]] in general and its section on [[Bitfrost#Software installation|software installation]]
+
* [[olpc:OLPC Bitfrost]] in general and its section on [[olpc:OLPC Bitfrost#Software installation|software installation]]
* [[Design_Team/Human_Interface_Guidelines/Activities|HIG-Activities]] and its section on [[Design_Team/Human_Interface_Guidelines/Activities/Activity Bundles|activity bundles]]
+
* [[Human_Interface_Guidelines/Activities|HIG-Activities]] and its section on [[Human_Interface_Guidelines/Activities/Activity Bundles|activity bundles]]
* [[Creating an activity]]
+
* [[olpc:Creating an activity]]
    
== Rationale ==
 
== Rationale ==
Line 20: Line 20:  
Currently Sugar on jhbuild looks for bundles in the "activities" subfolders of XDG_DATA_DIRS.  Right now this is /usr/share/activities and the usr/share/activities subfolder of the jhbuild build folder.
 
Currently Sugar on jhbuild looks for bundles in the "activities" subfolders of XDG_DATA_DIRS.  Right now this is /usr/share/activities and the usr/share/activities subfolder of the jhbuild build folder.
   −
Sugar will automatically generate and remove the .service files necessary to launch the activity through [[D-BUS]] service activation when the activity is installed or removed.
+
Sugar will automatically generate and remove the .service files necessary to launch the activity through [[olpc:D-BUS]] service activation when the activity is installed or removed.
    
Activities should also NEVER store local state or preferences in the activity bundle itself.  These should always be stored in an activity-specific directory in the user's sugar profile, available through the SUGAR_PROFILE environment variable.
 
Activities should also NEVER store local state or preferences in the activity bundle itself.  These should always be stored in an activity-specific directory in the user's sugar profile, available through the SUGAR_PROFILE environment variable.
Line 54: Line 54:     
; activity
 
; activity
All metadata about the activity is organized in this subdirectory.  The <code>contents</code> and <code>contents.sig</code> are manifest and credential files for the entire bundle contents (excepting the <code>contents</code> and <code>contents.sig</code> files themselves), as described by the [[Manifest Specification]]. The optional <code>mimetypes.xml</code> file is a [http://freedesktop.org/wiki/Specifications/shared-mime-info-spec freedesktop.org MIME type file] describing how to recognize the MIME types defined by the activity. SVG icons for those MIME types can be put in this directory as well.
+
All metadata about the activity is organized in this subdirectory.  The <code>contents</code> and <code>contents.sig</code> are manifest and credential files for the entire bundle contents (excepting the <code>contents</code> and <code>contents.sig</code> files themselves), as described by the [[olpc:Contents manifest specification]]. The optional <code>mimetypes.xml</code> file is a [http://freedesktop.org/wiki/Specifications/shared-mime-info-spec freedesktop.org MIME type file] describing how to recognize the MIME types defined by the activity. SVG icons for those MIME types can be put in this directory as well.
    
;bin
 
;bin
Line 123: Line 123:  
; -u, --uri        : URI to load.
 
; -u, --uri        : URI to load.
   −
Python activities should generally use the generic sugar-activity executable. Other activities need to adhere to the [[Low-level Activity API]].
+
Python activities should generally use the generic sugar-activity executable. Other activities need to adhere to the [[olpc:Low-level Activity API]].
    
  mime_types = application/pdf;image/tiff
 
  mime_types = application/pdf;image/tiff
Line 133: Line 133:  
  update_url = ...
 
  update_url = ...
   −
: URL to retrieve update information; implemented in [http://dev.laptop.org/ticket/4951 #4951].  The software update control panel will attempt to look for information about the latest version of the activity by fetching the given url with first the core OS build number, then the release number, then the release major version number appended, then finally as-is.  (For example, if your update URL tag has the value 'http://host.net/bundles/FooBar' and you are currently running release 8.1.1 (core OS 708), the following URLs will be tried, in this order: http://host.net/bundles/FooBar/708, http://host.net/bundles/FooBar/8.1.1, http://host.net/bundles/FooBar/8.1, http://host.net/bundles/FooBar .)  The contents of the URLs should be in the [[activity microformat]].  If no update_url is specified, http://wiki.laptop.org/go/Activities will be used.  See [[Software update]] for more information.
+
: URL to retrieve update information; implemented in [http://dev.laptop.org/ticket/4951 #4951].  The software update control panel will attempt to look for information about the latest version of the activity by fetching the given url with first the core OS build number, then the release number, then the release major version number appended, then finally as-is.  (For example, if your update URL tag has the value 'http://host.net/bundles/FooBar' and you are currently running release 8.1.1 (core OS 708), the following URLs will be tried, in this order: http://host.net/bundles/FooBar/708, http://host.net/bundles/FooBar/8.1.1, http://host.net/bundles/FooBar/8.1, http://host.net/bundles/FooBar .)  The contents of the URLs should be in the [[olpc:Activity microformat]].  If no update_url is specified, http://wiki.laptop.org/go/Activities will be used.  See [[olpc:Software updater]] for more information.
    
  tags = exploration;web
 
  tags = exploration;web
Line 168: Line 168:  
== Bundling native libraries ==
 
== Bundling native libraries ==
   −
Sometimes you need to include a native library or two with your activity.  The strategy that [[Develop]] and [[Model]] use is specifying a shell script for the executable in the .info file:
+
Sometimes you need to include a native library or two with your activity.  The strategy that [[olpc:Develop]] and [[olpc:Model]] use is specifying a shell script for the executable in the .info file:
    
  exec = ./model_startup.sh
 
  exec = ./model_startup.sh
Line 181: Line 181:  
  sugar-activity model_app.ModelActivity
 
  sugar-activity model_app.ModelActivity
   −
Make sure to add your shell script and any native libraries to the MANIFEST before you package your bundle.  You can also accomplish the same thing by throwing all your libraries in the root folder of the bundle, like the [[Map_(activity)|Map activity]] does, but if you have more than a few libraries to include it can get quite cluttered.
+
Make sure to add your shell script and any native libraries to the MANIFEST before you package your bundle.  You can also accomplish the same thing by throwing all your libraries in the root folder of the bundle, like the [[olpc:Map_(activity)|Map activity]] does, but if you have more than a few libraries to include it can get quite cluttered.
      Line 222: Line 222:  
== See also ==
 
== See also ==
   −
* [[Bundle]] for a generic introduction to bundles
+
* [[olpc:Bundle]] for a generic introduction to bundles
* [[Activity tutorial]]
+
* [[olpc:Activity tutorial]]
    
[[Category:API]]
 
[[Category:API]]