示例#1
0
def LayoutAllDir(version_quad):
  StepBanner("Layout All Dir", "Copying Arch specific to Arch-independent.")
  target_dir = PnaclDirs.OutputAllDir(version_quad)
  for arch in ARCHES:
    arch_parent, arch_dir = PnaclDirs.OutputArchDir(arch)
    # NOTE: The arch_parent contains the arch-specific manifest.json files.
    # We carefully avoid copying those to the "all dir" since having
    # more than one manifest.json will confuse the CRX tools (e.g., you will
    # get a mysterious failure when uploading to the webstore).
    copytree_existing(arch_dir,
                      J(target_dir, PnaclDirs.OutputArchBase(arch)))
def BuildArchCRXForComponentUpdater(version_quad, arch, lib_overrides, options):
  """ Build an architecture specific version for the chrome component
  install (an actual CRX, vs a zip file).  Though this is a CRX,
  it is not used as a chrome extension as the CWS and unpacked version.
  """
  parent_dir, target_dir = PnaclDirs.OutputArchDir(arch)

  StepBanner('BUILD ARCH CRX %s' % arch,
             'Packaging for arch %s in %s' % (arch, target_dir))

  # Copy llc and ld.
  copytree_existing(PnaclDirs.SandboxedCompilerDir(arch), target_dir)

  # Rename llc.nexe to llc, ld.nexe to ld
  for tool in ('llc', 'ld'):
    shutil.move(J(target_dir, '%s.nexe' % tool), J(target_dir, tool))

  # Copy native libraries.
  copytree_existing(PnaclDirs.LibDir(arch), target_dir)
  # Also copy files from the list of overrides.
  if arch in lib_overrides:
    for override in lib_overrides[arch]:
      print 'Copying override %s to %s' % (override, target_dir)
      shutil.copy2(override, target_dir)

  # Filter out native libraries related to glibc.
  patterns = ['*nonshared.a', '*.so', '*.so.*']
  for pat in patterns:
    for f in glob.glob(J(target_dir, pat)):
      print 'Filtering out glibc file: %s' % f
      os.remove(f)

  # Skip the CRX generation if we are only building the unpacked version
  # for commandline testing.
  if options.unpacked_only:
    return

  # Generate manifest one level up (to have layout look like the "all" package).
  # NOTE: this does not have 'web_accessible_resources' and does not have
  # the all_host_permissions, since it isn't used via chrome-extension://
  # URL requests.
  PnaclPackaging.GenerateManifests(parent_dir,
                                   version_quad,
                                   arch,
                                   [],
                                   False)
  CRXGen.RunCRXGen(options.chrome_path, parent_dir, options.prev_priv_key)
示例#3
0
def BuildArchCRXForComponentUpdater(version_quad, arch, lib_overrides,
                                    options):
    """ Build an architecture specific version for the chrome component
  install (an actual CRX, vs a zip file).  Though this is a CRX,
  it is not used as a chrome extension as the CWS and unpacked version.
  """
    parent_dir, target_dir = PnaclDirs.OutputArchDir(arch)

    StepBanner('BUILD ARCH CRX %s' % arch,
               'Packaging for arch %s in %s' % (arch, target_dir))

    # Copy llc and ld.
    copytree_existing(PnaclDirs.SandboxedCompilerDir(arch), target_dir)

    # Rename llc.nexe to llc, ld.nexe to ld
    for tool in ('llc', 'ld'):
        shutil.move(J(target_dir, '%s.nexe' % tool), J(target_dir, tool))

    # Copy native libraries.
    copytree_existing(PnaclDirs.LibDir(arch), target_dir)
    # Also copy files from the list of overrides.
    if arch in lib_overrides:
        for override in lib_overrides[arch]:
            print 'Copying override %s to %s' % (override, target_dir)
            shutil.copy2(override, target_dir)

    # Filter out native libraries related to glibc.
    patterns = ['*nonshared.a', '*.so', '*.so.*']
    for pat in patterns:
        for f in glob.glob(J(target_dir, pat)):
            print 'Filtering out glibc file: %s' % f
            os.remove(f)

    # Skip the CRX generation if we are only building the unpacked version
    # for commandline testing.
    if options.unpacked_only:
        return

    # Generate manifest one level up (to have layout look like the "all" package).
    # NOTE: this does not have 'web_accessible_resources' and does not have
    # the all_host_permissions, since it isn't used via chrome-extension://
    # URL requests.
    PnaclPackaging.GenerateManifests(parent_dir, version_quad, arch, [], False)
    CRXGen.RunCRXGen(options.chrome_path, parent_dir, options.prev_priv_key)