diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-11-27 13:55:18 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-11-27 13:55:18 (GMT) |
commit | c1094816c1cf3ca6293f26df8e0acb7873cc23ad (patch) | |
tree | 7e9dd0c8816885fa12cbf087877a5e5b5022362a | |
parent | 37d384c19bc027b48a473ccc53fa3a0614db47ca (diff) |
Add a modtype to build bundles. Split bundles out to their
own .modules. Move extras and not yet ported stuff to sugar-extras.modules
-rw-r--r-- | build-scripts/olpc.jhbuildrc | 6 | ||||
-rw-r--r-- | build-scripts/sugar-activities.modules | 12 | ||||
-rw-r--r-- | build-scripts/sugar-extras.modules | 65 | ||||
-rw-r--r-- | build-scripts/sugar-framework.modules | 84 | ||||
-rw-r--r-- | build-scripts/sugar.modules | 154 | ||||
-rw-r--r-- | bundlemodule.py | 94 | ||||
-rwxr-xr-x | sugar-jhbuild | 3 |
7 files changed, 262 insertions, 156 deletions
diff --git a/build-scripts/olpc.jhbuildrc b/build-scripts/olpc.jhbuildrc index 87ad99a..31d9841 100644 --- a/build-scripts/olpc.jhbuildrc +++ b/build-scripts/olpc.jhbuildrc @@ -4,9 +4,11 @@ base_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) prefix = os.path.join(base_dir, 'build') checkoutroot = os.path.join(base_dir, 'source') moduleset = [ 'gnome-2.16' ] -moduleset.append(os.path.join(base_dir, 'build-scripts', 'sugar.modules')) +moduleset.append(os.path.join(base_dir, 'build-scripts', 'sugar-framework.modules')) +moduleset.append(os.path.join(base_dir, 'build-scripts', 'sugar-activities.modules')) +moduleset.append(os.path.join(base_dir, 'build-scripts', 'sugar-extras.modules')) moduleset.append(os.path.join(base_dir, 'build-scripts/jhbuild/modulesets', 'bootstrap.modules')) -modules = [ 'meta-sugar' ] +modules = [ 'sugar', 'memorygame', 'tamtam' ] module_autogenargs['dbus'] = '--with-system-socket=/var/run/dbus/system_bus_socket' diff --git a/build-scripts/sugar-activities.modules b/build-scripts/sugar-activities.modules new file mode 100644 index 0000000..6f0ca76 --- /dev/null +++ b/build-scripts/sugar-activities.modules @@ -0,0 +1,12 @@ +<?xml version="1.0"?><!--*- mode: nxml; indent-tabs-mode: nil -*--> +<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> +<moduleset> + <repository type="git" name="dev.laptop.org/projects" + href="git://dev.laptop.org/projects/"/> + <bundle id="memorygame"> + <branch repo="dev.laptop.org/projects"/> + </bundle> + <bundle id="tamtam"> + <branch repo="dev.laptop.org/projects"/> + </bundle> +</moduleset> diff --git a/build-scripts/sugar-extras.modules b/build-scripts/sugar-extras.modules new file mode 100644 index 0000000..877036f --- /dev/null +++ b/build-scripts/sugar-extras.modules @@ -0,0 +1,65 @@ +<?xml version="1.0"?><!--*- mode: nxml; indent-tabs-mode: nil -*--> +<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> +<moduleset> + <repository type="cvs" name="gnome.org" + cvsroot=":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome" + password=""/> + <repository type="cvs" name="abisource.com" + cvsroot=":pserver:anoncvs@anoncvs.abisource.com:/cvsroot" + password="anoncvs"/> + <repository type="git" name="dev.laptop.org/projects" + href="git://dev.laptop.org/projects/"/> + <repository type="svn" name="matchbox.o-hand.com" + href="http://svn.o-hand.com/repos/matchbox/"/> + <repository type="svn" name="tinymail.tinymail.org" + href="https://svn.tinymail.org/svn/tinymail/" /> + <repository type="svn" name="tinlizzie.org" + href="http://tinlizzie.org/olpc/sugar/" /> + <repository type="svn" name="camel-lite-builder.tinymail.org" + href="https://svn.tinymail.org/svn/camel-lite-builder/" /> + <autotools id="camel-lite-builder"> + <branch repo="camel-lite-builder.tinymail.org" module="trunk" checkoutdir="camel-lite-builder" /> + <dependencies> + </dependencies> + </autotools> + <autotools id="tinymail" autogenargs="--with-platform=olpc"> + <branch repo="tinymail.tinymail.org" module="trunk" checkoutdir="tinymail" /> + <dependencies> + <dep package="camel-lite-builder" /> + </dependencies> + </autotools> + <autotools id="evince-olpc"> + <branch repo="dev.laptop.org/projects"/> + <dependencies> + <dep package="poppler"/> + </dependencies> + </autotools> + <autotools id="xbook"> + <branch repo="dev.laptop.org/projects"/> + <dependencies> + <dep package="sugar"/> + <dep package="evince-olpc"/> + </dependencies> + </autotools> + <autotools id="wv" > + <branch repo="abisource.com" module="wv"/> + </autotools> + <autotools id="abiword" autogenargs="--enable-sugar --enable-symbols --disable-debug --disable-gnome --disable-gucharmap"> + <branch repo="abisource.com" module="abi" checkoutdir="abiword" revision="sugar"/> + <dependencies> + <dep package="wv"/> + </dependencies> + </autotools> + <autotools id="squeak"> + <branch repo="tinlizzie.org"/> + <dependencies> + </dependencies> + </autotools> + <autotools id="etoys"> + <branch repo="dev.laptop.org/projects"/> + <dependencies> + <dep package="sugar"/> + <dep package="squeak"/> + </dependencies> + </autotools> +</moduleset> diff --git a/build-scripts/sugar-framework.modules b/build-scripts/sugar-framework.modules new file mode 100644 index 0000000..f061ee8 --- /dev/null +++ b/build-scripts/sugar-framework.modules @@ -0,0 +1,84 @@ +<?xml version="1.0"?><!--*- mode: nxml; indent-tabs-mode: nil -*--> +<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> +<moduleset> + <include href="jhbuild/modulesets/gnome-2.16.modules"/> + <repository type="cvs" name="gnome.org" + cvsroot=":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome" + password=""/> + <repository type="cvs" name="mozilla.org" + cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot" + password="anonymous"/> + <repository type="cvs" name="cairographics.org" + cvsroot=":pserver:anonymous@cvs.cairographics.org:/cvs/cairo" + password=""/> + <repository type="git" name="dev.laptop.org" default="yes" + href="git://dev.laptop.org/"/> + <repository type="svn" name="matchbox.o-hand.com" + href="http://svn.o-hand.com/repos/matchbox/"/> + <tarball id="libmatchbox" version="1.8"> + <source href="http://projects.o-hand.com/matchbox/sources/libmatchbox/1.8/libmatchbox-1.8.tar.bz2" + size="303304" md5sum="6bbd6b41f4fd78b7baa6157b303e5ac0"/> + <dependencies> + </dependencies> + </tarball> + <tarball id="hippo-canvas" version="0.1.5"> + <source href="http://www.gnome.org/~marco/hippo-canvas-0.1.5.tar.gz" + size="377787" md5sum="1b95c18779a98a77653e70da7b8c1185"/> + <dependencies> + <dep package="gtk+"/> + </dependencies> + </tarball> + <autotools id="matchbox-window-manager" autogenargs="--enable-composite"> + <branch repo="matchbox.o-hand.com" module="trunk/matchbox-window-manager"/> + <dependencies> + <dep package="libmatchbox"/> + </dependencies> + </autotools> + <autotools id="gnome-python-extras"> + <branch repo="gnome.org"/> + <dependencies> + <dep package="pygtk"/> + <dep package="mozilla"/> + </dependencies> + </autotools> + <autotools id="sugar"> + <branch/> + <dependencies> + <dep package="dbus"/> + <dep package="gnome-common"/> + <dep package="artwork"/> + <dep package="matchbox-window-manager"/> + <dep package="gnome-python-desktop"/> + <dep package="hippo-canvas"/> + <dep package="gnome-python-extras"/> + </dependencies> + </autotools> + <mozillamodule id="mozilla" autogenargs="--enable-default-toolkit=gtk2 --disable-mailnews --disable-ldap --disable-debug --enable-optimize --disable-tests --enable-crypto --enable-xft --with-system-zlib --disable-freetype2 --enable-application=browser --disable-javaxpcom --enable-extensions=default,cookie" cvsroot="mozilla.org" revision="MOZILLA_1_8_BRANCH" projects="xulrunner"> + <dependencies> + </dependencies> + </mozillamodule> + <autotools id="artwork"> + <branch repo="dev.laptop.org" module="artwork"/> + <dependencies> + <dep package="gtk+"/> + <dep package="intltool"/> + </dependencies> + </autotools> + <autotools id="librsvg" supports-non-srcdir-builds="no" autogenargs="--disable-gtk-theme --disable-gnome-vfs --without-svgz"> + <branch repo="gnome.org"/> + <dependencies> + <dep package="libxml2"/> + <dep package="gtk+"/> + <dep package="gnome-common"/> + <dep package="libcroco"/> + </dependencies> + </autotools> + <autotools id="gnome-python-desktop"> + <branch repo="gnome.org"/> + <dependencies> + <dep package="pygtk"/> + <dep package="libwnck"/> + <dep package="librsvg"/> + </dependencies> + </autotools> +</moduleset> diff --git a/build-scripts/sugar.modules b/build-scripts/sugar.modules deleted file mode 100644 index 7224ca5..0000000 --- a/build-scripts/sugar.modules +++ /dev/null @@ -1,154 +0,0 @@ -<?xml version="1.0"?><!--*- mode: nxml; indent-tabs-mode: nil -*--> -<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> -<moduleset> - <include href="jhbuild/modulesets/gnome-2.16.modules"/> - <repository type="cvs" name="gnome.org" - cvsroot=":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome" - password=""/> - <repository type="cvs" name="mozilla.org" - cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot" - password="anonymous"/> - <repository type="cvs" name="abisource.com" - cvsroot=":pserver:anoncvs@anoncvs.abisource.com:/cvsroot" - password="anoncvs"/> - <repository type="cvs" name="cairographics.org" - cvsroot=":pserver:anonymous@cvs.cairographics.org:/cvs/cairo" - password=""/> - <repository type="git" name="dev.laptop.org" default="yes" - href="git://dev.laptop.org/"/> - <repository type="git" name="dev.laptop.org/projects" - href="git://dev.laptop.org/projects/"/> - <repository type="svn" name="matchbox.o-hand.com" - href="http://svn.o-hand.com/repos/matchbox/"/> - <repository type="svn" name="camel-lite-builder.tinymail.org" - href="https://svn.tinymail.org/svn/camel-lite-builder/" /> - <repository type="svn" name="berlios.de" - href="svn://svn.berlios.de/" /> - <repository type="svn" name="tinymail.tinymail.org" - href="https://svn.tinymail.org/svn/tinymail/" /> - <repository type="svn" name="tinlizzie.org" - href="http://tinlizzie.org/olpc/sugar/" /> - <tarball id="libmatchbox" version="1.8"> - <source href="http://projects.o-hand.com/matchbox/sources/libmatchbox/1.8/libmatchbox-1.8.tar.bz2" - size="303304" md5sum="6bbd6b41f4fd78b7baa6157b303e5ac0"/> - <dependencies> - </dependencies> - </tarball> - <tarball id="hippo-canvas" version="0.1.5"> - <source href="http://www.gnome.org/~marco/hippo-canvas-0.1.5.tar.gz" - size="377787" md5sum="1b95c18779a98a77653e70da7b8c1185"/> - <dependencies> - <dep package="gtk+"/> - </dependencies> - </tarball> - <autotools id="camel-lite-builder"> - <branch repo="camel-lite-builder.tinymail.org" module="trunk" checkoutdir="camel-lite-builder" /> - <dependencies> - </dependencies> - </autotools> - <autotools id="tinymail" autogenargs="--with-platform=olpc"> - <branch repo="tinymail.tinymail.org" module="trunk" checkoutdir="tinymail" /> - <dependencies> - <dep package="camel-lite-builder" /> - </dependencies> - </autotools> - <autotools id="matchbox-window-manager" autogenargs="--enable-composite"> - <branch repo="matchbox.o-hand.com" module="trunk/matchbox-window-manager"/> - <dependencies> - <dep package="libmatchbox"/> - </dependencies> - </autotools> - <autotools id="gnome-python-extras"> - <branch repo="gnome.org"/> - <dependencies> - <dep package="pygtk"/> - <dep package="mozilla"/> - </dependencies> - </autotools> - <autotools id="sugar"> - <branch/> - <dependencies> - <dep package="dbus"/> - <dep package="gnome-common"/> - <dep package="artwork"/> - <dep package="matchbox-window-manager"/> - <dep package="gnome-python-desktop"/> - <dep package="hippo-canvas"/> - <dep package="gnome-python-extras"/> - </dependencies> - </autotools> - <mozillamodule id="mozilla" autogenargs="--enable-default-toolkit=gtk2 --disable-mailnews --disable-ldap --disable-debug --enable-optimize --disable-tests --enable-crypto --enable-xft --with-system-zlib --disable-freetype2 --enable-application=browser --disable-javaxpcom --enable-extensions=default,cookie" cvsroot="mozilla.org" revision="MOZILLA_1_8_BRANCH" projects="xulrunner"> - <dependencies> - </dependencies> - </mozillamodule> - <autotools id="evince-olpc"> - <branch repo="dev.laptop.org/projects"/> - <dependencies> - <dep package="poppler"/> - </dependencies> - </autotools> - <autotools id="xbook"> - <branch repo="dev.laptop.org/projects"/> - <dependencies> - <dep package="sugar"/> - <dep package="evince-olpc"/> - </dependencies> - </autotools> - <autotools id="memorygame"> - <branch repo="dev.laptop.org/projects"/> - <dependencies> - <dep package="sugar"/> - </dependencies> - </autotools> - <autotools id="artwork"> - <branch repo="dev.laptop.org" module="artwork"/> - <dependencies> - <dep package="gtk+"/> - <dep package="intltool"/> - </dependencies> - </autotools> - <autotools id="librsvg" supports-non-srcdir-builds="no" autogenargs="--disable-gtk-theme --disable-gnome-vfs --without-svgz"> - <branch repo="gnome.org"/> - <dependencies> - <dep package="libxml2"/> - <dep package="gtk+"/> - <dep package="gnome-common"/> - <dep package="libcroco"/> - </dependencies> - </autotools> - <autotools id="gnome-python-desktop"> - <branch repo="gnome.org"/> - <dependencies> - <dep package="pygtk"/> - <dep package="libwnck"/> - <dep package="librsvg"/> - </dependencies> - </autotools> - <autotools id="wv" > - <branch repo="abisource.com" module="wv"/> - </autotools> - <autotools id="abiword" autogenargs="--enable-sugar --enable-symbols --disable-debug --disable-gnome --disable-gucharmap"> - <branch repo="abisource.com" module="abi" checkoutdir="abiword" revision="sugar"/> - <dependencies> - <dep package="wv"/> - </dependencies> - </autotools> - <autotools id="squeak"> - <branch repo="tinlizzie.org"/> - <dependencies> - </dependencies> - </autotools> - <autotools id="etoys"> - <branch repo="dev.laptop.org/projects"/> - <dependencies> - <dep package="sugar"/> - <dep package="squeak"/> - </dependencies> - </autotools> - <metamodule id="meta-sugar"> - <dependencies> - <dep package="sugar"/> - <dep package="etoys"/> - </dependencies> - </metamodule> -</moduleset> diff --git a/bundlemodule.py b/bundlemodule.py new file mode 100644 index 0000000..7bfa685 --- /dev/null +++ b/bundlemodule.py @@ -0,0 +1,94 @@ +__metaclass__ = type + +import os + +from jhbuild.errors import BuildStateError +from jhbuild.modtypes import Package, get_branch, register_module_type + +__all__ = [ 'BundleModule' ] + +class BundleModule(Package): + type = 'bundle' + + STATE_CHECKOUT = 'checkout' + STATE_FORCE_CHECKOUT = 'force_checkout' + STATE_BUILD = 'build' + STATE_INSTALL = 'install' + + def __init__(self, name, branch, dependencies=[], after=[]): + Package.__init__(self, name, dependencies, after) + self.branch = branch + + def get_srcdir(self, buildscript): + return self.branch.srcdir + + def get_builddir(self, buildscript): + return self.get_srcdir(buildscript) + + def get_revision(self): + return self.branch.branchname + + def do_start(self, buildscript): + pass + do_start.next_state = STATE_CHECKOUT + do_start.error_states = [] + + def skip_checkout(self, buildscript, last_state): + # skip the checkout stage if the nonetwork flag is set + return buildscript.config.nonetwork + + def do_checkout(self, buildscript): + srcdir = self.get_srcdir(buildscript) + buildscript.set_action('Checking out', self) + self.branch.checkout(buildscript) + # did the checkout succeed? + if not os.path.exists(srcdir): + raise BuildStateError('source directory %s was not created' + % srcdir) + do_checkout.next_state = STATE_BUILD + do_checkout.error_states = [STATE_FORCE_CHECKOUT] + + def skip_force_checkout(self, buildscript, last_state): + return False + + def do_force_checkout(self, buildscript): + buildscript.set_action('Checking out', self) + self.branch.force_checkout(buildscript) + do_force_checkout.next_state = STATE_BUILD + do_force_checkout.error_states = [STATE_FORCE_CHECKOUT] + + def skip_build(self, buildscript, last_state): + return buildscript.config.nobuild + + def do_build(self, buildscript): + buildscript.set_action('Building', self) + srcdir = self.get_srcdir(buildscript) + builddir = self.get_builddir(buildscript) + python = os.environ.get('PYTHON', 'python') + cmd = [python, 'setup.py', 'build'] + buildscript.execute(cmd, cwd=srcdir) + do_build.next_state = STATE_INSTALL + do_build.error_states = [STATE_FORCE_CHECKOUT] + + def skip_install(self, buildscript, last_state): + return buildscript.config.nobuild + + def do_install(self, buildscript): + buildscript.set_action('Installing', self) + srcdir = self.get_srcdir(buildscript) + builddir = self.get_builddir(buildscript) + python = os.environ.get('PYTHON', 'python') + cmd = [python, 'setup.py'] + cmd.extend(['install', buildscript.config.prefix]) + buildscript.execute(cmd, cwd=srcdir) + buildscript.packagedb.add(self.name, self.get_revision() or '') + do_install.next_state = Package.STATE_DONE + do_install.error_states = [] + + +def parse_bundle(node, config, repositories, default_repo): + id = node.getAttribute('id') + branch = get_branch(node, repositories, default_repo) + return BundleModule(id, branch) + +register_module_type('bundle', parse_bundle) diff --git a/sugar-jhbuild b/sugar-jhbuild index fa7ebb9..7990004 100755 --- a/sugar-jhbuild +++ b/sugar-jhbuild @@ -54,9 +54,12 @@ if LibDependency('xulrunner', 'xulrunner-gtkmozembed').check(): skip_modules.append('mozilla') sys.path.append(os.path.join(build_scripts_dir, 'jhbuild')) + import jhbuild.config import jhbuild.commands +import bundlemodule + config = configure() for module in skip_modules: |