tests: add a "make test" target
[ugit.git] / wscript
blob691ee850f2b3ccf6cc0408077e2dd7882460144a
1 #!/usr/bin/env python
2 import os
3 import sys
4 import glob
5 import Params
6 import Common
8 # Release versioning
9 def get_version():
10 """Runs version.sh and returns the output."""
11 cmd = os.path.join(os.getcwd(), 'scripts', 'version.sh')
12 pipe = os.popen(cmd)
13 version = pipe.read()
14 pipe.close()
15 return version.strip()
17 #############################################################################
18 # Mandatory variables
19 APPNAME = 'ugit'
20 VERSION = get_version()
22 srcdir = '.'
23 blddir = 'obj'
25 #############################################################################
26 # Options
27 def set_options(opt):
28 opt.tool_options('python')
29 opt.tool_options('pyuic4', 'build')
30 pass
32 #############################################################################
33 # Configure
34 def configure(conf):
35 env = conf.env
36 env['PYMODS'] = pymod(env['PREFIX'])
37 env['PYMODS_UGIT'] = os.path.join(env['PYMODS'], 'ugit')
38 env['ICONS'] = os.path.join(env['PREFIX'], 'share', 'ugit', 'icons')
39 env['BIN'] = os.path.join(env['PREFIX'], 'bin')
41 conf.check_tool('misc')
42 conf.check_tool('python')
43 conf.check_tool('pyuic4', 'build')
44 conf.check_tool('po2qm', 'build')
46 #############################################################################
47 # Build
48 def build(bld):
49 bld.add_subdirs('scripts ui ugit')
51 qm = bld.create_obj('po2qm')
52 qm.find_sources_in_dirs('po')
54 for icon in glob.glob('icons/*.png'):
55 Common.install_files('ICONS', '', icon)
57 #############################################################################
58 # Other
59 def pymod(prefix):
60 """Returns a lib/python2.x/site-packages path relative to prefix"""
61 api_version = sys.version[:3]
62 python_api = 'python' + api_version
63 return os.path.join(prefix, 'lib', python_api, 'site-packages')