Imported Upstream version 0.2.5
[debian/pino.git] / wscript
1 #!/usr/bin/env python
2
3 import intltool
4
5 VERSION = "0.2.5"
6 VERSION_MAJOR_MINOR =  ".".join(VERSION.split(".")[0:2])
7 APPNAME = "pino"
8
9 srcdir = '.'
10 blddir = '_build_'
11
12 def set_options(opt):
13         opt.tool_options('compiler_cc')
14         opt.tool_options('gnu_dirs')
15
16 def configure(conf):
17         conf.check_tool('compiler_cc vala gnu_dirs intltool')
18         conf.check_cfg(package='glib-2.0', uselib_store='GLIB',
19                 atleast_version='2.14.0', mandatory=True, args='--cflags --libs')
20         conf.check_cfg(package='gobject-2.0', uselib_store='GOBJECT',
21                 atleast_version='2.14.0', mandatory=True, args='--cflags --libs')
22         conf.check_cfg(package='gtk+-2.0', uselib_store='GTK+',
23                 atleast_version='2.10.0', mandatory=True, args='--cflags --libs')
24         conf.check_cfg(package='gee-1.0', uselib_store='GEE',
25                 atleast_version='0.5.0', mandatory=True, args='--cflags --libs')
26         conf.check_cfg(package='gio-2.0', uselib_store='GIO',
27                 atleast_version='2.0', mandatory=True, args='--cflags --libs')
28         conf.check_cfg(package='libnotify', uselib_store='LIBNOTIFY',
29                 mandatory=True, args='--cflags --libs')
30         #conf.check_cfg(package='libsexy', uselib_store='GTK+',
31         #               mandatory=True, args='--cflags --libs')
32         conf.check_cfg(package='libsoup-2.4', uselib_store='LIBSOUP',
33                 atleast_version='2.4', mandatory=True, args='--cflags --libs')
34         conf.check_cfg(package='libxml-2.0', uselib_store='LIBXML',
35                 atleast_version='2.0', mandatory=True, args='--cflags --libs')
36         conf.check_cfg(package='webkit-1.0', uselib_store='WEBKIT',
37                 atleast_version='1.0', mandatory=True, args='--cflags --libs')
38         conf.check_cfg(package='unique-1.0', uselib_store='LIBUNIQUE',
39                 atleast_version='1.0', mandatory=True, args='--cflags --libs')
40         conf.check_cfg(package='gtkspell-2.0', uselib_store='GTKSPELL',
41                 atleast_version='2.0', mandatory=True, args='--cflags --libs')
42
43         conf.env.append_value('CCFLAGS', '-std=c99')
44         
45         conf.define('PACKAGE', APPNAME)
46         conf.define('PACKAGE_NAME', APPNAME)
47         conf.define('PACKAGE_STRING', APPNAME + '-' + VERSION)
48         conf.define('PACKAGE_VERSION', APPNAME + '-' + VERSION)
49
50         conf.define('APP_VERSION', VERSION)
51         conf.define('LOGO_PATH', conf.env.PREFIX + '/share/icons/hicolor/scalable/apps/pino.svg')
52         conf.define('LOGO_FRESH_PATH', conf.env.PREFIX + '/share/icons/hicolor/scalable/apps/pino_fresh.svg')
53         conf.define('MENTIONS_PATH', conf.env.PREFIX + '/share/pino/icons/mentions.svg')
54         conf.define('MENTIONS_FRESH_PATH', conf.env.PREFIX + '/share/pino/icons/mentions_fresh.svg')
55         conf.define('TIMELINE_PATH', conf.env.PREFIX + '/share/pino/icons/timeline.svg')
56         conf.define('TIMELINE_FRESH_PATH', conf.env.PREFIX + '/share/pino/icons/timeline_fresh.svg')
57         conf.define('DIRECT_PATH', conf.env.PREFIX + '/share/pino/icons/direct.svg')
58         conf.define('DIRECT_FRESH_PATH', conf.env.PREFIX + '/share/pino/icons/direct_fresh.svg')
59         conf.define('PROGRESS_PATH', conf.env.PREFIX + '/share/pino/icons/progress.gif')
60         conf.define('DIRECT_REPLY_PATH', conf.env.PREFIX + '/share/pino/icons/direct_reply.png')
61         conf.define('FAVORITE_PATH', conf.env.PREFIX + '/share/pino/icons/favorite.png')
62         conf.define('FAVORITE_NO_PATH', conf.env.PREFIX + '/share/pino/icons/favorite_no.png')
63         #conf.define('FAVORITE_MENU_PATH', conf.env.PREFIX + '/share/pino/icons/favorite_menu.svg')
64         conf.define('REPLY_PATH', conf.env.PREFIX + '/share/pino/icons/reply.png')
65         conf.define('RETWEET_PATH', conf.env.PREFIX + '/share/pino/icons/re_tweet.png')
66         conf.define('DELETE_PATH', conf.env.PREFIX + '/share/pino/icons/delete_status.png')
67         conf.define('USERPIC_PATH', conf.env.PREFIX + '/share/pino/icons/userpic.svg')
68         conf.define('TEMPLATES_PATH', conf.env.PREFIX + '/share/pino/templates')
69         conf.define('VERSION_MAJOR_MINOR', VERSION_MAJOR_MINOR)
70         conf.define('LOCALE_DIR', conf.env.PREFIX + '/share/locale/')
71         conf.define('GETTEXT_PACKAGE', APPNAME)
72         conf.define('APPNAME', APPNAME)
73         conf.define('CONS_KEY', 'k6R1A0PPkmpRcThEdPF1Q')
74         conf.define('CONS_SEC', 'TKneXwqslxkbaR3RQGcvvvGU4Qk01qh8HAhRIMN74')
75         
76         # AUTHORS --> About dialog
77         f = open('AUTHORS', 'r')
78         data = f.read()
79         f.close()
80         import re
81         data = re.sub(r'\n', r'\\n', data)
82         conf.define('AUTHORS', data)
83         #end
84         
85         conf.write_config_header("config.h")
86         init_defs(conf.env.PREFIX)
87
88 def init_defs(prefix):
89         """
90         import re
91         data = re.sub(r'string PREFIX = \"(.*)\";', 'string PREFIX = "' + prefix + '";', data)
92         
93         f = open('src/defs.vala', 'w')
94         f.write(data)
95         f.close()
96         """
97
98 def build(bld):
99         bld.add_subdirs('src')
100         #bld.add_subdirs('liboauth-client')
101         bld.add_subdirs('templates')
102         bld.add_subdirs('po')
103         
104         bld.install_files('${PREFIX}/share/icons/hicolor/scalable/apps', 'img/pino.svg')
105         bld.install_files('${PREFIX}/share/icons/hicolor/scalable/apps', 'img/pino_fresh.svg')
106         bld.install_files('${PREFIX}/share/pino/icons', 'img/mentions.svg')
107         bld.install_files('${PREFIX}/share/pino/icons', 'img/mentions_fresh.svg')
108         bld.install_files('${PREFIX}/share/pino/icons', 'img/timeline.svg')
109         bld.install_files('${PREFIX}/share/pino/icons', 'img/timeline_fresh.svg')
110         bld.install_files('${PREFIX}/share/pino/icons', 'img/direct.svg')
111         bld.install_files('${PREFIX}/share/pino/icons', 'img/direct_fresh.svg')
112         bld.install_files('${PREFIX}/share/pino/icons', 'img/progress.gif')
113         bld.install_files('${PREFIX}/share/pino/icons', 'img/direct_reply.png')
114         bld.install_files('${PREFIX}/share/pino/icons', 'img/favorite.png')
115         bld.install_files('${PREFIX}/share/pino/icons', 'img/favorite_no.png')
116         #bld.install_files('${PREFIX}/share/pino/icons', 'img/favorite_menu.svg')
117         bld.install_files('${PREFIX}/share/pino/icons', 'img/reply.png')
118         bld.install_files('${PREFIX}/share/pino/icons', 'img/re_tweet.png')
119         bld.install_files('${PREFIX}/share/pino/icons', 'img/delete_status.png')
120         bld.install_files('${PREFIX}/share/pino/icons', 'img/userpic.svg')
121         bld.install_files('${PREFIX}/share/applications', 'pino.desktop')
122         bld.install_files('${PREFIX}/share/doc/pino', 'COPYING README AUTHORS INSTALL')
123         bld.install_files('${PREFIX}/share/indicators/messages/applications', 'indicator/pino')
124         
125         #import subprocess
126         #subprocess.Popen(['desktop-file-install', '--rebuild-mime-info-cache', bld.env.PREFIX + '/share/applications/pino.desktop'], stdout=subprocess.PIPE)
127
128 def shutdown(bld):
129         """
130         import UnitTest
131         unittest = UnitTest.unit_test()
132         unittest.want_to_see_test_output = True
133         unittest.want_to_see_test_error = True
134         unittest.run()
135         unittest.print_results()
136         """