#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) import os import intltool, gnome # the following two variables are used by the target "waf dist" VERSION='0.0.2' APPNAME='gnome-test' # these variables are mandatory ('/' are converted automatically) srcdir = '.' blddir = 'build' def set_options(opt): # add your custom options here, for example: #opt.add_option('--bunny', type='string', help='how many bunnies we have', dest='bunny') pass def configure(conf): conf.check_tool('gcc gnome cs intltool glib2') conf.check_cfg(package='gobject-2.0', uselib_store='GOBJECT', atleast_version='2.10.0', args='--cflags --libs', mandatory=True) conf.check_cfg(package='libgnome-2.0', uselib_store='GNOME', atleast_version='2.10.0', args='--cflags --libs', mandatory=True) conf.check_cfg(package='libgnomeui-2.0', uselib_store='GNOMEUI', atleast_version='2.10.0', mandatory=True, args='--cflags --libs') conf.check_cfg(package='gtk+-2.0', uselib_store='GTK', atleast_version='2.6.0', mandatory=True, args='--cflags --libs') conf.check_cfg(package='dbus-glib-1', uselib_store='DBUSGLIB', atleast_version='0.60', mandatory=True, args='--cflags --libs') conf.check_cfg(package='gtk-sharp-2.0', uselib_store='GTKSHARP', mandatory=False, args='--cflags --libs') #always defined to indicate that i18n is enabled */ conf.define('ENABLE_NLS', 1) #Define to 1 if you have the `bind_textdomain_codeset' function. conf.define('HAVE_BIND_TEXTDOMAIN_CODESET', 1) #Define to 1 if you have the `dcgettext' function. conf.define('HAVE_DCGETTEXT', 1) #Define to 1 if you have the <dlfcn.h> header file. conf.check(header_name='dlfcn.h', define_name='HAVE_DLFCN_H') #Define if the GNU gettext() function is already present or preinstalled. conf.define('HAVE_GETTEXT', 1) #Define to 1 if you have the <inttypes.h> header file. conf.check(header_name='inttypes.h', define_name='HAVE_INTTYPES_H') #Define if your <locale.h> file defines LC_MESSAGES. #conf.add_define('HAVE_LC_MESSAGES', '1') #Define to 1 if you have the <locale.h> header file. conf.check(header_name='locale.h', define_name='HAVE_LOCALE_H') #Define to 1 if you have the <memory.h> header file. conf.check(header_name='memory.h', define_name='HAVE_MEMORY_H') #Define to 1 if you have the <stdint.h> header file. conf.check(header_name='stdint.h', define_name='HAVE_STDINT_H') #Define to 1 if you have the <stdlib.h> header file. conf.check(header_name='stdlib.h', define_name='HAVE_STDLIB_H') #Define to 1 if you have the <strings.h> header file. conf.check(header_name='strings.h', define_name='HAVE_STRINGS_H') #Define to 1 if you have the <string.h> header file. conf.check(header_name='string.h', define_name='HAVE_STRING_H') #Define to 1 if you have the <sys/stat.h> header file. conf.check(header_name='sys/stat.h', define_name='HAVE_SYS_STAT_H') #Define to 1 if you have the <sys/types.h> header file. conf.check(header_name='sys/types.h', define_name='HAVE_SYS_TYPES_H') #Define to 1 if you have the <unistd.h> header file. conf.check(header_name='unistd.h', define_name='HAVE_UNISTD_H') # here is how to add more libraries (look in src/wscript_build too) #conf.check_cfg('glib-2.0', destvar='GLIB', vnum='2.6.0') #conf.check_cfg('libbonobo-2.0', destvar='BONOBO', vnum='2.0.0') #conf.check_cfg('libbonoboui-2.0', destvar='BONOBOUI', vnum='2.0.0') #conf.check_cfg('libglade-2.0', destvar='GLADE', vnum='2.0.1') #conf.check_cfg('libgnomecanvas-2.0', destvar='CANVAS', vnum='2.0.1') #conf.check_cfg('libgnomeprintui-2.2', destvar='PRINTUI', vnum='2.2.0') #conf.check_cfg('libgnomeprint-2.2', destvar='PRINT', vnum='2.2.0') #conf.check_cfg('libxml-2.0', destvar='XML', vnum='2.4.23') #conf.check_cfg('gdk-x11-2.0', destvar='GDK', vnum='1.0.0') conf.define('VERSION', VERSION) conf.define('GETTEXT_PACKAGE', 'gnome-hello-2.0') conf.define('PACKAGE', 'gnome-hello') conf.env.append_value('CCFLAGS', '-DHAVE_CONFIG_H') conf.env.ASSEMBLIES_GLIB = '/usr/lib/mono/gtk-sharp/glib-sharp.dll' conf.write_config_header('config.h') def build(bld): # process subfolders from here bld.add_subdirs('src mkenums marshal pixmaps') env = bld.env if env.XML2PO and env.XSLTPROC2PO: bld.add_subdirs('help') if env.INTLTOOL: bld.add_subdirs('po data') if env.HAVE_GTKSHARP and env.MCS: bld.add_subdirs('sharp') #if env.SGML2MAN: # bld.add_subdirs('man') def post(ctx): # Postinstall tasks: gnome.postinstall_scrollkeeper('gnome-hello') # Installing the user docs gnome.postinstall_schemas('gnome-test') # Installing GConf schemas gnome.postinstall_icons() # Updating the icon cache bld.add_post_fun(post)