gnome-python-desktop r512 - in trunk: . docs/gnomeprint docs/gnomeprintui docs/gtksourceview evolution gnomeapplet gnomedesktop gnomekeyring gnomeprint gtksourceview gtop mediaprofiles metacity nautilusburn rsvg totem wnck



Author: gjc
Date: Sat Jan  3 22:56:45 2009
New Revision: 512
URL: http://svn.gnome.org/viewvc/gnome-python-desktop?rev=512&view=rev

Log:
Port to modified version of WAF 1.5.x

Modified:
   trunk/   (props changed)
   trunk/README
   trunk/docs/gnomeprint/wscript
   trunk/docs/gnomeprintui/wscript
   trunk/docs/gtksourceview/wscript
   trunk/evolution/wscript
   trunk/gnomeapplet/wscript
   trunk/gnomedesktop/wscript
   trunk/gnomekeyring/wscript
   trunk/gnomeprint/wscript
   trunk/gtksourceview/wscript
   trunk/gtop/wscript
   trunk/mediaprofiles/wscript
   trunk/metacity/metacity.override
   trunk/metacity/wscript
   trunk/nautilusburn/wscript
   trunk/rsvg/wscript
   trunk/totem/wscript
   trunk/wnck/wscript
   trunk/wscript

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Sat Jan  3 22:56:45 2009
@@ -9,3 +9,9 @@
   - nautilusburn
   - mediaprofiles
   - metacity
+
+Note: this branch requires a special branch of WAF: https://code.launchpad.net/~gjc/waf/cmd
+This WAF version can be retrieved by this command:
+
+$ bzr co lp:~gjc/waf/cmd waf-cmd
+

Modified: trunk/docs/gnomeprint/wscript
==============================================================================
--- trunk/docs/gnomeprint/wscript	(original)
+++ trunk/docs/gnomeprint/wscript	Sat Jan  3 22:56:45 2009
@@ -1,43 +1,8 @@
 # -*- python -*-
-import os
-import Common
-import glob
+#import os
+#import Common
+#import glob
 
 def build(bld):
-    reference_doc_name = 'pygnomeprint'
+    bld.build_docs_for_module('gnomeprint')
 
-    d = bld.m_curdirnode.find_dir('html').abspath()
-    if bld.env()['XSLTPROC'] and not os.path.exists(os.path.join(d, 'index.html')):
-        doc_module = 'pygnomeprint'
-        html_dir = os.path.join(bld.env()['DATADIR'], 'gtk-doc', 'html')
-        target_dir = os.path.join('html_dir', reference_doc_name)
-
-        reference_main_file = 'gnomeprint-classes.xml'
-
-        cmd = bld.create_obj('command-output')
-        cmd.hidden_outputs = ['html/index.html']
-        cmd.command = bld.env()['XSLTPROC']
-        cmd.command_is_external = True
-        cmd.argv = ['--nonet', '--xinclude',
-                    '-o', cmd.output_dir('html', template='%s/'),
-                    '--stringparam', 'gtkdoc.bookname', reference_doc_name,
-                    '--stringparam', 'gtkdoc.version', bld.env()['VERSION'],
-                    '--stringparam', 'chunker.output.encoding', 'UTF-8',
-                    cmd.input_file('../ref-html-style.xsl'),
-                    cmd.input_file(reference_main_file),
-                    ]
-        cmd.prio = 100
-
-        cmd = bld.create_obj('command-output')
-        cmd.prio = 110
-        cmd.hidden_inputs = ['html/index.html']
-        cmd.hidden_outputs = ['html/gnomeprint-class-reference.html']
-        cmd.command = 'gtkdoc-fixxref'
-        cmd.command_is_external = True
-        cmd.argv = [cmd.input_dir('html', template='--module-dir=%s'),
-                    ('--html-dir=%s' % html_dir)]
-
-    html_files = glob.glob(os.path.join(bld.m_curdirnode.find_dir('html').abspath(bld.env()), '*'))
-    html_files += glob.glob(os.path.join(bld.m_curdirnode.find_dir('html').abspath(), '*'))
-    Common.install_files('DATADIR', os.path.join('gtk-doc', 'html', reference_doc_name),
-                         html_files)

Modified: trunk/docs/gnomeprintui/wscript
==============================================================================
--- trunk/docs/gnomeprintui/wscript	(original)
+++ trunk/docs/gnomeprintui/wscript	Sat Jan  3 22:56:45 2009
@@ -1,44 +1,5 @@
 # -*- python -*-
-import os
-import Common
-import glob
-
 
 def build(bld):
