build system now exclude config-*, turtledemo when copying system python.
also remove __pycache__ dirs when cleaning (new in python 3.2)
This commit is contained in:
@@ -625,30 +625,35 @@ def UnixPyBundle(target=None, source=None, env=None):
|
||||
print '\t(skipping copy)\n'
|
||||
return
|
||||
|
||||
|
||||
# Copied from source/creator/CMakeLists.txt, keep in sync.
|
||||
print 'Install python from:'
|
||||
print '\t"%s" into...' % py_src
|
||||
print '\t"%s"\n' % py_target
|
||||
print '\t"%s" into...' % py_src
|
||||
print '\t"%s"\n' % py_target
|
||||
|
||||
run('rm -rf "%s"' % py_target)
|
||||
try: os.makedirs(os.path.dirname(py_target)) # the final part is copied
|
||||
except:pass
|
||||
run("rm -rf '%s'" % py_target)
|
||||
try:
|
||||
os.makedirs(os.path.dirname(py_target)) # the final part is copied
|
||||
except:
|
||||
pass
|
||||
|
||||
run('cp -R "%s" "%s"' % (py_src, os.path.dirname(py_target)))
|
||||
run('rm -rf "%s/distutils"' % py_target)
|
||||
run('rm -rf "%s/lib2to3"' % py_target)
|
||||
run('rm -rf "%s/idlelib"' % py_target)
|
||||
run('rm -rf "%s/tkinter"' % py_target)
|
||||
run('rm -rf "%s/config"' % py_target)
|
||||
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
|
||||
run("rm -rf '%s/distutils'" % py_target)
|
||||
run("rm -rf '%s/lib2to3'" % py_target)
|
||||
run("rm -rf '%s/idlelib'" % py_target)
|
||||
run("rm -rf '%s/tkinter'" % py_target)
|
||||
run("rm -rf '%s/config'" % py_target)
|
||||
|
||||
run('rm -rf "%s/site-packages"' % py_target)
|
||||
run('mkdir "%s/site-packages"' % py_target) # python needs it.'
|
||||
run("rm -rf '%s/site-packages'" % py_target)
|
||||
run("mkdir '%s/site-packages'" % py_target) # python needs it.'
|
||||
|
||||
run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target)
|
||||
run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -type d -name 'config-*' -prune -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -type d -name 'turtledemo' -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)
|
||||
|
||||
run('rm -f "%s/lib-dynload/_tkinter.so"' % py_target)
|
||||
run('find "%s" -name "test" -prune -exec rm -rf {} \;' % py_target)
|
||||
run('find "%s" -name "*.py?" -exec rm -rf {} \;' % py_target)
|
||||
run('find "%s" -name "*.so"-exec strip -s {} \;' % py_target)
|
||||
|
||||
#### END ACTION STUFF #########
|
||||
|
||||
|
@@ -23,10 +23,7 @@ This module contains utility functions specific to blender but
|
||||
not assosiated with blenders internal data.
|
||||
"""
|
||||
|
||||
from _bpy import register_class
|
||||
from _bpy import unregister_class
|
||||
|
||||
from _bpy import blend_paths
|
||||
from _bpy import register_class, unregister_class, blend_paths
|
||||
from _bpy import script_paths as _bpy_script_paths
|
||||
from _bpy import user_resource as _user_resource
|
||||
|
||||
|
@@ -218,7 +218,8 @@ if(WITH_INSTALL)
|
||||
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
|
||||
COMMENT "copying blender scripts..."
|
||||
COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/${BLENDER_VERSION}/
|
||||
COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR} -name '*.py[co]' -prune -exec rm -rf {} '\;'
|
||||
COMMAND find ${TARGETDIR} -name '__pycache__' -exec rmdir {} '+'
|
||||
)
|
||||
if(WITH_PYTHON_INSTALL)
|
||||
# Copy the systems python into the install directory
|
||||
@@ -241,9 +242,12 @@ if(WITH_INSTALL)
|
||||
COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/site-packages # python needs it.
|
||||
|
||||
COMMAND rm -f ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -type d -name 'test' -prune -exec rm -rf {} '\;'
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -type d -name 'turtledemo' -prune -exec rm -rf {} '\;'
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -type d -name 'config-*' -prune -exec rm -rf {} '\;'
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name '*.py[co]' -exec rm -rf {} '\;'
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name '__pycache__' -exec rmdir {} '+'
|
||||
COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name '*.so' -exec strip -s {} '\;'
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -489,7 +493,8 @@ if(WITH_INSTALL)
|
||||
COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION}/
|
||||
COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION}/python/
|
||||
COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION}/python/
|
||||
COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR}/blender.app -name '*.py[co]' -prune -exec rm -rf {} ';'
|
||||
COMMAND find ${TARGETDIR}/blender.app -name '__pycache__' -exec rmdir {} '+'
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -497,7 +502,7 @@ if(WITH_INSTALL)
|
||||
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
|
||||
COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR}/blender.app -name __MACOSX -prune -exec rm -rf {} "\;"
|
||||
COMMAND find ${TARGETDIR}/blender.app -name __MACOSX -prune -exec rm -rf {} "\;"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user