[Dextrose] [PATCH 5/5] Sweet build
alsroot at sugarlabs.org
alsroot at sugarlabs.org
Fri Oct 21 21:34:06 EDT 2011
From: Aleksey Lim <alsroot at sugarlabs.org>
---
.gitignore | 3 +
Makefile.am | 7 +++-
bin/Makefile.am | 5 ++-
bin/sugar-session | 1 -
bin/sugar.in | 24 ++++++++++-
configure.ac | 1 -
src/jarabe/config.py.in | 13 +++---
src/jarabe/model/bundleregistry.py | 7 ++-
sweets.recipe | 72 ++++++++++++++++++++++++++++++++++++
9 files changed, 117 insertions(+), 16 deletions(-)
mode change 100644 => 100755 bin/sugar-activity
mode change 100644 => 100755 bin/sugar-control-panel
mode change 100644 => 100755 bin/sugar-install-bundle
mode change 100644 => 100755 bin/sugar-launch
mode change 100644 => 100755 bin/sugar-ui-check
create mode 100644 sweets.recipe
diff --git a/.gitignore b/.gitignore
index 047a849..17363e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,9 @@ Makefile.in
.*.sw?
*.service
stamp-*
+*.tar.*
+.*
+share
# Absolute
diff --git a/Makefile.am b/Makefile.am
index 9e252af..cf526f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,11 @@ EXTRA_DIST = \
$(bin_SCRIPTS) \
intltool-merge.in \
intltool-update.in \
- intltool-extract.in
+ intltool-extract.in \
+ sweets.recipe
DISTCHECK_CONFIGURE_FLAGS = --disable-update-mimedb
+
+all:
+ mkdir -p share
+ test -e share/sugar || ln -s .. share/sugar
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 65aab9b..18f8d7e 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -13,4 +13,7 @@ bin_SCRIPTS = \
sugar \
$(python_scripts)
-EXTRA_DIST = $(python_scripts) sugar.in
+EXTRA_DIST = $(python_scripts) sugar
+
+sugar:
+ ln -fs sugar.in sugar
diff --git a/bin/sugar-activity b/bin/sugar-activity
old mode 100644
new mode 100755
diff --git a/bin/sugar-control-panel b/bin/sugar-control-panel
old mode 100644
new mode 100755
diff --git a/bin/sugar-install-bundle b/bin/sugar-install-bundle
old mode 100644
new mode 100755
diff --git a/bin/sugar-launch b/bin/sugar-launch
old mode 100644
new mode 100755
diff --git a/bin/sugar-session b/bin/sugar-session
index ee0048d..d0ca47e 100755
--- a/bin/sugar-session
+++ b/bin/sugar-session
@@ -229,7 +229,6 @@ def main():
# strings in the module scope.
from jarabe import config
gettext.bindtextdomain('sugar', config.locale_path)
- gettext.bindtextdomain('sugar-toolkit', config.locale_path)
gettext.textdomain('sugar')
from jarabe.desktop import homewindow
diff --git a/bin/sugar-ui-check b/bin/sugar-ui-check
old mode 100644
new mode 100755
diff --git a/bin/sugar.in b/bin/sugar.in
index a39309c..9ddf609 100755
--- a/bin/sugar.in
+++ b/bin/sugar.in
@@ -42,7 +42,12 @@ if test -z "$SUGAR_PROFILE"; then
fi
if test -z "$SUGAR_SCALING"; then
- export SUGAR_SCALING=100
+ dpi=$(xdpyinfo | grep resolution: | grep -o '[0-9]\+' | head -n1)
+ if [ $dpi -ge 200 ]; then
+ export SUGAR_SCALING=100
+ else
+ export SUGAR_SCALING=72
+ fi
fi
if gconftool-2 --dir-exists=/desktop/sugar/interface ; then
@@ -56,7 +61,19 @@ else
GTK2_THEME="sugar-$SUGAR_SCALING"
fi
-export GTK2_RC_FILES="@prefix@/share/sugar/data/$GTK2_THEME.gtkrc"
+if test "$SUGAR_SHELL_PREFIX"; then
+ include='xml:readonly:$(HOME)/.sugar/gconf'
+ grep "$include" ~/.gconf.path >/dev/null 2>&1 || \
+ echo "$include" >> ~/.gconf.path
+ mkdir -p ~/.sugar
+ rm -rf ~/.sugar/gconf
+ ln -s $SUGAR_SHELL_PREFIX/gconf ~/.sugar/
+ gconftool-2 --shutdown
+
+ export GTK2_RC_FILES="$SUGAR_SHELL_PREFIX/share/sugar/data/$GTK2_THEME.gtkrc"
+else
+ export GTK2_RC_FILES="$(dirname $0)/../share/sugar/data/$GTK2_THEME.gtkrc"
+fi
# Needed for executing wpa_passphrase
export PATH="$PATH":/sbin:/usr/sbin
@@ -128,4 +145,5 @@ if [ -z "$MOZILLA_FIVE_HOME" ]; then
done
fi
-exec sugar-session
+# Launch new DBus session to take into account new DBus services came from sweets
+exec dbus-launch --exit-with-session sugar-session "$@"
diff --git a/configure.ac b/configure.ac
index 86f6116..2290b14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,6 @@ AM_GCONF_SOURCE_2
AC_CONFIG_FILES([
bin/Makefile
-bin/sugar
data/icons/Makefile
data/Makefile
data/sugar-emulator.desktop
diff --git a/src/jarabe/config.py.in b/src/jarabe/config.py.in
index d22ee9a..3bfeec8 100644
--- a/src/jarabe/config.py.in
+++ b/src/jarabe/config.py.in
@@ -14,13 +14,14 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+import os
# pylint: disable=C0301
-prefix = '@prefix@'
-data_path = '@prefix@/share/sugar/data'
-shell_path = '@prefix@/share/sugar/shell'
-locale_path = '@prefix@/share/locale'
-ext_path = '@prefix@/share/sugar/extensions'
-activities_path = "@prefix@/share/sugar/activities"
+prefix = os.environ.get('SUGAR_SHELL_PREFIX', '@prefix@')
+data_path = prefix + '/share/sugar/data'
+shell_path = prefix + '/share/sugar/shell'
+locale_path = prefix + '/share/locale'
+ext_path = os.environ.get('SUGAR_EXT_PATH', prefix + '/share/sugar/extensions')
+activities_path = [prefix + "/share/sugar/activities", '/opt/sweets']
version = '@SUCROSE_VERSION@'
diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
index 26e719f..888f013 100644
--- a/src/jarabe/model/bundleregistry.py
+++ b/src/jarabe/model/bundleregistry.py
@@ -17,6 +17,7 @@
import os
import logging
+from os.path import exists, join
import gconf
import gobject
@@ -61,7 +62,7 @@ class BundleRegistry(gobject.GObject):
self._gio_monitors = []
user_path = env.get_user_activities_path()
- for activity_dir in [user_path, config.activities_path]:
+ for activity_dir in [user_path] + config.activities_path:
self._scan_directory(activity_dir)
directory = gio.File(activity_dir)
monitor = directory.monitor_directory()
@@ -88,7 +89,7 @@ class BundleRegistry(gobject.GObject):
def __file_monitor_changed_cb(self, monitor, one_file, other_file,
event_type):
- if not one_file.get_path().endswith('.activity'):
+ if not exists(join(one_file.get_path(), 'activity', 'activity.info')):
return
if event_type == gio.FILE_MONITOR_EVENT_CREATED:
self.add_bundle(one_file.get_path(), install_mime_type=True)
@@ -193,7 +194,7 @@ class BundleRegistry(gobject.GObject):
# Sort by mtime to ensure a stable activity order
bundles = {}
for f in os.listdir(path):
- if not f.endswith('.activity'):
+ if not exists(join(path, f, 'activity', 'activity.info')):
continue
try:
bundle_dir = os.path.join(path, f)
diff --git a/sweets.recipe b/sweets.recipe
new file mode 100644
index 0000000..107c2d1
--- /dev/null
+++ b/sweets.recipe
@@ -0,0 +1,72 @@
+[DEFAULT]
+depends = base/pygtk; base/gtk; base/gconf
+# Fructose dependencies until sweets support in the Shell
+fructose = sdk/hulahop; sdk/etoys; sdk/csound-python; base/pygame
+ base/gst-python; base/gst-plugins-good; base/evince
+ base/evince-python; base/simplejson; base/vte-python; sdk/pyabiword
+ base/gst-plugins-base; base/python-xlib; base/lxml
+ base/beautifulsoup; base/pywebkitgtk; sdk/elements
+# Etoys still requires PS
+ dextrose/sugar-presence-service
+
+[Application]
+implement = dextrose/%(name)s
+name = sugar
+summary = Core UI components
+license = LGPLv2+
+homepage = http://git.sugarlabs.org/projects/sugar
+
+major = 0.94
+version = %(major)s.1
+stability = testing
+
+requires = %(depends)s; dextrose/sugar-artwork = %(major)s
+ dextrose/sugar-toolkit = %(major)s; dextrose/sugar-datastore = %(major)s
+ sdk/python-xklavier; base/pygtksourceview; base/simplejson
+ base/metacity >= 2.27; base/xdpyinfo; base/xsetroot
+ base/dbus; base/dbus-x11; base/gvfs; base/openssh-client
+ base/libwnck-python; base/iso-codes; sdk/telepathy-python
+ sdk/telepathy-salut >= 0.4; sdk/telepathy-gabble >= 0.10
+ sdk/telepathy-mission-control >= 5.6
+binding = PATH %(BUILDDIR)s/bin
+ PYTHONPATH %(BUILDDIR)s/src
+ replace SUGAR_EXT_PATH %(BUILDDIR)s/share/sugar/extensions
+ replace SUGAR_SHELL_PREFIX
+ XDG_DATA_DIRS share
+
+[Application:run]
+requires = %(fructose)s
+exec = %(BUILDDIR)s/bin/sugar
+
+[Application:emulator]
+requires = %(fructose)s; base/xephyr
+exec = %(BUILDDIR)s/bin/sugar-emulator
+
+# Temporary command until sweets support in the Shell
+# and, thus, removing fructose deps from the rest of commands
+[Application:shell]
+requires = base/xephyr
+exec = %(BUILDDIR)s/bin/sugar-emulator
+
+[Archive]
+arch = any
+
+[Build]
+requires = %(depends)s; base/gnome-common; base/pkg-config
+ base/intltool >= 0.33; base/libtool; base/make; base/gcc-c
+clean = make distclean; ./autogen.sh --version
+configure = ./configure
+ --prefix=%(PREFIX)s
+ am_cv_python_pythondir=%(PREFIX)s/src
+ am_cv_python_pyexecdir=%(PREFIX)s/src
+ CFLAGS="%(CFLAGS)s"
+make = make
+install = make DESTDIR=%(DESTDIR)s install &&
+ GCONF_CONFIG_SOURCE=xml:merged:gconf
+ gconftool-2 --makefile-install-rule data/sugar.schemas >/dev/null &&
+ chmod a+rx gconf && chmod a+r gconf/* &&
+ mv gconf %(DESTDIR)s/%(PREFIX)s/ &&
+ update-mime-database %(DESTDIR)s/%(PREFIX)s/share/mime
+
+[Source]
+exec = autoreconf && make dist-gzip
--
1.7.6.1
More information about the Dextrose
mailing list