-    reference_doc_name = 'pygnomeprintui'
-
-    d = bld.m_curdirnode.find_dir('html').abspath()
-    if bld.env()['XSLTPROC'] and not os.path.exists(os.path.join(d, 'index.html')):
-        doc_module = 'pygnomeprintui'
-        html_dir = os.path.join(bld.env()['DATADIR'], 'gtk-doc', 'html')
-        target_dir = os.path.join('html_dir', reference_doc_name)
-
-        reference_main_file = 'gnomeprintui-classes.xml'
-
-        cmd = bld.create_obj('command-output')
-        cmd.hidden_outputs = ['html/index.html']
-        cmd.command = bld.env()['XSLTPROC']
-        cmd.command_is_external = True
-        cmd.argv = ['--nonet', '--xinclude',
-                    '-o', cmd.output_dir('html', template='%s/'),
-                    '--stringparam', 'gtkdoc.bookname', reference_doc_name,
-                    '--stringparam', 'gtkdoc.version', bld.env()['VERSION'],
-                    '--stringparam', 'chunker.output.encoding', 'UTF-8',
-                    cmd.input_file('../ref-html-style.xsl'),
-                    cmd.input_file(reference_main_file),
-                    ]
-        cmd.prio = 100
-
-        cmd = bld.create_obj('command-output')
-        cmd.prio = 110
-        cmd.hidden_inputs = ['html/index.html']
-        cmd.hidden_outputs = ['html/gnomeprintui-class-reference.html']
-        cmd.command = 'gtkdoc-fixxref'
-        cmd.command_is_external = True
-        cmd.argv = [cmd.input_dir('html', template='--module-dir=%s'),
-                    ('--html-dir=%s' % html_dir)]
+    bld.build_docs_for_module('gnomeprintui')
 
-    html_files = glob.glob(os.path.join(bld.m_curdirnode.find_dir('html').abspath(bld.env()), '*'))
-    html_files += glob.glob(os.path.join(bld.m_curdirnode.find_dir('html').abspath(), '*'))
-    Common.install_files('DATADIR', os.path.join('gtk-doc', 'html', reference_doc_name),
-                         html_files)

Modified: trunk/docs/gtksourceview/wscript
==============================================================================
--- trunk/docs/gtksourceview/wscript	(original)
+++ trunk/docs/gtksourceview/wscript	Sat Jan  3 22:56:45 2009
@@ -1,44 +1,4 @@
 # -*- python -*-
-import os
-import Common
-import glob
-
 
 def build(bld):
-    reference_doc_name = 'pygtksourceview'
-
-    d = bld.m_curdirnode.find_dir('html').abspath()
-    if bld.env()['XSLTPROC'] and not os.path.exists(os.path.join(d, 'index.html')):
-        doc_module = 'pygtksourceview'
-        html_dir = os.path.join(bld.env()['DATADIR'], 'gtk-doc', 'html')
-        target_dir = os.path.join('html_dir', reference_doc_name)
-
-        reference_main_file = 'gtksourceview-classes.xml'
-
-        cmd = bld.create_obj('command-output')
-        cmd.hidden_outputs = ['html/index.html']
-        cmd.command = bld.env()['XSLTPROC']
-        cmd.command_is_external = True
-        cmd.argv = ['--nonet', '--xinclude',
-                    '-o', cmd.output_dir('html', template='%s/'),
-                    '--stringparam', 'gtkdoc.bookname', reference_doc_name,
-                    '--stringparam', 'gtkdoc.version', bld.env()['VERSION'],
-                    '--stringparam', 'chunker.output.encoding', 'UTF-8',
-                    cmd.input_file('../ref-html-style.xsl'),
-                    cmd.input_file(reference_main_file),
-                    ]
-        cmd.prio = 100
-
-        cmd = bld.create_obj('command-output')
-        cmd.prio = 110
-        cmd.hidden_inputs = ['html/index.html']
-        cmd.hidden_outputs = ['html/gtksourceview-class-reference.html']
-        cmd.command = 'gtkdoc-fixxref'
-        cmd.command_is_external = True
-        cmd.argv = [cmd.input_dir('html', template='--module-dir=%s'),
-                    ('--html-dir=%s' % html_dir)]
-
-    html_files = glob.glob(os.path.join(bld.m_curdirnode.find_dir('html').abspath(bld.env()), '*'))
-    html_files += glob.glob(os.path.join(bld.m_curdirnode.find_dir('html').abspath(), '*'))
-    Common.install_files('DATADIR', os.path.join('gtk-doc', 'html', reference_doc_name),
-                         html_files)
+    bld.build_docs_for_module('gtksourceview')

Modified: trunk/evolution/wscript
==============================================================================
--- trunk/evolution/wscript	(original)
+++ trunk/evolution/wscript	Sat Jan  3 22:56:45 2009
@@ -1,53 +1,52 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
 
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'evolution.ebook')
     if 'evolution.ebook' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libebook-1.2 >= 1.4'
-                          ' pygobject-2.0 gdk-pixbuf-2.0 pango',
-                          destvar='EVOLUTION_EBOOK', mandatory=False):
+        if conf.pkg_check_modules('EVOLUTION_EBOOK',
+                                  'libebook-1.2 >= 1.4 pygobject-2.0 gdk-pixbuf-2.0 pango',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'evolution.ebook')
 
     conf.env.append_value('MODULES_AVAILABLE', 'evolution.ecal')
     if 'evolution.ecal' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libecal-1.2 >= 1.4'
