5/llvm: Add LLVM as a package for RTEMS.

- Add '%source download <source>' to only download the source
  and do not unpack and prep. This can used when a package
  internally needs another source package.

- Install the staging root only if it is present. A package
  may internally build another package that is not staged as it
  is not suitable for installing.

Updates #3250
Updatew #3797
This commit is contained in:
Chris Johns
2019-09-12 20:09:13 +10:00
parent b3b5ca9ec3
commit 4b7af07300
14 changed files with 451 additions and 75 deletions

View File

@@ -405,18 +405,6 @@ class buildset:
if nesting_count != 1:
if self.installing():
self.macros['install_mode'] = 'staging'
#
# Prepend staging areas, bin directory tothe
# path. Lets the later package depend on the eailier
# ones.
#
pathprepend = ['%{stagingroot}/bin'] + \
macro_expand(self.macros, '%{_pathprepend}').split(':')
pathprepend = [pp for pp in pathprepend if len(pp)]
if len(pathprepend) == 1:
self.macros['_pathprepend'] = pathprepend[0]
else:
self.macros['_pathprepend'] = ':'.join(pathprepend)
#
# Only the outter build set can have staging to install. Get the staging
@@ -430,6 +418,20 @@ class buildset:
log.trace('_bset: %2d: %s: configs: %s' % (nesting_count,
self.bset, ', '.join(configs)))
if nesting_count == 1 and len(configs) > 1:
#
# Prepend staging areas, bin directory to the
# path. Lets the later package depend on the earlier
# ones.
#
pathprepend = ['%{stagingroot}/bin'] + \
macro_expand(self.macros, '%{_pathprepend}').split(':')
pathprepend = [pp for pp in pathprepend if len(pp)]
if len(pathprepend) == 1:
self.macros['_pathprepend'] = pathprepend[0]
else:
self.macros['_pathprepend'] = ':'.join(pathprepend)
sizes_valid = False
builds = []
for s in range(0, len(configs)):
@@ -519,7 +521,7 @@ class buildset:
log.trace('_bset: %2d: %s: builds: %s' % \
(nesting_count, self.install_mode(),
', '.join([b.name() for b in builds])))
if deps is None and not have_errors:
if deps is None and not self.opts.no_install() and not have_errors:
for b in builds:
log.trace('_bset: : %s: %r' % (self.install_mode(),
b.installable()))
@@ -586,18 +588,22 @@ class buildset:
# If builds have been staged install into the finaly prefix.
#
if have_staging and not self.opts.no_install() and not have_errors:
log.trace('_bset: %2d: install staging' % (nesting_count))
stagingroot = macro_expand(self.macros, '%{stagingroot}')
prefix = macro_expand(self.macros, '%{_prefix}')
self.install(self.install_mode(), self.bset, stagingroot, prefix)
staging_size = path.get_size(stagingroot)
if not self.opts.no_clean() or self.opts.always_clean():
log.notice('clean staging: %s' % (self.bset))
log.trace('removing: %s' % (stagingroot))
if not self.opts.dry_run():
if path.exists(stagingroot):
path.removeall(stagingroot)
log.notice('Staging Size: %s' % (build.humanize_number(staging_size, 'B')))
have_stagingroot = path.exists(stagingroot)
log.trace('_bset: %2d: install staging, present: %s' % \
(nesting_count, have_stagingroot))
if have_stagingroot:
prefix = macro_expand(self.macros, '%{_prefix}')
self.install(self.install_mode(), self.bset, stagingroot, prefix)
staging_size = path.get_size(stagingroot)
if not self.opts.no_clean() or self.opts.always_clean():
log.notice('clean staging: %s' % (self.bset))
log.trace('removing: %s' % (stagingroot))
if not self.opts.dry_run():
if path.exists(stagingroot):
path.removeall(stagingroot)
log.notice('Staging Size: %s' % \
(build.humanize_number(staging_size, 'B')))
except error.general as gerr:
if not build_error:
log.stderr(str(gerr))