* scons changes for mac osx intel / precompiled python 3.1
authorMatt Ebb <matt@mke3.net>
Mon, 27 Jul 2009 22:15:17 +0000 (22:15 +0000)
committerMatt Ebb <matt@mke3.net>
Mon, 27 Jul 2009 22:15:17 +0000 (22:15 +0000)
Feedback (especially on < 10.5) would be most appreciated!

config/darwin-config.py
tools/Blender.py

index 785f1cb42a2e4068e28aec8a22c40ca3f15319d0..14e6eb955ffad9f4647cd7aa47858bda2d64d15b 100644 (file)
@@ -10,8 +10,6 @@ import commands
 # IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs
 USE_SDK=True
 
-BF_PYTHON_VERSION = '2.3'
-
 cmd = 'uname -p'
 MAC_PROC=commands.getoutput(cmd) 
 cmd = 'uname -r'
@@ -32,9 +30,12 @@ LIBDIR = '${LCGDIR}'
 if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
        MAC_MIN_VERS = '10.3'
        MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
-else:
+elif MAC_CUR_VER=='10.4':
        MAC_MIN_VERS = '10.4'
        MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
+else:
+       MAC_MIN_VERS = '10.5'
+       MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
 
 
 # enable ffmpeg  support
@@ -46,24 +47,35 @@ if USE_SDK==True:
 #BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 #BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a'
 
-# python.org libs install in /library we want to use that for 2.5 
-#
-# if you want py2.5 on leopard without installing
-# change value to BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
-# BEWARE: in that case it will work only on leopard
+BF_PYTHON_VERSION = '3.1'
 
-if BF_PYTHON_VERSION=='2.3':
-       BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/'
+if BF_PYTHON_VERSION=='3.1':
+       # python 3.1 uses precompiled libraries in bf svn /lib by default
+
+       BF_PYTHON = LIBDIR + '/python'
+       BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+       # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+       BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+       BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
+       # BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System'
 else:
-       BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
-
-BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}'
-BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = ''
-BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
-BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python'
-if MAC_CUR_VER=='10.3' or  MAC_CUR_VER=='10.4':
-       BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
+       # python 2.5 etc. uses built-in framework
+
+       # python.org libs install in /library we want to use that for 2.5 
+       #
+       # if you want py2.5 on leopard without installing
+       # change value to BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
+       # BEWARE: in that case it will work only on leopard
+
+       BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/'
+
+       BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}'
+       BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
+       BF_PYTHON_LIB = ''
+       BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
+       BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python'
+       if MAC_CUR_VER=='10.3' or  MAC_CUR_VER=='10.4':
+               BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
        
 BF_QUIET = '1'
 WITH_BF_OPENMP = '0'
index 749fa55a83332b1174be67f0881f55752ef94993..73ee6bb813d9cdd77e767b3c855180a98b2a0528 100644 (file)
@@ -323,6 +323,7 @@ def AppIt(target=None, source=None, env=None):
        
        a = '%s' % (target[0])
        builddir, b = os.path.split(a)
+       libdir = env['LCGDIR'][1:]
 
        bldroot = env.Dir('.').abspath
        binary = env['BINARYKIND']
@@ -355,6 +356,10 @@ def AppIt(target=None, source=None, env=None):
        commands.getoutput(cmd) 
        cmd = 'cp %s/bin/.blender/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,builddir,binary)
        commands.getoutput(cmd) 
+       cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/python/'%(builddir,binary)
+       commands.getoutput(cmd) 
+       cmd = 'unzip -q %s/release/python.zip -d %s/%s.app/Contents/MacOS/.blender/python/'%(libdir,builddir,binary)
+       commands.getoutput(cmd) 
        cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
        commands.getoutput(cmd)
        cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)