Skip to content

Commit bc65523

Browse files
committed
macos: add license annotations and files
Just like we did for Linux.
1 parent 9167836 commit bc65523

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

cpython-macos/build.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
DOWNLOADS,
2323
)
2424
from pythonbuild.utils import (
25+
add_license_to_link_entry,
2526
create_tar_from_directory,
2627
download_entry,
2728
extract_tar_to_directory,
@@ -238,10 +239,14 @@ def process_setup_line(line):
238239
log('adding library %s for extension %s' % (libname, extension))
239240

240241
if libname in libraries:
241-
links.append({
242+
entry = {
242243
'name': libname,
243244
'path_static': 'build/lib/lib%s.a' % libname,
244-
})
245+
}
246+
247+
add_license_to_link_entry(entry)
248+
249+
links.append(entry)
245250
else:
246251
links.append({
247252
'name': libname,
@@ -346,7 +351,9 @@ def build_cpython(optimized=False):
346351
with makefile_extra_path.open('wb') as fh:
347352
fh.write(extra_make_content)
348353

349-
shutil.copyfile(ROOT / 'python-licenses.rst', td / 'python-licenses.rst')
354+
for f in sorted(os.listdir(ROOT)):
355+
if f.startswith('LICENSE.') and f.endswith('.txt'):
356+
shutil.copyfile(ROOT / f, td / f)
350357

351358
env = dict(os.environ)
352359
env['PYTHON_VERSION'] = python_version
@@ -365,7 +372,7 @@ def build_cpython(optimized=False):
365372

366373
# Create PYTHON.json file describing this distribution.
367374
python_info = {
368-
'version': '1',
375+
'version': '2',
369376
'os': 'macos',
370377
'arch': 'x86_64',
371378
'python_flavor': 'cpython',
@@ -377,6 +384,8 @@ def build_cpython(optimized=False):
377384
config_c_in,
378385
setup_dist_content,
379386
setup_local_content),
387+
'licenses': DOWNLOADS['cpython-3.7']['licenses'],
388+
'license_path': 'licenses/LICENSE.cpython.txt',
380389
}
381390

382391
with (td / 'out' / 'python' / 'PYTHON.json').open('w') as fh:

0 commit comments

Comments
 (0)