Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.21 KB | None | 0 0
  1. import Options
  2.  
  3. # For creating a source archive.
  4. APPNAME = 'xfce4-namebar-plugin'
  5. VERSION = '0.2'
  6.  
  7. # Required waf stuff.
  8. top = '.'
  9. out = 'build'
  10.  
  11. def options (opt):
  12.     opt.load('compiler_c')
  13.     opt.load('vala')
  14.  
  15. def configure (conf):
  16.     # Save prefix and strip off extraneous slash.
  17.     conf.env.prefix = Options.options.prefix
  18.     if conf.env.prefix[-1] == '/' :
  19.         conf.env.prefix = conf.env.prefix[:-1]
  20.    
  21.     # Check for required stuff.
  22.     conf.load('compiler_c vala')
  23.     args = '--cflags --libs'
  24.     conf.check_cfg(package = 'glib-2.0', atleast_version = '2.10',
  25.         uselib_store = 'GLIB', mandatory = True, args = args)
  26.     conf.check_cfg(package = 'gtk+-2.0', atleast_version = '2.16',
  27.         uselib_store = 'GTK', mandatory = True, args = args)
  28.     conf.check_cfg(package = 'libxfce4panel-1.0', atleast_version = '4.6',
  29.         uselib_store = 'XFCE4PANEL', mandatory = True, args = args)
  30.     conf.check_cfg(package = 'xfce4-vala', atleast_version='4.6',
  31.         uselib_store = 'XFCE4VALA', mandatory = True, args = args)
  32.     conf.check_cfg(package = 'libwnck-1.0', atleast_version = '2.20',
  33.         uselib_store = 'LIBWNCK', mandatory = True, args = args)
  34.  
  35. def build (bld):
  36.     # Compile the program.
  37.     src = bld.program(
  38.         features     = 'cc cprogram',
  39.         packages     = 'glib-2.0 gtk+-2.0 libxfce4panel-1.0 libwnck-1.0',
  40.         target       = 'xfce4-namebar-plugin',
  41.         install_path = '${PREFIX}/lib/xfce4/panel-plugins/',
  42.         uselib       = 'GLIB GTK XFCE4PANEL LIBWNCK',
  43.         defines      = ['WNCK_I_KNOW_THIS_IS_UNSTABLE'])
  44.     src.add_subdirs('src')
  45.    
  46.     # Substitute the prefix in the desktop file.
  47.     desktop = bld(
  48.         source = 'data/namebar.desktop.in',
  49.         PREFIX = bld.env.prefix)
  50.     #sub = bld(
  51.     #   features = 'subst',
  52.     #   source   = 'data/namebar.desktop.in',
  53.     #   target   = 'data/namebar.desktop')
  54.     #sub.dict = {'PREFIX' : bld.env.prefix}
  55.    
  56.     # Install the files.
  57.     data_dir = bld.path.find_dir('data')
  58.     bld.install_files(
  59.         '${PREFIX}/share/namebar/',
  60.         data_dir.ant_glob('themes/**/*'),
  61.         cwd = data_dir,
  62.         relative_trick = True)
  63.     bld.install_files(
  64.         '${PREFIX}/share/xfce4/panel-plugins/',
  65.         'data/namebar.desktop')
  66.     bld.install_files(
  67.         '${PREFIX}/share/pixmaps/',
  68.         'data/xfce4-namebar.png')
  69.     bld.install_files(
  70.         '${PREFIX}/bin/',
  71.         'data/convert-wb-to-nb')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement