@@ -67,6 +67,8 @@ def getFullVersion():
6767SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
6868#SDKPATH="/"
6969
70+ ARCHLIST = ('i386' , 'ppc' ,)
71+
7072# Source directory (asume we're in Mac/BuildScript)
7173SRCDIR = os .path .dirname (
7274 os .path .dirname (
@@ -90,6 +92,26 @@ def getFullVersion():
9092# Instructions for building libraries that are necessary for building a
9193# batteries included python.
9294LIBRARY_RECIPES = [
95+ dict (
96+ name = "Bzip2 1.0.3" ,
97+ url = "http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz" ,
98+ configure = None ,
99+ install = 'make install PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"' % (
100+ shellQuote (os .path .join (WORKDIR , 'libraries' )),
101+ ' -arch ' .join (ARCHLIST ),
102+ SDKPATH ,
103+ ),
104+ ),
105+ dict (
106+ name = "ZLib 1.2.3" ,
107+ url = "http://www.gzip.org/zlib/zlib-1.2.3.tar.gz" ,
108+ configure = None ,
109+ install = 'make install prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"' % (
110+ shellQuote (os .path .join (WORKDIR , 'libraries' )),
111+ ' -arch ' .join (ARCHLIST ),
112+ SDKPATH ,
113+ ),
114+ ),
93115 dict (
94116 # Note that GNU readline is GPL'd software
95117 name = "GNU Readline 5.1.4" ,
@@ -486,48 +508,49 @@ def buildRecipe(recipe, basedir, archList):
486508 runCommand ('patch -p%s < %s' % (recipe .get ('patchlevel' , 1 ),
487509 shellQuote (fn ),))
488510
489- configure_args = [
490- "--prefix=/usr/local" ,
491- "--enable-static" ,
492- "--disable-shared" ,
493- #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
494- ]
495-
496- if 'configure_pre' in recipe :
497- args = list (recipe ['configure_pre' ])
498- if '--disable-static' in args :
499- configure_args .remove ('--enable-static' )
500- if '--enable-shared' in args :
501- configure_args .remove ('--disable-shared' )
502- configure_args .extend (args )
503-
504- if recipe .get ('useLDFlags' , 1 ):
505- configure_args .extend ([
506- "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include" % (
507- ' -arch ' .join (archList ),
508- shellQuote (SDKPATH )[1 :- 1 ],
509- shellQuote (basedir )[1 :- 1 ],),
510- "LDFLAGS=-syslibroot,%s -L%s/usr/local/lib -arch %s" % (
511- shellQuote (SDKPATH )[1 :- 1 ],
512- shellQuote (basedir )[1 :- 1 ],
513- ' -arch ' .join (archList )),
514- ])
515- else :
516- configure_args .extend ([
517- "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include" % (
518- ' -arch ' .join (archList ),
511+ if configure is not None :
512+ configure_args = [
513+ "--prefix=/usr/local" ,
514+ "--enable-static" ,
515+ "--disable-shared" ,
516+ #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
517+ ]
518+
519+ if 'configure_pre' in recipe :
520+ args = list (recipe ['configure_pre' ])
521+ if '--disable-static' in args :
522+ configure_args .remove ('--enable-static' )
523+ if '--enable-shared' in args :
524+ configure_args .remove ('--disable-shared' )
525+ configure_args .extend (args )
526+
527+ if recipe .get ('useLDFlags' , 1 ):
528+ configure_args .extend ([
529+ "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include" % (
530+ ' -arch ' .join (archList ),
531+ shellQuote (SDKPATH )[1 :- 1 ],
532+ shellQuote (basedir )[1 :- 1 ],),
533+ "LDFLAGS=-syslibroot,%s -L%s/usr/local/lib -arch %s" % (
519534 shellQuote (SDKPATH )[1 :- 1 ],
520- shellQuote (basedir )[1 :- 1 ],),
521- ])
535+ shellQuote (basedir )[1 :- 1 ],
536+ ' -arch ' .join (archList )),
537+ ])
538+ else :
539+ configure_args .extend ([
540+ "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include" % (
541+ ' -arch ' .join (archList ),
542+ shellQuote (SDKPATH )[1 :- 1 ],
543+ shellQuote (basedir )[1 :- 1 ],),
544+ ])
522545
523- if 'configure_post' in recipe :
524- configure_args = configure_args = list (recipe ['configure_post' ])
546+ if 'configure_post' in recipe :
547+ configure_args = configure_args = list (recipe ['configure_post' ])
525548
526- configure_args .insert (0 , configure )
527- configure_args = [ shellQuote (a ) for a in configure_args ]
549+ configure_args .insert (0 , configure )
550+ configure_args = [ shellQuote (a ) for a in configure_args ]
528551
529- print "Running configure for %s" % (name ,)
530- runCommand (' ' .join (configure_args ) + ' 2>&1' )
552+ print "Running configure for %s" % (name ,)
553+ runCommand (' ' .join (configure_args ) + ' 2>&1' )
531554
532555 print "Running install for %s" % (name ,)
533556 runCommand ('{ ' + install + ' ;} 2>&1' )
@@ -550,7 +573,7 @@ def buildLibraries():
550573 os .makedirs (os .path .join (universal , 'usr' , 'local' , 'include' ))
551574
552575 for recipe in LIBRARY_RECIPES :
553- buildRecipe (recipe , universal , ( 'i386' , 'ppc' ,) )
576+ buildRecipe (recipe , universal , ARCHLIST )
554577
555578
556579
@@ -997,7 +1020,7 @@ def main():
9971020 buildPythonDocs ()
9981021 fn = os .path .join (WORKDIR , "_root" , "Applications" ,
9991022 "MacPython %s" % (getVersion (),), "Update Shell Profile.command" )
1000- shutil . copy ("scripts/postflight.patch-profile" , fn )
1023+ patchFile ("scripts/postflight.patch-profile" , fn )
10011024 os .chmod (fn , 0755 )
10021025
10031026 folder = os .path .join (WORKDIR , "_root" , "Applications" , "MacPython %s" % (
0 commit comments