-                          ' pygobject-2.0 gdk-pixbuf-2.0 pango',
-                          destvar='EVOLUTION_ECAL', mandatory=False):
+        if conf.pkg_check_modules('EVOLUTION_ECAL',
+                                  'libecal-1.2 >= 1.4 pygobject-2.0 gdk-pixbuf-2.0 pango',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'evolution.ecal')            
 
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        #'--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
+# def codegen(bld, module):
+#     cmd = bld.create_obj('command-output')
+#     cmd.command = bld.env()['CODEGEN']
+#     cmd.command_is_external = True
+#     cmd.prio = 5
+#     cmd.argv = [
+#         #'--py_ssize_t-clean',
+#         '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
+#         '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
+#         '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
+#         '--prefix', 'py'+module,
+#         '--override', cmd.input_file("%s.override" % module),
+#         cmd.input_file("%s.defs" % module),
+#         ]
+#     cmd.stdout = '%s.c' % module
+#     return cmd
 
 
 def build(bld):
-    evolution_common = bld.create_obj('cc', 'objects', 'pyext')
+    evolution_common = bld.new_task_gen('cc', 'objects', 'pyext')
     evolution_common.name = 'evolution_common'
+    evolution_common.target = 'evolution_common'
     evolution_common.source = 'override_common.c'
     evolution_common.includes = '.'
     evolution_common.uselib = 'PYGTK'
     evolution_common.env.append_value('CCFLAGS', evolution_common.env['shlib_CCFLAGS'])
     
-    if 'evolution.ebook' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'ebook')
+    if 'evolution.ebook' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('ebook', py_ssize_t_clean=False)
         pyext = bld.create_pyext()
         pyext.includes = '.'
         pyext.source = '''
@@ -61,11 +60,10 @@
         pyext.add_objects = 'evolution_common'
         pyext.target = 'ebook'
         pyext.uselib = 'EVOLUTION_EBOOK'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = os.path.join('gtk-2.0', 'evolution')
+        pyext.install_path_var = '${PYTHONDIR}/gtk-2.0/evolution'
 
-    if 'evolution.ecal' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'ecal')
+    if 'evolution.ecal' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('ecal', py_ssize_t_clean=False)
         pyext = bld.create_pyext()
         pyext.includes = '.'
         pyext.source = '''
@@ -77,13 +75,12 @@
         pyext.add_objects = 'evolution_common'
         pyext.target = 'ecal'
         pyext.uselib = 'EVOLUTION_ECAL'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = os.path.join('gtk-2.0', 'evolution')
+        pyext.install_path_var = '${PYTHONDIR}/gtk-2.0/evolution'
 
-    py = bld.create_obj('py')
-    py.inst_dir = os.path.join('gtk-2.0', 'evolution')
+    py = bld.new_task_gen('py')
+    py.install_path_var = '${PYTHONDIR}/gtk-2.0/evolution'
     py.source = "__init__.py"
 
-    defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                   ['ebook.defs', 'ecal.defs'])
+    bld.install_files('${DATADIR}/pygtk/2.0/defs',
+                      ['ebook.defs', 'ecal.defs'])
 

Modified: trunk/gnomeapplet/wscript
==============================================================================
--- trunk/gnomeapplet/wscript	(original)
+++ trunk/gnomeapplet/wscript	Sat Jan  3 22:56:45 2009
@@ -1,49 +1,24 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'gnomeapplet')
     if 'gnomeapplet' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libpanelapplet-2.0 >= 2.13.4 pygobject-2.0 libgnome-2.0 libgnomeui-2.0',
