Kaydet (Commit) c5555540 authored tarafından Ronald Oussoren's avatar Ronald Oussoren

- Change fixapplepython23.py to ensure that it will run with /usr/bin/python

  on intel macs.
- Fix some minor problems in the installer for OSX
üst 4fbb080b
...@@ -236,7 +236,7 @@ PKG_RECIPES=[ ...@@ -236,7 +236,7 @@ PKG_RECIPES=[
Mac OS X 10.3 to ensure that you can build new python extensions Mac OS X 10.3 to ensure that you can build new python extensions
using that copy of python after installing this version of using that copy of python after installing this version of
python. python.
""" """,
postflight="../Tools/fixapplepython23.py", postflight="../Tools/fixapplepython23.py",
topdir="/Library/Frameworks/Python.framework", topdir="/Library/Frameworks/Python.framework",
source="/empty-dir", source="/empty-dir",
...@@ -686,6 +686,9 @@ def patchFile(inPath, outPath): ...@@ -686,6 +686,9 @@ def patchFile(inPath, outPath):
data = data.replace('$MACOSX_DEPLOYMENT_TARGET', '10.3 or later') data = data.replace('$MACOSX_DEPLOYMENT_TARGET', '10.3 or later')
data = data.replace('$ARCHITECTURES', "i386, ppc") data = data.replace('$ARCHITECTURES', "i386, ppc")
data = data.replace('$INSTALL_SIZE', installSize()) data = data.replace('$INSTALL_SIZE', installSize())
# This one is not handy as a template variable
data = data.replace('$PYTHONFRAMEWORKINSTALLDIR', '/Library/Frameworks/Python.framework')
fp = open(outPath, 'wb') fp = open(outPath, 'wb')
fp.write(data) fp.write(data)
fp.close() fp.close()
...@@ -703,7 +706,10 @@ def patchScript(inPath, outPath): ...@@ -703,7 +706,10 @@ def patchScript(inPath, outPath):
def packageFromRecipe(targetDir, recipe): def packageFromRecipe(targetDir, recipe):
curdir = os.getcwd() curdir = os.getcwd()
try: try:
pkgname = recipe['name'] # The major version (such as 2.5) is included in the pacakge name
# because haveing two version of python installed at the same time is
# common.
pkgname = '%s-%s'%(recipe['name'], getVersion())
srcdir = recipe.get('source') srcdir = recipe.get('source')
pkgroot = recipe.get('topdir', srcdir) pkgroot = recipe.get('topdir', srcdir)
postflight = recipe.get('postflight') postflight = recipe.get('postflight')
...@@ -804,7 +810,7 @@ def makeMpkgPlist(path): ...@@ -804,7 +810,7 @@ def makeMpkgPlist(path):
IFPkgFlagComponentDirectory="Contents/Packages", IFPkgFlagComponentDirectory="Contents/Packages",
IFPkgFlagPackageList=[ IFPkgFlagPackageList=[
dict( dict(
IFPkgFlagPackageLocation='%s.pkg'%(item['name']), IFPkgFlagPackageLocation='%s-%s.pkg'%(item['name'], getVersion()),
IFPkgFlagPackageSelection='selected' IFPkgFlagPackageSelection='selected'
) )
for item in PKG_RECIPES for item in PKG_RECIPES
...@@ -812,6 +818,7 @@ def makeMpkgPlist(path): ...@@ -812,6 +818,7 @@ def makeMpkgPlist(path):
IFPkgFormatVersion=0.10000000149011612, IFPkgFormatVersion=0.10000000149011612,
IFPkgFlagBackgroundScaling="proportional", IFPkgFlagBackgroundScaling="proportional",
IFPkgFlagBackgroundAlignment="left", IFPkgFlagBackgroundAlignment="left",
IFPkgFlagAuthorizationAction="RootAuthorization",
) )
writePlist(pl, path) writePlist(pl, path)
...@@ -859,7 +866,7 @@ def buildInstaller(): ...@@ -859,7 +866,7 @@ def buildInstaller():
else: else:
patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn)) patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
shutil.copy("../../../LICENSE", os.path.join(rsrcDir, 'License.txt')) shutil.copy("../../LICENSE", os.path.join(rsrcDir, 'License.txt'))
def installSize(clear=False, _saved=[]): def installSize(clear=False, _saved=[]):
...@@ -1005,7 +1012,7 @@ def main(): ...@@ -1005,7 +1012,7 @@ def main():
patchFile('resources/ReadMe.txt', os.path.join(WORKDIR, 'installer', 'ReadMe.txt')) patchFile('resources/ReadMe.txt', os.path.join(WORKDIR, 'installer', 'ReadMe.txt'))
# Ditto for the license file. # Ditto for the license file.
shutil.copy('../../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt')) shutil.copy('../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt'))
fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w') fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')
print >> fp, "# BUILD INFO" print >> fp, "# BUILD INFO"
......
...@@ -94,9 +94,19 @@ def main(): ...@@ -94,9 +94,19 @@ def main():
else: else:
do_apply = True do_apply = True
# First check OS version # First check OS version
if sys.byteorder == 'little':
# All intel macs are fine
print "fixapplypython23: no fix is needed on MacOSX on Intel"
sys.exit(0)
if gestalt.gestalt('sysv') < 0x1030: if gestalt.gestalt('sysv') < 0x1030:
print 'fixapplepython23: no fix needed on MacOSX < 10.3' print 'fixapplepython23: no fix needed on MacOSX < 10.3'
sys.exit(0) sys.exit(0)
if gestalt.gestalt('sysv') >= 0x1040:
print 'fixapplepython23: no fix needed on MacOSX >= 10.4'
sys.exit(0)
# Test that a framework Python is indeed installed # Test that a framework Python is indeed installed
if not os.path.exists(MAKEFILE): if not os.path.exists(MAKEFILE):
print 'fixapplepython23: Python framework does not appear to be installed (?), nothing fixed' print 'fixapplepython23: Python framework does not appear to be installed (?), nothing fixed'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment