summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 20:47:43 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 20:47:43 +0000
commit97d9bd53f29b2637d0ac38f3b94683f9db5ad72b (patch)
treea1c334cdef07114205cd84820022dc5a4ff20025 /native_client_sdk
parent63b3f74ebb38f7d297b086b3573baeab128f3f4a (diff)
downloadchromium_src-97d9bd53f29b2637d0ac38f3b94683f9db5ad72b.zip
chromium_src-97d9bd53f29b2637d0ac38f3b94683f9db5ad72b.tar.gz
chromium_src-97d9bd53f29b2637d0ac38f3b94683f9db5ad72b.tar.bz2
[NaCl SDK] Add naclports README and LICENSE file.
NOTRY=true BUG=222128 Review URL: https://chromiumcodereview.appspot.com/12656007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/README.naclports14
-rwxr-xr-xnative_client_sdk/src/build_tools/build_sdk.py28
-rwxr-xr-xnative_client_sdk/src/build_tools/generate_notice.py6
3 files changed, 40 insertions, 8 deletions
diff --git a/native_client_sdk/src/README.naclports b/native_client_sdk/src/README.naclports
new file mode 100644
index 0000000..ed6fa76
--- /dev/null
+++ b/native_client_sdk/src/README.naclports
@@ -0,0 +1,14 @@
+NaCl Ports
+==========
+
+This folder contains headers and pre-built libraries for several
+of the more commonly used open source third-party libraries.
+
+These libraries were built from the naclports project. For access
+to the full sources, or to rebuild or modify these libraries please
+follow the instructions on naclports:
+
+ https://code.google.com/p/naclports/
+
+Please note that each of libraries libraries is licensed under its
+own specific license. See NOTICE for full list of license terms.
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index 4f0fbfb..7804ae8 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -780,20 +780,24 @@ def BuildStepBuildLibraries(pepperdir, platform, directory, clean=True):
clean=clean, config='Release')
-def BuildStepGenerateNotice(pepperdir):
+def GenerateNotice(fileroot, output_filename='NOTICE', extra_files=None):
# Look for LICENSE files
- license_filenames_re = re.compile('LICENSE|COPYING')
+ license_filenames_re = re.compile('LICENSE|COPYING|COPYRIGHT')
license_files = []
- for root, _, files in os.walk(pepperdir):
+ for root, _, files in os.walk(fileroot):
for filename in files:
if license_filenames_re.match(filename):
path = os.path.join(root, filename)
license_files.append(path)
+
+ if extra_files:
+ license_files += [os.path.join(fileroot, f) for f in extra_files]
print '\n'.join(license_files)
- notice_filename = os.path.join(pepperdir, 'NOTICE')
- generate_notice.Generate(notice_filename, pepperdir, license_files)
+ if not os.path.isabs(output_filename):
+ output_filename = os.path.join(fileroot, output_filename)
+ generate_notice.Generate(output_filename, fileroot, license_files)
def BuildStepTarBundle(pepper_ver, tarfile):
@@ -905,6 +909,18 @@ def BuildStepBuildNaClPorts(pepper_ver, pepperdir):
buildbot_common.Run([build_script], env=env, cwd=NACLPORTS_DIR)
out_dir = os.path.join(bundle_dir, 'pepper_XX')
+
+ # Some naclports do not include a standalone LICENSE/COPYING file
+ # so we explicitly list those here for inclusion.
+ extra_licenses = ('tinyxml/readme.txt',
+ 'jpeg-8d/README',
+ 'zlib-1.2.3/README')
+ src_root = os.path.join(NACLPORTS_DIR, 'out', 'repository-i686')
+ output_license = os.path.join(out_dir, 'LICENSE')
+ GenerateNotice(src_root , output_license, extra_licenses)
+ readme = os.path.join(out_dir, 'README')
+ oshelpers.Copy(['-v', 'README.naclports', readme])
+
out_dir_final = os.path.join(bundle_dir, 'pepper_%s' % pepper_ver)
buildbot_common.Move(out_dir, out_dir_final)
@@ -1009,7 +1025,7 @@ def main(args):
# Ship with libraries prebuilt, so run that first.
BuildStepBuildLibraries(pepperdir, platform, 'src')
- BuildStepGenerateNotice(pepperdir)
+ GenerateNotice(pepperdir)
if not options.skip_tar:
BuildStepTarBundle(pepper_ver, tarfile)
diff --git a/native_client_sdk/src/build_tools/generate_notice.py b/native_client_sdk/src/build_tools/generate_notice.py
index ffc376b..c7d81d2 100755
--- a/native_client_sdk/src/build_tools/generate_notice.py
+++ b/native_client_sdk/src/build_tools/generate_notice.py
@@ -34,6 +34,7 @@ def CreateLicenseDict(files):
license_dict = {}
for filename in files:
license_text = open(filename).read()
+ license_text = license_text.replace('\r\n', '\n')
license_dict.setdefault(license_text, []).append(filename)
# Flip the dictionary (map tuple of filenames -> license text).
@@ -53,15 +54,16 @@ def WriteLicense(output_file, root, license_text, license_filenames):
output_file.write(' (Cf. %s):\n' % (filename,))
output_file.write('=' * 70 + '\n')
output_file.write(license_text)
- output_file.write('\n\n\n')
def Generate(output_filename, root, files):
found_files = FindFiles(files)
license_dict = CreateLicenseDict(found_files)
with open(output_filename, 'w') as output_file:
- for license_filenames in sorted(license_dict.iterkeys()):
+ for i, license_filenames in enumerate(sorted(license_dict.iterkeys())):
license_text = license_dict[license_filenames]
+ if i:
+ output_file.write('\n\n\n')
WriteLicense(output_file, root, license_text, license_filenames)