-                          destvar='GNOMEAPPLET', mandatory=False):
+        if conf.pkg_check_modules('GNOMEAPPLET',
+                                  'libpanelapplet-2.0 >= 2.13.4 pygobject-2.0 libgnome-2.0 libgnomeui-2.0',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gnomeapplet')
 
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--load-types', os.path.join(cmd.env['GNOME_PYTHON_ARG_TYPES_DIR'], 'bonobo-arg-types.py'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--register', os.path.join(cmd.env['GNOME_PYTHON_DEFSDIR'], 'bonobo-types.defs'),
-        '--register', os.path.join(cmd.env['GNOME_PYTHON_DEFSDIR'], 'bonoboui-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
-
 def build(bld):
-    
-    if 'gnomeapplet' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'applet')
+    env = bld.env
+    if 'gnomeapplet' in env['MODULES_TO_BUILD']:
+        bld.codegen('applet')
         pyext = bld.create_pyext()
         pyext.source = 'appletmodule.c applet.c'
         pyext.target = 'gnomeapplet'
         pyext.uselib = 'GNOMEAPPLET'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['applet.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'applet.defs')
 

Modified: trunk/gnomedesktop/wscript
==============================================================================
--- trunk/gnomedesktop/wscript	(original)
+++ trunk/gnomedesktop/wscript	Sat Jan  3 22:56:45 2009
@@ -1,49 +1,26 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'gnomedesktop')
     if 'gnomedesktop' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('gnome-desktop-2.0 >= 2.10.0 pygobject-2.0 ',
-                          destvar='GNOMEDESKTOP', mandatory=False):
+        if conf.pkg_check_modules('GNOMEDESKTOP', 'gnome-desktop-2.0 >= 2.10.0 pygobject-2.0',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gnomedesktop')
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    cmd.prio = 5
-    return cmd
-
-
 def build(bld):
     
-    if 'gnomedesktop' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, '_gnomedesktop')
+    if 'gnomedesktop' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('_gnomedesktop')
         pyext = bld.create_pyext()
         pyext.source = '_gnomedesktopmodule.c _gnomedesktop.c'
         pyext.target = '_gnomedesktop'
         pyext.uselib = 'GNOMEDESKTOP'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = os.path.join('gtk-2.0', 'gnomedesktop')
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0/gnomedesktop'
 
-        py = bld.create_obj('py')
-        py.inst_dir = os.path.join('gtk-2.0', 'gnomedesktop')
+        py = bld.new_task_gen('py')
+        py.install_path = '${PYTHONDIR}/gtk-2.0/gnomedesktop'
         py.source = "__init__.py"
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['_gnomedesktop.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', '_gnomedesktop.defs')
 

Modified: trunk/gnomekeyring/wscript
==============================================================================
--- trunk/gnomekeyring/wscript	(original)
+++ trunk/gnomekeyring/wscript	Sat Jan  3 22:56:45 2009
@@ -2,49 +2,29 @@
 # encoding: utf-8
 
 import os
-import Common
 
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'gnomekeyring')
     if 'gnomekeyring' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('gnome-keyring-1 >= 0.5.0 pygobject-2.0 ',
-                          destvar='GNOMEKEYRING', mandatory=False):
+        if conf.pkg_check_modules('GNOMEKEYRING', 'gnome-keyring-1 >= 0.5.0 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gnomekeyring')
-            if conf.check_pkg('gnome-keyring-1 >= 2.20.1', destvar='GNOMEKEYRING_2_20_1', mandatory=False):
+            if conf.pkg_check_modules('GNOMEKEYRING_2_20_1', 'gnome-keyring-1 >= 2.20.1', mandatory=False):
                 conf.define('HAVE_KEYRING_2_20_1', 1)
             else:
                 conf.undefine('HAVE_KEYRING_2_20_1')
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--load-types', cmd.input_file('gnomekeyring-argtypes.py'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
 
 def build(bld):
-    
-    if 'gnomekeyring' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'gnomekeyring')
+    env = bld.env
+    if 'gnomekeyring' in env['MODULES_TO_BUILD']:
+        bld.codegen('gnomekeyring', local_load_types=['gnomekeyring-argtypes.py'])
+
         pyext = bld.create_pyext()
         pyext.source = 'gnomekeyringmodule.c gnomekeyring.c'
         pyext.target = 'gnomekeyring'
         pyext.uselib = 'GNOMEKEYRING'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_subdir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['gnomekeyring.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', ['gnomekeyring.defs'])
 

Modified: trunk/gnomeprint/wscript
==============================================================================
--- trunk/gnomeprint/wscript	(original)
+++ trunk/gnomeprint/wscript	Sat Jan  3 22:56:45 2009
@@ -1,67 +1,45 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'gnomeprint')
     if 'gnomeprint' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libgnomeprint-2.2 >= 2.2.0 pygobject-2.0 ',
-                          destvar='GNOMEPRINT', mandatory=False):
+        if conf.pkg_check_modules('GNOMEPRINT',
+                                  'libgnomeprint-2.2 >= 2.2.0 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gnomeprint')
 
     conf.env.append_value('MODULES_AVAILABLE', 'gnomeprint.ui')
     if 'gnomeprint.ui' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libgnomeprintui-2.2 >= 2.2.0 pygobject-2.0 ',
-                          destvar='GNOMEPRINTUI', mandatory=False):
+        if conf.pkg_check_modules('GNOMEPRINTUI',
+                                  'libgnomeprintui-2.2 >= 2.2.0 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gnomeprint.ui')
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--load-types', cmd.input_file('print-arg-types.py'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
-
 def build(bld):
     
-    if 'gnomeprint' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'print')
+    if 'gnomeprint' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('print', local_load_types=['print-arg-types.py'])
         pyext = bld.create_pyext()
         pyext.source = 'printmodule.c print.c art-gtype.c'
         pyext.target = '_print'
         pyext.uselib = 'GNOMEPRINT'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = os.path.join('gtk-2.0', 'gnomeprint')
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0/gnomeprint'
         pyext.includes = '.'
 
-    if 'gnomeprint.ui' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'printui')
+    if 'gnomeprint.ui' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('printui', local_load_types=['print-arg-types.py'])
         pyext = bld.create_pyext()
         pyext.source = 'printuimodule.c printui.c'
         pyext.target = 'ui'
         pyext.uselib = 'GNOMEPRINTUI'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = os.path.join('gtk-2.0', 'gnomeprint')
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0/gnomeprint'
         pyext.includes = '.'
 
-    py = bld.create_obj('py')
-    py.inst_dir = os.path.join('gtk-2.0', 'gnomeprint')
+    py = bld.new_task_gen('py')
+    py.install_path = '${PYTHONDIR}/gtk-2.0/gnomeprint'
     py.source = "__init__.py"
 
-    defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                   ['print.defs', 'printui.defs'])
+    bld.install_files('${DATADIR}//pygtk/2.0/defs',
+                      ['print.defs', 'printui.defs'])
 

