1 //<script type="text/javascript">
4 /** NOT CURRENTLY BEING WORKED ON !!! */
10 Roo = imports['Roo.js'].Roo;
11 File = imports['File.js'].File;
12 console = imports['console.js'].console;
15 imports['Date.js'].load(Date);
18 // these should come from args
19 var SRC='/disk2/checkout/gnome2/';
21 // perhaps we can just do a simple make for building the girs - no make install etc.?
22 var UPDATE_SOURCES = false;
26 var LOGFILE = "jhbuild-" + (new Date()).format("Y-m-d-H") + '.log';
29 // change src & deleteGirs when you add / remove girs..
33 screen -d -m seed jhbuild.js
37 continue - do not trash gir's...
38 use this to diff changes when we fix gobject introspection..
39 git diff on directories..
41 run the doc tool as well.
46 --- git diff (current to /SRC/package-DATE.diff)
47 --- see if we have a patch list
48 --- if so: git reset --hard
61 to fix: - see the list of modules commented out.
68 'atk/atk/Atk-1.0.gir',
69 'clutter/clutter/json/ClutterJson-1.0.gir',
70 'clutter/clutter/cogl/Cogl-1.0.gir',
71 'clutter/clutter/Clutter-1.0.gir',
72 'clutter/clutter/Cogl-1.0.gir',
73 'clutter/clutter/ClutterJson-1.0.gir',
74 'epiphany/src/Epiphany-2.29.gir',
75 'libgda/libgda/Gda-4.0.gir',
76 'libgda/libgda-ui/Gdaui-4.0.gir',
77 'libgsf/gsf/Gsf-1.gir',
78 'gobject-introspection/gir/libxml2-2.0.gir', // needed!
79 'gobject-introspection/gir/Gio-2.0.gir',
80 'gobject-introspection/gir/GModule-2.0.gir',
81 'gobject-introspection/gir/GLib-2.0.gir',
82 'gobject-introspection/gir/GIRepository-2.0.gir',
83 'gobject-introspection/gir/GObject-2.0.gir',
85 'gtk+/gdk-pixbuf/GdkPixbuf-2.0.gir',
86 'gtk+/gtk/Gtk-2.0.gir',
87 'gtk+/gdk/Gdk-2.0.gir',
88 'clutter-gtk/clutter-gtk/GtkClutter-0.10.gir',
89 'gconf/GConf-2.0.gir',
90 'gtksourceview/gtksourceview/GtkSource-2.0.gir',
91 'gstreamer/gst/Gst-0.10.gir',
92 'gstreamer/libs/gst/check/GstCheck-0.10.gir',
93 'gstreamer/libs/gst/net/GstNet-0.10.gir',
94 'gstreamer/libs/gst/controller/GstController-0.10.gir',
95 'gstreamer/libs/gst/base/GstBase-0.10.gir',
96 'gst-plugins-base/gst-libs/gst/video/GstVideo-0.10.gir',
97 'gst-plugins-base/gst-libs/gst/tag/GstTag-0.10.gir',
98 'gst-plugins-base/gst-libs/gst/interfaces/GstInterfaces-0.10.gir',
99 'gst-plugins-base/gst-libs/gst/pbutils/GstPbutils-0.10.gir',
100 'gst-plugins-base/gst-libs/gst/netbuffer/GstNetbuffer-0.10.gir',
101 'gst-plugins-base/gst-libs/gst/riff/GstRiff-0.10.gir',
102 'gst-plugins-base/gst-libs/gst/audio/GstAudio-0.10.gir',
103 'gst-plugins-base/gst-libs/gst/fft/GstFft-0.10.gir',
104 'gst-plugins-base/gst-libs/gst/rtsp/GstRtsp-0.10.gir',
105 'gst-plugins-base/gst-libs/gst/app/GstApp-0.10.gir',
106 'gst-plugins-base/gst-libs/gst/sdp/GstSdp-0.10.gir',
107 'gst-plugins-base/gst-libs/gst/rtp/GstRtp-0.10.gir',
109 'gssdp/libgssdp/GSSDP-1.0.gir',
110 'gdome2/libgdome/Gdome-2.0.gir',
111 'gnome-menus/libmenu/GMenu-2.0.gir',
115 'pango/pango/PangoFT2-1.0.gir',
116 'pango/pango/PangoCairo-1.0.gir',
117 'pango/pango/PangoXft-1.0.gir',
118 'pango/pango/Pango-1.0.gir',
119 'PolicyKit/src/polkit/Polkit-1.0.gir',
120 'unique/unique/Unique-1.0.gir',
123 'WebKit/WebKit-1.0.gir',
124 //'WebKit/WebKit/gtk/JSCore-1.0.gir', -- not a generated file!
131 // package : directory
133 'clutter': 'clutter',
134 'clutter-gtk' :'clutter-gtk',
135 'eggdbus' : 'eggdbus',
137 'epiphany' : 'epiphany',
139 'gobject-introspection' : 'gobject-introspection',
141 'gstreamer' : 'gstreamer',
142 'gst-plugins-base' : 'gst-plugins-base',
143 'gtksourceview' : 'gtksourceview',
144 'gnome-menus' : 'gnome-menus',
148 'libunique' :'unique',
149 'libsoup' : 'libsoup',
151 'polkit' : 'PolicyKit',
155 //'gupnp', -- needs patch
156 // 'gnome-keyring' -- ndeds patch
157 // gnome-vfs -- needs patch
158 // 'goocanvas' -- needs patch
159 //'libnotify' -- needs patch
164 // we dont use these at present..
167 'http://bugzilla-attachments.gnome.org/attachment.cgi?id=156459',
168 'http://bugzilla-attachments.gnome.org/attachment.cgi?id=156457',
171 // not valid - against release..
172 //'http://bugzilla-attachments.gnome.org/attachment.cgi?id=145422'
175 'http://bugzilla-attachments.gnome.org/attachment.cgi?id=153062',
178 'http://www.akbkhome.com/svn/seed/gir/avahi.diff',
184 * spawn process, and print/monitor output.
187 * - global log.. -> our global log just indicates what was done and what was the result?
188 * - build log for a specific package?
191 * @arg string cwd working directory.
198 function write(fn, str) {
206 console.log(str.replace(/\n/,''));
208 if (typeof(streams[fn])=='undefined') {
210 var f = Gio.file_new_for_path(String(fn));
211 streams[fn] = new Gio.DataOutputStream({
212 base_stream: f.replace(null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null)
215 streams[fn].put_string(str, null);
218 if (!fn || typeof(streams[fn])=='undefined') {
221 streams[fn].close(null);
226 function spawnlog (cwd, s, outfile, errfile) {
228 var retval = { output: '' , error : '', cmd : s.join(' ') , done : false};
229 console.log(retval.cmd);
230 GLib.spawn_async_with_pipes(cwd, s, null,
231 GLib.SpawnFlags.DO_NOT_REAP_CHILD + GLib.SpawnFlags.SEARCH_PATH ,
234 var ctx = GLib.main_loop_new (null, false);
237 GLib.child_watch_add(GLib.PRIORITY_DEFAULT, ret.child_pid, function(pid, status) {
238 console.log("GOT STATUS:" + status);
239 retval.status = status;
242 console.log("Ending LOOP");
243 GLib.main_loop_quit(ctx);
249 var in_ch = GLib.io_channel_unix_new(ret.standard_input);
250 var out_ch = GLib.io_channel_unix_new(ret.standard_output);
251 var err_ch = GLib.io_channel_unix_new(ret.standard_error);
253 function readstr(ch, fn, prop) {
257 var x = new GLib.String();
260 var cstatus = GLib.io_channel_get_buffer_condition(ch);
261 cstatus = GLib.io_channel_get_flags (ch)
264 //Seed.print("WAITING INPUT?" + prop+':'+cstatus);
265 //var status = GLib.io_channel_read_line_string (ch, x, null);
268 var status = GLib.io_channel_read_line_string (ch, x);
270 //Seed.print(prop + ":INPUT:" + status);
273 case GLib.IOStatus.NORMAL:
275 retval[prop] += x.str;
277 case GLib.IOStatus.AGAIN:
279 case GLib.IOStatus.ERROR:
280 case GLib.IOStatus.EOF:
290 GLib.io_add_watch(in_ch, GLib.PRIORITY_DEFAULT,
291 GLib.IOCondition.OUT + GLib.IOCondition.IN + GLib.IOCondition.PRI, function()
293 //Seed.print("GOT INOUT ON IN");
294 readstr(out_ch, outfile, 'output');
297 GLib.io_add_watch(err_ch, GLib.PRIORITY_DEFAULT,
298 GLib.IOCondition.ERR + GLib.IOCondition.IN + GLib.IOCondition.PRI + GLib.IOCondition.OUT,
301 // Seed.print("GOT INOUT ON ERR");
302 readstr(er_ch, errfile, 'error');
305 // let's just write some data...
306 //var x = new GLib.String();
307 //var status = GLib.io_channel_write (out_ch, "\n", 1);
309 //while (!retval.done) {
317 console.log("STARTING LOOP");
318 GLib.main_loop_run(ctx, false); // wait fore exit?
320 readstr(out_ch, outfile, 'output');
321 readstr(err_ch, errfile, 'error');
329 //GLib.spawn_close_pid(ret.child_pid);
337 if (typeof(res) == 'string') {
338 if (!res.length) { // skip blan.
343 write(SRC + LOGFILE, '[' + (new Date()).format("Y-m-d H:i:s") + '] ' + res);
346 log("CMD:" + res.cmd +"\n");
347 log("RETURN:" + (res.status ? res.status : "OK")+"\n");
348 log(res.output ? "---OUT---\n" + res.output + "\n" : '');
349 log(res.error ? " ---ERROR---\n" + res.error + "\n" : '');
352 function logresult(res) {
353 log("CMD: " + res.cmd +"\n");
354 log((res.status ? "RETURN: " + res.status : 'BUILD OK') +"\n");
355 if (res.status != 0 ) {
356 log(res.error ? "---ERROR---\n" + res.error + "\n" : '');
362 gdome : [ 'git', 'clean', 'make' , 'install' ], // fixme..
370 deleteGirs.map( function(g) {
372 console.log("DELETE" + SRC + g);
389 cline.unshift('list');
390 cline.unshift('jhbuild');
391 var order = spawnlog('/tmp', cline).output.split("\n");
392 // push introspection first...!!!
396 for (var i=0; i < order.length; i++) {
397 if (!order[i].length || pkgs.indexOf(order[i]) < 0) {
398 //console.log("SKIP (not related to gir) " + order[i] );
399 log("SKIP (not related to gir) " + order[i] +"\n");
404 // just for our reference..
405 spawnlog('/tmp', ['jhbuild','info', order[i]]);
406 // add -a -c for a clean build..
408 if (!UPDATE_SOURCES) {
409 // quick rebuild - probably to check introspection change results.
410 log("MAKE INSTALL: " + order[i] + "\n");
412 SRC+all[order[i]], ['bash' , '-c' ,'make install 2>&1'],
413 SRC+all[order[i]]+'/jhbuild.log',
414 SRC+all[order[i]]+'/jhbuild.err'
422 // for git.. - do a diff before we start, and store it..
424 if (File.exists(SRC+all[order[i]]+'/.git')) {
426 var gitres = spawnlog( SRC + all[order[i]], [ 'git', 'diff' ]);
429 if (gitres.output.length) {
430 fn = SRC+all[order[i]]+'-' + (new Date()).format('Y-m-d-H') + '.diff';
431 log("DIFF STORED: "+ fn+"\n");
432 write(fn, gitres.output);
435 log("RESET GIT / PULL\n");
436 spawnlog( SRC + all[order[i]], [ 'git', 'reset', '--hard' ]);
437 spawnlog( SRC + all[order[i]], [ 'git', 'pull' ]);
439 log("RE-APPLING DIFF\n");
440 spawnlog( SRC + all[order[i]], [ 'patch', '-p1', '-i', fn ]);
442 // we should apply patches here..
451 log("BUILDING : " + order[i] + "\n");
453 '/tmp', ['jhbuild', '--no-interact', 'buildone',order[i]],
454 SRC+all[order[i]]+'/jhbuild.log',
455 SRC+all[order[i]]+'/jhbuild.err'
458 if (res.status == 256 && res.error.match(/The remote end hung up unexpectedly/)) {
459 // try again - git connection failed..
469 close(SRC + LOGFILE);
477 //polkit -> PolicyKit
480 //libxml2 -> last! and must manual..
483 // we can just trash the gir's..
484 // usefull for checking changes in introspection..
485 // then run make on the whole lot..
489 //libxml (must be after introspecton)
495 // full build - needs jhbuild really...
497 // -- will not build stuff that's not changed.. (we need to store checkout id's to make this work..)
498 // otherwise do a -a -c
502 // what this has to do.. (similar to jhbuild...?? why not use it???