README: updated to mention "git ugit"
[ugit.git] / wscript
bloba5035544e8ea1b12b458672e8cd41bcd1fc5d32e
1 #!/usr/bin/env python
2 import os
3 import sys
4 import glob
5 import Params
6 import Common
7 from os.path import join
8 from distutils.sysconfig import get_python_version
10 # Release versioning
11 def get_version():
12 """Runs version.sh and returns the output."""
13 cmd = join(os.getcwd(), 'scripts', 'version.sh')
14 pipe = os.popen(cmd)
15 version = pipe.read()
16 pipe.close()
17 return version.strip()
19 #############################################################################
20 # Mandatory variables
21 APPNAME = 'ugit'
22 VERSION = get_version()
24 srcdir = '.'
25 blddir = 'obj'
27 #############################################################################
28 # Options
29 def set_options(opt):
30 opt.tool_options('python')
31 opt.tool_options('pyuic4', 'build')
32 pass
34 #############################################################################
35 # Configure
36 def configure(conf):
37 env = conf.env
38 prefix = env['PREFIX']
39 bindir = join(prefix, 'bin')
40 sitepackages = pymod(prefix)
41 modules = join(sitepackages, 'ugit')
42 views = join(modules, 'views')
43 controllers = join(modules, 'controllers')
44 icons = join(prefix, 'share', 'ugit', 'icons')
46 env['UGIT_BINDIR'] = bindir
47 env['UGIT_MODULES'] = modules
48 env['UGIT_VIEWS'] = views
49 env['UGIT_CONTROLLERS'] = controllers
50 env['UGIT_ICONS'] = icons
52 conf.check_tool('misc')
53 conf.check_tool('python')
54 conf.check_tool('pyuic4', 'build')
55 conf.check_tool('po2qm', 'build')
57 #############################################################################
58 # Build
59 def build(bld):
60 bld.add_subdirs('scripts ui ugit')
62 qm = bld.create_obj('po2qm')
63 qm.find_sources_in_dirs('po')
65 for icon in glob.glob('icons/*.png'):
66 Common.install_files('UGIT_ICONS', '', icon)
68 #############################################################################
69 # Other
70 def pymod(prefix):
71 """Returns a lib/python2.x/site-packages path relative to prefix"""
72 python_api = 'python' + get_python_version()
73 return join(prefix, 'lib', python_api, 'site-packages')