Modified: trunk/gtksourceview/wscript
==============================================================================
--- trunk/gtksourceview/wscript	(original)
+++ trunk/gtksourceview/wscript	Sat Jan  3 22:56:45 2009
@@ -1,47 +1,23 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'gtksourceview')
     if 'gtksourceview' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('gtksourceview-1.0 >= 1.1.90 pygobject-2.0 ',
-                         destvar='GTKSOURCEVIEW', mandatory=False):
+        if conf.pkg_check_modules('GTKSOURCEVIEW', 'gtksourceview-1.0 >= 1.1.90 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gtksourceview')
         
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--register', cmd.input_file('../gnomeprint/print.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
-
 def build(bld):
     
-    if 'gtksourceview' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'gtksourceview')
+    if 'gtksourceview' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('gtksourceview', local_register=['../gnomeprint/print.defs'])
         pyext = bld.create_pyext()
         pyext.source = 'gtksourceviewmodule.c gtksourceview.c'
         pyext.target = 'gtksourceview'
         pyext.uselib = 'GTKSOURCEVIEW'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['gtksourceview.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'gtksourceview.defs')
 

Modified: trunk/gtop/wscript
==============================================================================
--- trunk/gtop/wscript	(original)
+++ trunk/gtop/wscript	Sat Jan  3 22:56:45 2009
@@ -5,18 +5,17 @@
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'gtop')
     if 'gtop' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libgtop-2.0 >= 2.13.0 pygobject-2.0 ',
-                          destvar='GTOP', mandatory=False):
+        if conf.pkg_check_modules('GTOP', 'libgtop-2.0 >= 2.13.0 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'gtop')
 
 
 def build(bld):
     
-    if 'gtop' in bld.env()['MODULES_TO_BUILD']:
+    if 'gtop' in bld.env['MODULES_TO_BUILD']:
         pyext = bld.create_pyext()
         pyext.source = 'gtop.c'
         pyext.target = 'gtop'
         pyext.uselib = 'GTOP'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 

Modified: trunk/mediaprofiles/wscript
==============================================================================
--- trunk/mediaprofiles/wscript	(original)
+++ trunk/mediaprofiles/wscript	Sat Jan  3 22:56:45 2009
@@ -1,46 +1,25 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
 
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'mediaprofiles')
     if 'mediaprofiles' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('gnome-media-profiles >= 2.10.0 pygobject-2.0 ',
-                          destvar='MEDIAPROFILES', mandatory=False):
+        if conf.pkg_check_modules('MEDIAPROFILES',
+                                  'gnome-media-profiles >= 2.10.0 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'mediaprofiles')
 
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
-
 def build(bld):
     
-    if 'mediaprofiles' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'mediaprofiles')
+    if 'mediaprofiles' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('mediaprofiles')
         pyext = bld.create_pyext()
         pyext.source = 'mediaprofilesmodule.c mediaprofiles.c'
         pyext.target = 'mediaprofiles'
         pyext.uselib = 'MEDIAPROFILES'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['mediaprofiles.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', ['mediaprofiles.defs'])
 

Modified: trunk/metacity/metacity.override
==============================================================================
--- trunk/metacity/metacity.override	(original)
+++ trunk/metacity/metacity.override	Sat Jan  3 22:56:45 2009
@@ -30,6 +30,7 @@
 import gtk.gdk.Pixbuf as PyGdkPixbuf_Type
 import gtk.Widget as PyGtkWidget_Type
 import gtk.Bin as PyGtkBin_Type
+import pango.Context as PyPangoContext_Type
 %%
 ignore-glob
  _*u

Modified: trunk/metacity/wscript
==============================================================================
--- trunk/metacity/wscript	(original)
+++ trunk/metacity/wscript	Sat Jan  3 22:56:45 2009
@@ -2,8 +2,7 @@
 # encoding: utf-8
 
 import os
-import Common
-import Params
+import Options
 
 def set_options(opt):
     opt.add_option('--enable-metacity',
@@ -15,40 +14,20 @@
     
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'metacity')
-    if 'metacity' in conf.env['ENABLE_MODULES'] or Params.g_options.enable_metacity:
-        if conf.check_pkg('libmetacity-private >= 2.19.8 pygobject-2.0 ',
-                          destvar='METACITY', mandatory=False):
+    if 'metacity' in conf.env['ENABLE_MODULES'] or Options.options.enable_metacity:
+        if conf.pkg_check_modules('METACITY', 'libmetacity-private >= 2.19.8 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'metacity')
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
-
 def build(bld):
-    
-    if 'metacity' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'metacity')
+    env = bld.env
+    if 'metacity' in env['MODULES_TO_BUILD']:
+        bld.codegen('metacity')
         pyext = bld.create_pyext()
         pyext.source = 'metacitymodule.c metacity.c'
         pyext.target = 'metacity'
         pyext.uselib = 'METACITY'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['metacity.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', ['metacity.defs'])
 

