summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct29
1 files changed, 23 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct
index ae1a06e..abf5fa8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -172,6 +172,14 @@ if build_id is None:
else:
build_id = ''
+import os.path
+import distutils.command
+
+no_winpack_templates = not os.path.exists(os.path.join(os.path.split(distutils.command.__file__)[0],'wininst-9.0.exe'))
+skip_win_packages = ARGUMENTS.get('SKIP_WIN_PACKAGES',False) or no_winpack_templates
+if skip_win_packages:
+ print "Skipping the build of Windows packages..."
+
python_ver = sys.version[0:3]
#
@@ -235,6 +243,8 @@ command_line_variables = [
("VERSION=", "The SCons version being packaged. The default " +
"is the hard-coded value '%s' " % default_version +
"from this SConstruct file."),
+
+ ("SKIP_WIN_PACKAGES=", "If set, skip building win32 and win64 packages."),
]
Default('.', build_dir)
@@ -495,10 +505,13 @@ Version_values = [Value(version), Value(build_id)]
# separate packages.
#
+from distutils.sysconfig import get_python_lib;
+
+
python_scons = {
'pkg' : 'python-' + project,
'src_subdir' : 'engine',
- 'inst_subdir' : os.path.join('lib', 'python1.5', 'site-packages'),
+ 'inst_subdir' : get_python_lib(),
'rpm_dir' : '/usr/lib/scons',
'debian_deps' : [
@@ -737,8 +750,6 @@ for p in [ scons ]:
'dist',
"%s.%s.zip" % (pkg_version, platform))
- win64_exe = os.path.join(build, 'dist', "%s.win-amd64.exe" % pkg_version)
- win32_exe = os.path.join(build, 'dist', "%s.win32.exe" % pkg_version)
#
# Update the environment with the relevant information
@@ -849,8 +860,13 @@ for p in [ scons ]:
Local(*build_src_files)
distutils_formats = []
+ distutils_targets = []
+
+ if not skip_win_packages:
+ win64_exe = os.path.join(build, 'dist', "%s.win-amd64.exe" % pkg_version)
+ win32_exe = os.path.join(build, 'dist', "%s.win32.exe" % pkg_version)
+ distutils_targets.extend([ win32_exe , win64_exe ])
- distutils_targets = [ win32_exe , win64_exe ]
dist_distutils_targets = []
for target in distutils_targets:
@@ -1088,9 +1104,10 @@ for p in [ scons ]:
commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY sdist --formats=%s" % \
','.join(distutils_formats))
- commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wininst --plat-name=win32 --user-access-control auto")
+ if not skip_win_packages:
+ commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wininst --plat-name=win32 --user-access-control auto")
- commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wininst --plat-name=win-amd64 --user-access-control auto")
+ commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wininst --plat-name=win-amd64 --user-access-control auto")
env.Command(distutils_targets, build_src_files, commands)