1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#!/usr/bin/env python
import os
import sys
import dependency
from dependency import LibDependency
def update_jhbuild():
print 'Updating jhbuild...'
sys.path.append(os.path.join(base_dir))
import cvs
os.chdir(build_scripts_dir)
cvsroot = ':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
cvs.login(cvsroot, 'anonymous')
cvs.checkout(cvsroot, 'jhbuild')
os.chdir(exec_dir)
def configure():
config_file = os.path.join(build_scripts_dir, 'olpc.jhbuildrc')
return jhbuild.config.Config(config_file)
exec_dir = os.getcwd()
base_dir = os.path.abspath(os.path.dirname(__file__))
build_scripts_dir = os.path.join(base_dir, 'build-scripts')
if len(sys.argv) > 1:
command = sys.argv[1]
args = sys.argv[2:]
else:
command = 'build'
args = sys.argv[1:]
if command == 'build':
update_jhbuild()
# System dependencies
skip_modules = [
'startup-notification',
'libglade',
'gtk+',
'libXrender',
'fontconfig',
'glib',
'gtk-doc',
'libgnomeui',
'libgnomecanvas',
'pyorbit'
]
if LibDependency('libwnck', 'libwnck-1.0').check():
skip_modules.append('libwnck')
if LibDependency('mozilla', 'mozilla-gtkmozembed').check() or \
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
config = configure()
for module in skip_modules:
config.skip.append(module)
jhbuild.config.addpath('XDG_DATA_DIRS', '/usr/share')
path = 'lib/python2.4/site-packages'
jhbuild.config.addpath('PYTHONPATH', os.path.join(config.prefix, path))
path = 'lib/gtk-2.0/'
jhbuild.config.addpath('GTK_PATH', os.path.join(config.prefix, path))
path = 'etc/gtk-2.0/gtkrc'
jhbuild.config.addpath('GTK2_RC_FILES', os.path.join(config.prefix, path))
os.environ['SUGAR_EMULATOR'] = 'yes'
if command == 'run' and len(args) == 0:
jhbuild.commands.run(command, config, ['sugar'])
else:
jhbuild.commands.run(command, config, args)
|