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
|
#!/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))
os.chdir(build_scripts_dir)
cmd = ['svn', 'co', 'svn://svn.gnome.org/svn/jhbuild/trunk', 'jhbuild']
os.spawnvp(os.P_WAIT, 'svn', cmd)
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 = [
'libglade',
'libXrender',
'libxml2',
'shared-mime-info',
'fontconfig',
'gtk-doc',
'startup-notification',
'libXft'
]
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:
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))
jhbuild.config.addpath('SUGAR_PREFIX', config.prefix)
if command == 'run' and len(args) == 0:
jhbuild.commands.run(command, config, ['sugar-emulator'])
else:
jhbuild.commands.run(command, config, args)
|