[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21754] branches/blender2.5/blender/config /linux2-config.py: Make linux/scons default to python 3. 1 rather then the version scons runs with.

Campbell Barton ideasman42 at gmail.com
Tue Jul 21 12:13:20 CEST 2009


Revision: 21754
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21754
Author:   campbellbarton
Date:     2009-07-21 12:13:20 +0200 (Tue, 21 Jul 2009)

Log Message:
-----------
Make linux/scons default to python 3.1 rather then the version scons runs with.
for a while py2.x will work but eventually be dropped when most OS's support it, so Id recommend upgrading.

The following instructions are only needed if you don't use python3.1 installed in the default location.
For releases users wont have to worry about this.


# in python3.1 source dir, build and install into your own dir, /opt/py31 is just an example.
./configure --prefix="/opt/py31"; make; make install

# In the scons user-config.py...
BF_PYTHON = "/opt/py31"

# ... now build ... 
# 
# Blender now needs 2 things to run. ./lib/libpython3.1.so and the python modules.

# Symlink (or copy) python modules, blender sets this path for modules on startup if it is found.
ln -s /opt/py31/lib/python3.1 ~/.blender/python

# Currently static linking is not working without hacks because of limitations in scons.
# for releases we can workaround, but for now its easier to set an environment variable.
# To start blender so it can find libpython3.1.so make this into a shell script to save yourself typing it in all the time.
export LD_LIBRARY_PATH="/opt/py31/lib/"
./blender

Modified Paths:
--------------
    branches/blender2.5/blender/config/linux2-config.py

Modified: branches/blender2.5/blender/config/linux2-config.py
===================================================================
--- branches/blender2.5/blender/config/linux2-config.py	2009-07-21 09:35:39 UTC (rev 21753)
+++ branches/blender2.5/blender/config/linux2-config.py	2009-07-21 10:13:20 UTC (rev 21754)
@@ -1,17 +1,9 @@
 LCGDIR = '../lib/linux2'
 LIBDIR = "${LCGDIR}"
 
-def py_version_string():
-	'''
-	returns py version - "2.5", "2.6" etc
-	'''
-	import platform
-	ver = platform.python_version_tuple()
-	return '%d.%d' % (int(ver[0]), int(ver[1])) # py2.5 uses strings, 2.6 ints
-
 BF_PYTHON = '/usr'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
-BF_PYTHON_VERSION = py_version_string()
+BF_PYTHON_VERSION = '3.1'
 WITH_BF_STATICPYTHON = False
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'





More information about the Bf-blender-cvs mailing list