7 from os
.path
import join
8 from distutils
.sysconfig
import get_python_version
12 """Runs version.sh and returns the output."""
13 cmd
= join(os
.getcwd(), 'scripts', 'version.sh')
17 return version
.strip()
19 #############################################################################
22 VERSION
= get_version()
27 #############################################################################
30 opt
.tool_options('python')
31 opt
.tool_options('pyuic4', 'build')
34 #############################################################################
37 conf
.check_tool('misc')
38 conf
.check_tool('python')
39 conf
.check_tool('pyuic4', 'build')
40 conf
.check_tool('po2qm', 'build')
43 prefix
= env
['PREFIX']
44 bindir
= join(prefix
, 'bin')
45 sitepackages
= join(prefix
, 'share')
46 modules
= join(sitepackages
, 'ugit')
47 views
= join(modules
, 'views')
48 controllers
= join(modules
, 'controllers')
49 icons
= join(prefix
, 'share', 'ugit', 'icons')
50 apps
= join(prefix
, 'share', 'applications')
52 env
['UGIT_BINDIR'] = bindir
53 env
['UGIT_MODULES'] = modules
54 env
['UGIT_VIEWS'] = views
55 env
['UGIT_CONTROLLERS'] = controllers
56 env
['UGIT_ICONS'] = icons
57 env
['UGIT_APPS'] = apps
60 #############################################################################
63 bld
.add_subdirs('scripts ui ugit')
65 qm
= bld
.create_obj('po2qm')
66 qm
.find_sources_in_dirs('po')
68 for icon
in glob
.glob('icons/*.png'):
69 Common
.install_files('UGIT_ICONS', '', icon
)
71 #############################################################################
74 # always re-create the version.py file
75 for variant
in Params
.g_build
.m_allenvs
:
76 version_file
= join(Params
.g_build
.m_bdir
,
77 variant
, 'scripts', 'version.py')
78 if os
.path
.exists(version_file
):
79 os
.unlink(version_file
)