@@ -336,16 +336,16 @@ def parseOptions(args=None):
336
336
options , args = getopt .getopt (args , '?hb' ,
337
337
[ 'build-dir=' , 'third-party=' , 'sdk-path=' , 'src-dir=' ])
338
338
except getopt .error as msg :
339
- print msg
339
+ print ( msg )
340
340
sys .exit (1 )
341
341
342
342
if args :
343
- print "Additional arguments"
343
+ print ( "Additional arguments" )
344
344
sys .exit (1 )
345
345
346
346
for k , v in options :
347
347
if k in ('-h' , '-?' ):
348
- print USAGE
348
+ print ( USAGE )
349
349
sys .exit (0 )
350
350
351
351
elif k in ('-d' , '--build-dir' ):
@@ -368,12 +368,12 @@ def parseOptions(args=None):
368
368
SDKPATH = os .path .abspath (SDKPATH )
369
369
DEPSRC = os .path .abspath (DEPSRC )
370
370
371
- print "Settings:"
372
- print " * Source directory:" , SRCDIR
373
- print " * Build directory: " , WORKDIR
374
- print " * SDK location: " , SDKPATH
375
- print " * third-party source:" , DEPSRC
376
- print ""
371
+ print ( "Settings:" )
372
+ print ( " * Source directory:" , SRCDIR )
373
+ print ( " * Build directory: " , WORKDIR )
374
+ print ( " * SDK location: " , SDKPATH )
375
+ print ( " * third-party source:" , DEPSRC )
376
+ print ( "" )
377
377
378
378
379
379
@@ -440,7 +440,7 @@ def downloadURL(url, fname):
440
440
pass
441
441
else :
442
442
if KNOWNSIZES .get (url ) == size :
443
- print "Using existing file for" , url
443
+ print ( "Using existing file for" , url )
444
444
return
445
445
fpIn = urllib2 .urlopen (url )
446
446
fpOut = open (fname , 'wb' )
@@ -479,14 +479,14 @@ def buildRecipe(recipe, basedir, archList):
479
479
480
480
481
481
if os .path .exists (sourceArchive ):
482
- print "Using local copy of %s" % (name ,)
482
+ print ( "Using local copy of %s" % (name ,) )
483
483
484
484
else :
485
- print "Downloading %s" % (name ,)
485
+ print ( "Downloading %s" % (name ,) )
486
486
downloadURL (url , sourceArchive )
487
- print "Archive for %s stored as %s" % (name , sourceArchive )
487
+ print ( "Archive for %s stored as %s" % (name , sourceArchive ) )
488
488
489
- print "Extracting archive for %s" % (name ,)
489
+ print ( "Extracting archive for %s" % (name ,) )
490
490
buildDir = os .path .join (WORKDIR , '_bld' )
491
491
if not os .path .exists (buildDir ):
492
492
os .mkdir (buildDir )
@@ -549,24 +549,24 @@ def buildRecipe(recipe, basedir, archList):
549
549
configure_args .insert (0 , configure )
550
550
configure_args = [ shellQuote (a ) for a in configure_args ]
551
551
552
- print "Running configure for %s" % (name ,)
552
+ print ( "Running configure for %s" % (name ,) )
553
553
runCommand (' ' .join (configure_args ) + ' 2>&1' )
554
554
555
- print "Running install for %s" % (name ,)
555
+ print ( "Running install for %s" % (name ,) )
556
556
runCommand ('{ ' + install + ' ;} 2>&1' )
557
557
558
- print "Done %s" % (name ,)
559
- print ""
558
+ print ( "Done %s" % (name ,) )
559
+ print ( "" )
560
560
561
561
os .chdir (curdir )
562
562
563
563
def buildLibraries ():
564
564
"""
565
565
Build our dependencies into $WORKDIR/libraries/usr/local
566
566
"""
567
- print ""
568
- print "Building required libraries"
569
- print ""
567
+ print ( "" )
568
+ print ( "Building required libraries" )
569
+ print ( "" )
570
570
universal = os .path .join (WORKDIR , 'libraries' )
571
571
os .mkdir (universal )
572
572
os .makedirs (os .path .join (universal , 'usr' , 'local' , 'lib' ))
@@ -580,21 +580,21 @@ def buildLibraries():
580
580
def buildPythonDocs ():
581
581
# This stores the documentation as Resources/English.lproj/Docuentation
582
582
# inside the framwork. pydoc and IDLE will pick it up there.
583
- print "Install python documentation"
583
+ print ( "Install python documentation" )
584
584
rootDir = os .path .join (WORKDIR , '_root' )
585
585
version = getVersion ()
586
586
docdir = os .path .join (rootDir , 'pydocs' )
587
587
588
588
name = 'html-%s.tar.bz2' % (getFullVersion (),)
589
589
sourceArchive = os .path .join (DEPSRC , name )
590
590
if os .path .exists (sourceArchive ):
591
- print "Using local copy of %s" % (name ,)
591
+ print ( "Using local copy of %s" % (name ,) )
592
592
593
593
else :
594
- print "Downloading %s" % (name ,)
594
+ print ( "Downloading %s" % (name ,) )
595
595
downloadURL ('http://www.python.org/ftp/python/doc/%s/%s' % (
596
596
getFullVersion (), name ), sourceArchive )
597
- print "Archive for %s stored as %s" % (name , sourceArchive )
597
+ print ( "Archive for %s stored as %s" % (name , sourceArchive ) )
598
598
599
599
extractArchive (os .path .dirname (docdir ), sourceArchive )
600
600
os .rename (
@@ -604,7 +604,7 @@ def buildPythonDocs():
604
604
605
605
606
606
def buildPython ():
607
- print "Building a universal python"
607
+ print ( "Building a universal python" )
608
608
609
609
buildDir = os .path .join (WORKDIR , '_bld' , 'python' )
610
610
rootDir = os .path .join (WORKDIR , '_root' )
@@ -627,24 +627,24 @@ def buildPython():
627
627
# several paths.
628
628
version = getVersion ()
629
629
630
- print "Running configure..."
630
+ print ( "Running configure..." )
631
631
runCommand ("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1" % (
632
632
shellQuote (os .path .join (SRCDIR , 'configure' )),
633
633
shellQuote (SDKPATH ), shellQuote (WORKDIR )[1 :- 1 ],
634
634
shellQuote (WORKDIR )[1 :- 1 ]))
635
635
636
- print "Running make"
636
+ print ( "Running make" )
637
637
runCommand ("make" )
638
638
639
- print "Running make frameworkinstall"
639
+ print ( "Running make frameworkinstall" )
640
640
runCommand ("make frameworkinstall DESTDIR=%s" % (
641
641
shellQuote (rootDir )))
642
642
643
- print "Running make frameworkinstallextras"
643
+ print ( "Running make frameworkinstallextras" )
644
644
runCommand ("make frameworkinstallextras DESTDIR=%s" % (
645
645
shellQuote (rootDir )))
646
646
647
- print "Copying required shared libraries"
647
+ print ( "Copying required shared libraries" )
648
648
if os .path .exists (os .path .join (WORKDIR , 'libraries' , 'Library' )):
649
649
runCommand ("mv %s/* %s" % (
650
650
shellQuote (os .path .join (
@@ -655,7 +655,7 @@ def buildPython():
655
655
'Python.framework' , 'Versions' , getVersion (),
656
656
'lib' ))))
657
657
658
- print "Fix file modes"
658
+ print ( "Fix file modes" )
659
659
frmDir = os .path .join (rootDir , 'Library' , 'Frameworks' , 'Python.framework' )
660
660
gid = grp .getgrnam ('admin' ).gr_gid
661
661
@@ -744,7 +744,7 @@ def packageFromRecipe(targetDir, recipe):
744
744
readme = textwrap .dedent (recipe ['readme' ])
745
745
isRequired = recipe .get ('required' , True )
746
746
747
- print "- building package %s" % (pkgname ,)
747
+ print ( "- building package %s" % (pkgname ,) )
748
748
749
749
# Substitute some variables
750
750
textvars = dict (
@@ -1047,9 +1047,9 @@ def main():
1047
1047
shutil .copy ('../../LICENSE' , os .path .join (WORKDIR , 'installer' , 'License.txt' ))
1048
1048
1049
1049
fp = open (os .path .join (WORKDIR , 'installer' , 'Build.txt' ), 'w' )
1050
- print >> fp , "# BUILD INFO"
1051
- print >> fp , "# Date:" , time .ctime ()
1052
- print >> fp , "# By:" , pwd .getpwuid (os .getuid ()).pw_gecos
1050
+ print ( "# BUILD INFO" , file = fp )
1051
+ print ( "# Date:" , time .ctime (), file = fp )
1052
+ print ( "# By:" , pwd .getpwuid (os .getuid ()).pw_gecos , file = fp )
1053
1053
fp .close ()
1054
1054
1055
1055
# Custom icon for the DMG, shown when the DMG is mounted.
0 commit comments