Modified: trunk/nautilusburn/wscript
==============================================================================
--- trunk/nautilusburn/wscript	(original)
+++ trunk/nautilusburn/wscript	Sat Jan  3 22:56:45 2009
@@ -1,47 +1,24 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'nautilusburn')
     if 'nautilusburn' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libnautilus-burn >= 2.15.3 pygobject-2.0 ',
-                          destvar='NAUTILUSBURN', mandatory=False):
+        if conf.pkg_check_modules('NAUTILUSBURN',
+                                  'libnautilus-burn >= 2.15.3 pygobject-2.0',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'nautilusburn')
 
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
-
 def build(bld):
-    
-    if 'nautilusburn' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'nautilus_burn')
+    if 'nautilusburn' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('nautilus_burn', prefix='nautilus_burn')
         pyext = bld.create_pyext()
         pyext.source = 'nb_module.c nautilus_burn.c nb_track.c'
         pyext.includes = '.'
         pyext.target = 'nautilusburn'
         pyext.uselib = 'NAUTILUSBURN'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['nautilus_burn.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'nautilus_burn.defs')
 

Modified: trunk/rsvg/wscript
==============================================================================
--- trunk/rsvg/wscript	(original)
+++ trunk/rsvg/wscript	Sat Jan  3 22:56:45 2009
@@ -1,45 +1,24 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
 
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'rsvg')
     if 'rsvg' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('librsvg-2.0 >= 2.14 pycairo pygobject-2.0 ',
-                          destvar='RSVG', mandatory=False):
+        if conf.pkg_check_modules('RSVG',
+                                  'librsvg-2.0 >= 2.14 pycairo pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'rsvg')
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
 
 def build(bld):
-    
-    if 'rsvg' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'rsvg')
+    if 'rsvg' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('rsvg')
         pyext = bld.create_pyext()
         pyext.source = 'rsvgmodule.c rsvg.c'
         pyext.target = 'rsvg'
         pyext.uselib = 'RSVG'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['rsvg.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'rsvg.defs')
 

Modified: trunk/totem/wscript
==============================================================================
--- trunk/totem/wscript	(original)
+++ trunk/totem/wscript	Sat Jan  3 22:56:45 2009
@@ -1,49 +1,28 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'totem.plparser')
     if 'totem.plparser' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('totem-plparser >= 1.4 pygobject-2.0 ',
-                          destvar='PLPARSER', mandatory=False):
+        if conf.pkg_check_modules('PLPARSER',
+                                  'totem-plparser >= 1.4 pygobject-2.0 ',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'totem.plparser')
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
 
 def build(bld):
 
-    if 'totem.plparser' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'plparser')
+    if 'totem.plparser' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('plparser')
         pyext = bld.create_pyext()
         pyext.source = 'plparsermodule.c plparser.c'
         pyext.target = 'plparser'
         pyext.uselib = 'PLPARSER'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = os.path.join('gtk-2.0', 'totem')
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0/totem'
 
