File: wscript

package info (click to toggle)
libdesktop-agnostic 0.3.90-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,004 kB
  • ctags: 4,635
  • sloc: ansic: 30,148; python: 1,069; makefile: 24; xml: 12
file content (52 lines) | stat: -rw-r--r-- 1,690 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env python
# encoding: utf-8

import Options
import Utils
import misc


def set_options(opt):
    opt.add_option('--with-glade', action='store_true',
                   dest='glade', default=False,
                   help='Installs the Glade catalog for the ' \
                        'desktop-agnostic GTK widgets.')


def configure(conf):
    conf.env['GLADE_SUPPORT'] = Options.options.glade
    if conf.env['GLADE_SUPPORT']:
        conf.check_cfg(package='gladeui-1.0', uselib_store='GLADEUI',
                       mandatory=True, args='--cflags --libs')
        pkgconfig = 'pkg-config --variable catalogdir gladeui-1.0'
        conf.env['GLADEUI_CATALOGDIR'] = \
                Utils.cmd_output(pkgconfig, silent=1).strip()


def build(bld):
    pc = bld.new_task_gen('subst')
    pc.source = 'desktop-agnostic.pc.in'
    pc.target = 'desktop-agnostic.pc'
    pc.dict = {
        'API_VERSION': bld.env['API_VERSION'],
        'LIBDIR': bld.env['LIBDIR'],
        'VERSION': bld.env['VERSION'],
        'prefix': bld.env['PREFIX'],
        'datarootdir': bld.env['DATADIR'],
        }
    pc.fun = misc.subst_func
    pc.install_path = '${LIBDIR}/pkgconfig'

    ini = bld.new_task_gen('subst')
    ini.source = 'desktop-agnostic.ini.in'
    ini.target = 'desktop-agnostic.ini'
    ini.dict = {
        'CONFIG_BACKEND': bld.env['BACKENDS_CFG'][0],
        'VFS_BACKEND': bld.env['BACKENDS_VFS'][0],
        'DESKTOP_ENTRY_BACKEND': bld.env['BACKENDS_DE'][0],
    }
    ini.fun = misc.subst_func
    ini.install_path = '${SYSCONFDIR}/xdg/libdesktop-agnostic'

    if bld.env['GLADE_SUPPORT']:
        bld.install_files('${GLADEUI_CATALOGDIR}', 'desktop-agnostic.xml')