22
22
DOWNLOADS ,
23
23
)
24
24
from pythonbuild .utils import (
25
+ add_license_to_link_entry ,
25
26
create_tar_from_directory ,
26
27
download_entry ,
27
28
extract_tar_to_directory ,
@@ -238,10 +239,14 @@ def process_setup_line(line):
238
239
log ('adding library %s for extension %s' % (libname , extension ))
239
240
240
241
if libname in libraries :
241
- links . append ( {
242
+ entry = {
242
243
'name' : libname ,
243
244
'path_static' : 'build/lib/lib%s.a' % libname ,
244
- })
245
+ }
246
+
247
+ add_license_to_link_entry (entry )
248
+
249
+ links .append (entry )
245
250
else :
246
251
links .append ({
247
252
'name' : libname ,
@@ -346,7 +351,9 @@ def build_cpython(optimized=False):
346
351
with makefile_extra_path .open ('wb' ) as fh :
347
352
fh .write (extra_make_content )
348
353
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 )
350
357
351
358
env = dict (os .environ )
352
359
env ['PYTHON_VERSION' ] = python_version
@@ -365,7 +372,7 @@ def build_cpython(optimized=False):
365
372
366
373
# Create PYTHON.json file describing this distribution.
367
374
python_info = {
368
- 'version' : '1 ' ,
375
+ 'version' : '2 ' ,
369
376
'os' : 'macos' ,
370
377
'arch' : 'x86_64' ,
371
378
'python_flavor' : 'cpython' ,
@@ -377,6 +384,8 @@ def build_cpython(optimized=False):
377
384
config_c_in ,
378
385
setup_dist_content ,
379
386
setup_local_content ),
387
+ 'licenses' : DOWNLOADS ['cpython-3.7' ]['licenses' ],
388
+ 'license_path' : 'licenses/LICENSE.cpython.txt' ,
380
389
}
381
390
382
391
with (td / 'out' / 'python' / 'PYTHON.json' ).open ('w' ) as fh :
0 commit comments