-        py = bld.create_obj('py')
-        py.inst_dir = os.path.join('gtk-2.0', 'totem')
+        py = bld.new_task_gen('py')
+        py.install_path = '${PYTHONDIR}/gtk-2.0/totem'
         py.source = "__init__.py"
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['plparser.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'plparser.defs')
 

Modified: trunk/wnck/wscript
==============================================================================
--- trunk/wnck/wscript	(original)
+++ trunk/wnck/wscript	Sat Jan  3 22:56:45 2009
@@ -1,47 +1,26 @@
 # -*- python -*-
 # encoding: utf-8
 
-import os
-import Common
-
 def configure(conf):
     conf.env.append_value('MODULES_AVAILABLE', 'wnck')
     if 'wnck' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
-        if conf.check_pkg('libwnck-1.0 >= 2.20 pygobject-2.0',
-                          destvar='WNCK', mandatory=False):
+        if conf.pkg_check_modules('WNCK',
+                                  'libwnck-1.0 >= 2.20 pygobject-2.0',
+                                  mandatory=False):
             conf.env.append_value('MODULES_TO_BUILD', 'wnck')
 
 
-def codegen(bld, module):
-    cmd = bld.create_obj('command-output')
-    cmd.command = bld.env()['CODEGEN']
-    cmd.command_is_external = True
-    cmd.prio = 5
-    cmd.argv = [
-        '--py_ssize_t-clean',
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
-        '--register', os.path.join(cmd.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
-        '--prefix', 'py'+module,
-        '--override', cmd.input_file("%s.override" % module),
-        cmd.input_file("%s.defs" % module),
-        ]
-    cmd.stdout = '%s.c' % module
-    return cmd
-
 
 def build(bld):
     
-    if 'wnck' in bld.env()['MODULES_TO_BUILD']:
-        codegen(bld, 'wnck')
+    if 'wnck' in bld.env['MODULES_TO_BUILD']:
+        bld.codegen('wnck')
         pyext = bld.create_pyext()
         pyext.env.append_value('CCDEFINES', 'WNCK_I_KNOW_THIS_IS_UNSTABLE')
         pyext.source = 'wnckmodule.c wnck.c'
         pyext.target = 'wnck'
         pyext.uselib = 'WNCK'
-        pyext.inst_var = 'PYTHONDIR'
-        pyext.inst_dir = 'gtk-2.0'
+        pyext.install_path = '${PYTHONDIR}/gtk-2.0'
 
-        defsdir = Common.install_files('DATADIR', os.path.join('pygtk', '2.0', 'defs'),
-                                       ['wnck.defs'])
+        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'wnck.defs')
 

Modified: trunk/wscript
==============================================================================
--- trunk/wscript	(original)
+++ trunk/wscript	Sat Jan  3 22:56:45 2009
@@ -1,13 +1,15 @@
 # -*- python -*-
 
-import Params
-Params.g_autoconfig = True
-
 VERSION = '2.24.1'
 APPNAME = 'gnome-python-desktop'
 srcdir = '.'
 blddir = 'build'
 
+import Options
+Options.autoconfig = True
+import Logs
+import Build
+
 import misc
 import os
 import shutil
@@ -40,6 +42,8 @@
     conf.check_tool('compiler_cc')
     conf.check_tool('gnome')
     conf.check_tool('python')
+    conf.check_tool('command')
+    conf.check_tool('pkgconfig')
     conf.check_python_version((2,4))
     conf.check_python_headers()
     conf.find_program('xsltproc', var='XSLTPROC')
@@ -56,25 +60,22 @@
     conf.define('PYGTK_REQUIRED_MINOR_VERSION', pygtk_version[1])
     conf.define('PYGTK_REQUIRED_MICRO_VERSION', pygtk_version[2])
 
-    values = conf.check_pkg('pygtk-2.0', destvar='PYGTK',
-                            vnum='.'.join([str(x) for x in pygtk_version]),
-                            pkgvars=['defsdir'], mandatory=True)
-    conf.env['PYGTK_DEFSDIR'] = values['PYGTK_DEFSDIR']
+    conf.pkg_check_modules('PYGTK', 'pygtk-2.0 >= %s' % ('.'.join([str(x) for x in pygtk_version]),))
+    conf.env['PYGTK_DEFSDIR'] = conf.pkg_check_module_variable('pygtk-2.0', 'defsdir')
 
     gnome_python_version = [2, 10, 0]
-    values = conf.check_pkg('gnome-python-2.0', destvar='GNOME_PYTHON',
-                            vnum='.'.join([str(x) for x in gnome_python_version]),
-                            pkgvars=['defsdir', 'argtypesdir'], mandatory=True)
-    conf.env['GNOME_PYTHON_DEFSDIR'] = values['GNOME_PYTHON_DEFSDIR']
-    conf.env['GNOME_PYTHON_ARG_TYPES_DIR'] = values['GNOME_PYTHON_ARGTYPESDIR']
+    values = conf.pkg_check_modules('GNOME_PYTHON',
+                                    'gnome-python-2.0 >= %s' % ('.'.join([str(x) for x in gnome_python_version]),))
+    conf.env['GNOME_PYTHON_DEFSDIR'] = conf.pkg_check_module_variable('gnome-python-2.0', 'defsdir')
+    conf.env['GNOME_PYTHON_ARG_TYPES_DIR'] = conf.pkg_check_module_variable('gnome-python-2.0', 'argtypesdir')
 
     if not conf.find_program('pygobject-codegen-2.0', var='CODEGEN'):
         if not conf.find_program('pygtk-codegen-2.0', var='CODEGEN'):
-            Params.fatal("Could not find pygobject/pygtk codegen")
+            Logs.error("Could not find pygobject/pygtk codegen")
 
     conf.env.append_value('CCDEFINES', 'HAVE_CONFIG_H')
 
-    conf.env['ENABLE_MODULES'] = Params.g_options.enable_modules.split(',')
+    conf.env['ENABLE_MODULES'] = Options.options.enable_modules.split(',')
     
     conf.sub_config('gnomekeyring')
     conf.sub_config('gnomeapplet')
@@ -111,35 +112,103 @@
     conf.write_config_header('config.h')
 
 
-def build(bld):
+def codegen(bld, module, local_load_types=(), register=(), local_register=(), prefix=None, py_ssize_t_clean=True):
+    cmd = bld.new_task_gen('command',
+                           source=['%s.defs' % module, '%s.override' % module],
+                           target=['%s.c' % module])
+    cmd.command = ['${CODEGEN}']
+
+    if py_ssize_t_clean:
+        cmd.command.append('--py_ssize_t-clean')
+
+    register = [os.path.join(bld.env['PYGTK_DEFSDIR'], 'pango-types.defs'),
+                os.path.join(bld.env['PYGTK_DEFSDIR'], 'gdk-types.defs'),
+                os.path.join(bld.env['PYGTK_DEFSDIR'], 'gtk-types.defs'),
+                os.path.join(bld.env['GNOME_PYTHON_DEFSDIR'], 'bonobo-types.defs'),
+                os.path.join(bld.env['GNOME_PYTHON_DEFSDIR'], 'bonoboui-types.defs'),
+                ] + list(register)
 
-    ## cater for WAF API change between 1.3 and 1.4
-    waf_version = [int (s) for s in Params.g_version.split('.')]
-    if waf_version >= [1,4]:
-        def create_pyext(bld):
-            return bld.create_obj('cc', 'shlib', 'pyext')
+    cmd.command.extend(['--load-types', os.path.join(bld.env['GNOME_PYTHON_ARG_TYPES_DIR'], 'bonobo-arg-types.py')])
+    
+    for load in local_load_types:
+        cmd.source.append(load)
+        cmd.command.extend(['--load-types', '${SRC[%i]}' % (len(cmd.source)-1)])
+    
+    for reg in local_register:
+        cmd.source.append(reg)
+        cmd.command.extend(['--register', '${SRC[%i]}' % (len(cmd.source)-1)])
+
+    for reg in register:
+        cmd.command.extend(['--register', reg])
+
+    if prefix:
+        cmd.command.extend(['--prefix', prefix])
     else:
-        def create_pyext(bld):
-            return bld.create_obj('cc', 'plugin', 'pyext')
+        cmd.command.extend(['--prefix', 'py'+module])
+
+    cmd.command.extend(['--override', "${SRC[1]}",
+                        '${SRC[0]}',
+                        '>', '${TGT[0]}'])
+
+    return cmd
+
+
+
+def build_docs_for_module(bld, module_name):
+    d = bld.path.find_dir('html').abspath()
+    if bld.env['XSLTPROC'] and not os.path.exists(os.path.join(d, 'index.html')):
+        html_dir = os.path.join(bld.env['DATADIR'], 'gtk-doc', 'html')
+        target_dir = os.path.join('html_dir', module_name)
+
+        cmd = bld.new_task_gen('command',
+                               target='html/index.html',
+                               source=('../ref-html-style.xsl %s-classes.xml' % module_name),
+                               command=(
+                '${XSLTPROC} --nonet --xinclude -o ${TGT[0].parent}/'
+                ' --stringparam gtkdoc.bookname py%s'
+                ' --stringparam gtkdoc.version ${VERSION}'
+                ' --stringparam chunker.output.encoding UTF-8'
+                ' ${SRC[0]} ${SRC[1]}' % module_name))
+
+        cmd = bld.new_task_gen('command',
+                               target=('html/%s-class-reference.html' % module_name),
+                               source='html/index.html',
+                               command='gtkdoc-fixxref --module-dir=${TGT[0].parent} --html-dir=${HTMLDIR}',
+                               variables=dict(HTMLDIR=html_dir))
+
+    html_files = glob.glob(os.path.join(bld.path.find_dir('html').abspath(bld.env), '*'))
+    html_files += glob.glob(os.path.join(bld.path.find_dir('html').abspath(), '*'))
+    bld.install_files('${DATADIR}/gtk-doc/html/py%s' % module_name, html_files)
+
+
+def build(bld):
+    env = bld.env
+
+    # Attach the 'codegen' method to the build context
+    bld.codegen = types.MethodType(codegen, bld)
+    # Generic template for building docs
+    bld.build_docs_for_module = types.MethodType(build_docs_for_module, bld)
+
+    def create_pyext(bld):
+        return bld.new_task_gen('cc', 'shlib', 'pyext')
     bld.create_pyext = types.MethodType(create_pyext, bld)
 
 
     ## generate and install the .pc file
-    obj = bld.create_obj('subst')
+    obj = bld.new_task_gen('subst')
     obj.source = 'gnome-python-desktop-2.0.pc.in'
     obj.target = 'gnome-python-desktop-2.0.pc'
     obj.dict = {
         'VERSION': VERSION,
-        'prefix': bld.env()['PREFIX'],
-        'exec_prefix': bld.env()['PREFIX'],
-        'libdir': bld.env()['LIBDIR'],
-        'includedir': os.path.join(bld.env()['PREFIX'], 'include'),
-        'datadir': bld.env()['DATADIR'],
-        'datarootdir': bld.env()['DATADIR'],
+        'prefix': env['PREFIX'],
+        'exec_prefix': env['PREFIX'],
+        'libdir': env['LIBDIR'],
+        'includedir': os.path.join(env['PREFIX'], 'include'),
+        'datadir': env['DATADIR'],
+        'datarootdir': env['DATADIR'],
         }
     obj.fun = misc.subst_func
-    obj.inst_var = 'LIBDIR'
-    obj.inst_dir = 'pkgconfig'
+    obj.install_path = '${LIBDIR}/pkgconfig'
 
     ## subdirs
     bld.add_subdirs('gnomekeyring')
@@ -162,9 +231,8 @@
 
 
 def shutdown():
-    env = Params.g_build.env_of_name('default')
-
-    if Params.g_commands['check']:
+    env = Build.bld.env
+    if Options.commands['check']:
         _run_tests(env)
 
 
@@ -176,7 +244,10 @@
     for subdir in ["evolution", "gnomedesktop", "gnomeprint", "totem"]:
         src = os.path.join(subdir, "__init__.py")
         dst = os.path.join(builddir, subdir)
-        shutil.copy(src, dst)
+        try:
+            shutil.copy(src, dst + os.path.sep)
+        except IOError:
+            pass
     os_env = dict(os.environ)
     if 'PYTHONPATH' in os_env:
         os_env['PYTHONPATH'] = os.pathsep.join([builddir, os_env['PYTHONPATH']])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]