[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49303] trunk/blender/build_files/scons/ tools: Initial support for numpy in scons

Sergey Sharybin sergey.vfx at gmail.com
Fri Jul 27 18:01:34 CEST 2012


Revision: 49303
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49303
Author:   nazgul
Date:     2012-07-27 16:01:33 +0000 (Fri, 27 Jul 2012)
Log Message:
-----------
Initial support for numpy in scons

Assumes numpy is installed to the BF_PYTHON/site-packages/numpy directory,
could be tweaked further, but this should be enough to setup release
building environment.

Seems blender can't import numpy, but that doesn't seem to be scons issue,
the same happens here with cmake too. Would ask Campbell to help looking
into this.

Modified Paths:
--------------
    trunk/blender/build_files/scons/tools/Blender.py
    trunk/blender/build_files/scons/tools/btools.py

Modified: trunk/blender/build_files/scons/tools/Blender.py
===================================================================
--- trunk/blender/build_files/scons/tools/Blender.py	2012-07-27 15:19:57 UTC (rev 49302)
+++ trunk/blender/build_files/scons/tools/Blender.py	2012-07-27 16:01:33 UTC (rev 49303)
@@ -693,11 +693,23 @@
     run("rm -r '%s/turtle.py'" % py_target)
     run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target)
 
+    if env['WITH_BF_PYTHON_INSTALL_NUMPY']:
+        numpy_src = py_src + "/site-packages/numpy"
+        numpy_target = py_target + "/site-packages/numpy"
+
+        if os.path.exists(numpy_src):
+            print 'Install numpy from:'
+            print '\t"%s" into...' % numpy_src
+            print '\t"%s"\n' % numpy_target
+
+            run("cp -R '%s' '%s'" % (numpy_src, os.path.dirname(numpy_target)))
+        else:
+            print 'Failed to find numpy at %s, skipping copying' % numpy_src
+
     run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target)
     run("find '%s' -type d -name '__pycache__' -exec rm -rf {} ';'" % py_target)
     run("find '%s' -name '*.py[co]' -exec rm -rf {} ';'" % py_target)
     run("find '%s' -name '*.so' -exec strip -s {} ';'" % py_target)
-    
 
 #### END ACTION STUFF #########
 

Modified: trunk/blender/build_files/scons/tools/btools.py
===================================================================
--- trunk/blender/build_files/scons/tools/btools.py	2012-07-27 15:19:57 UTC (rev 49302)
+++ trunk/blender/build_files/scons/tools/btools.py	2012-07-27 16:01:33 UTC (rev 49303)
@@ -135,7 +135,7 @@
             'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC',
             'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
             'WITHOUT_BF_INSTALL',
-            'WITHOUT_BF_PYTHON_INSTALL', 'WITHOUT_BF_PYTHON_UNPACK',
+            'WITHOUT_BF_PYTHON_INSTALL', 'WITHOUT_BF_PYTHON_UNPACK', 'WITH_BF_PYTHON_INSTALL_NUMPY'
             'WITHOUT_BF_OVERWRITE_INSTALL',
             'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH',
             'WITH_GHOST_COCOA',
@@ -520,6 +520,7 @@
         (BoolVariable('BF_SPLIT_SRC', 'Split src lib into several chunks if true', False)),
         (BoolVariable('WITHOUT_BF_INSTALL', 'dont install if true', False)),
         (BoolVariable('WITHOUT_BF_PYTHON_INSTALL', 'dont install Python modules if true', False)),
+        (BoolVariable('WITH_BF_PYTHON_INSTALL_NUMPY', 'install Python mumpy module', False)),
         (BoolVariable('WITHOUT_BF_PYTHON_UNPACK', 'dont remove and unpack Python modules everytime if true', False)),
         (BoolVariable('WITHOUT_BF_OVERWRITE_INSTALL', 'dont remove existing files before breating the new install directory (set to False when making packages for others)', False)),
         (BoolVariable('BF_FANCY', 'Enable fancy output if true', True)),




More information about the Bf-blender-cvs mailing list