diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-27 20:01:33 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-27 20:01:33 +0400 |
commit | 990466e87eee76e9e846694c977691fb43e427d1 (patch) | |
tree | 7cdf53cee66f5a2744aaa7c2f07fb5d47e79d457 /build_files/scons/tools/Blender.py | |
parent | f1acd6ac3e78aa4b898ee310dae2814015616e5f (diff) |
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.
Diffstat (limited to 'build_files/scons/tools/Blender.py')
-rw-r--r-- | build_files/scons/tools/Blender.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 0c5d37f77fe..e07c0d6f0de 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -693,11 +693,23 @@ def UnixPyBundle(target=None, source=None, env=None): 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 ######### |