Fix support for Windows (MinGW) native builds using MSYS.

Fix paths that need to be coverted to host format.

The shell expansion needs to invoke a shell on Windows as cmd.exe
will not work.

Munch the paths into smaller sizes for Windows due to the limited
path size.
This commit is contained in:
Chris Johns
2013-05-13 14:44:49 +10:00
parent e2266055bc
commit 5237f1ccb7
7 changed files with 51 additions and 12 deletions

View File

@@ -90,6 +90,23 @@ class script:
class build:
"""Build a package given a config file."""
def _name_(self, name):
#
# If on Windows use shorter names to keep the build paths.
#
if options.host_windows:
buildname = ''
add = True
for c in name:
if c == '-':
add = True
elif add:
buildname += c
add = False
return buildname
else:
return name
def __init__(self, name, create_tar_files, opts, macros = None):
self.opts = opts
if macros is None:
@@ -100,6 +117,7 @@ class build:
log.notice('config: ' + name)
self.config = config.file(name, opts, self.macros)
self.script = script()
self.macros['buildname'] = self._name_(self.macros['name'])
def rmdir(self, rmpath):
log.output('removing: %s' % (path.host(rmpath)))
@@ -214,6 +232,7 @@ class build:
name = source['name']
else:
raise error.general('setup source tag not found: %d' % (source_tag))
name = self._name_(name)
self.script.append(self.config.expand('cd %{_builddir}'))
if delete_before_unpack:
self.script.append(self.config.expand('%{__rm} -rf ' + name))