-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwscript
executable file
·110 lines (96 loc) · 2.9 KB
/
wscript
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#! /usr/bin/env python
# encoding: utf-8
# pktfag, 2009
import os, sys
import Options
APPNAME = 'pidgin-juick-plugin'
VERSION = '0.3.4'
top = '.'
out = 'build'
def options(opt):
opt.tool_options('compiler_cc')
opt.tool_options('intltool')
group = opt.add_option_group ('Install', '')
group.add_option('--for-nsis',
action='store_true',
default=False,
help='Install for Windows NSIS (work with option -w or for Windows platform)',
dest='nsis')
group = opt.add_option_group ('Windows', '')
group.add_option('-w',
action='store_true',
default=False,
help='Configure and crosscompile for Windows',
dest='win32')
def configure(conf):
is_win32=sys.platform=='win32'
conf.setenv('default')
if Options.options.win32:
# create the second environment, set the variant and set its name
#env = conf.env.copy()
#env.set_variant('win32')
#conf.set_env_name('win32', env)
# call the debug environment
conf.setenv('win32', env = conf.env.derive())
conf.check_tool('compiler_cc')
#conf.check_tool('gcc')
# we don't require intltool on Windows (it would require Perl) though it works well
conf.define('ENABLE_NLS', 1)
try:
conf.check_tool('intltool')
except:
conf.undefine('ENABLE_NLS')
conf.check_cfg(package='purple',
args='--cflags --libs',
uselib_store='purple',
mandatory=True)
conf.check_cfg(package='pidgin',
args='--cflags --libs',
uselib_store='pidgin',
mandatory=True)
conf.env.append_value('CFLAGS', ['-DHAVE_CONFIG_H', '-Wall', '-Wextra'])
if is_win32 or Options.options.win32:
# on Windows LOCALEDIR define in purple win32dep.h
conf.undefine('DATADIR')
conf.undefine('LOCALEDIR')
conf.define('GETTEXT_PACKAGE', APPNAME, 1)
conf.write_config_header('config.h')
def build(bld):
is_win32=sys.platform=='win32' or Options.options.win32
if Options.options.win32:
variant_name='win32'
else:
variant_name='default'
envx = bld.env_of_name(variant_name)
if is_win32:
envx['LOCALEDIR'] = os.path.join(envx['PREFIX'], 'locale')
if Options.options.nsis:
envx['BINDIR'] = envx['PREFIX']
envx['LIBDIR'] = envx['PREFIX']
else:
envx['BINDIR'] = os.path.join(envx['PREFIX'], 'plugins')
envx['LIBDIR'] = os.path.join(envx['PREFIX'], 'plugins')
else:
envx['LIBDIR'] = os.path.join(envx['PREFIX'], 'lib', 'pidgin')
if envx['INTLTOOL']:
bld.new_task_gen(
features = 'intltool_po',
podir = 'po',
appname = APPNAME,
env = envx.copy()
)
bld.new_task_gen(
features = 'c cshlib',
source = 'src/juick.c',
includes = '.',
target = APPNAME,
uselib = 'pidgin purple',
env = envx.copy()
)
if is_win32 and Options.options.nsis:
bld.install_as(envx['PREFIX'] + '/ChangeLog.txt', 'ChangeLog')
bld.install_as(envx['PREFIX'] + '/COPYING.txt', 'COPYING')
bld.install_files(envx['PREFIX'], 'packaging/windows/pidgin-juick-plugin.nsi')
def dist(ctx):
ctx.algo = 'zip'
ctx.excl = '**/.waf* **/.git **/build **/.lock* **/*.swp'