2007-05-31 07:42:54 +00:00
import os
import os . path
2006-02-04 14:15:10 +00:00
import SCons . Options
2008-10-30 23:55:07 +00:00
import SCons . Variables
2007-06-06 07:07:58 +00:00
try :
2009-12-05 00:26:20 +00:00
import subprocess
2007-06-06 07:07:58 +00:00
except ImportError :
2009-12-05 00:26:20 +00:00
pass
2007-05-31 07:42:54 +00:00
import string
2007-05-31 11:15:47 +00:00
import shutil
import sys
2006-02-04 14:15:10 +00:00
2008-10-30 23:55:07 +00:00
Variables = SCons . Variables
BoolVariable = SCons . Variables . BoolVariable
2006-02-04 14:15:10 +00:00
2014-06-26 10:03:52 +00:00
def get_command_output ( * popenargs , * * kwargs ) :
if hasattr ( subprocess , " check_output " ) :
return subprocess . check_output ( * popenargs , * * kwargs )
if ' stdout ' in kwargs :
raise ValueError ( ' stdout argument not allowed, it will be overridden. ' )
process = subprocess . Popen ( stdout = subprocess . PIPE , * popenargs , * * kwargs )
output , unused_err = process . communicate ( )
retcode = process . poll ( )
if retcode :
cmd = kwargs . get ( " args " )
if cmd is None :
cmd = popenargs [ 0 ]
2014-06-26 10:22:04 +00:00
raise subprocess . CalledProcessError ( retcode , cmd )
2014-06-26 10:03:52 +00:00
return output
2010-09-18 10:37:51 +00:00
def get_version ( ) :
2011-02-21 04:45:47 +00:00
import re
2010-09-18 10:37:51 +00:00
fname = os . path . join ( os . path . dirname ( __file__ ) , " .. " , " .. " , " .. " , " source " , " blender " , " blenkernel " , " BKE_blender.h " )
2011-02-21 04:45:47 +00:00
ver_base = None
ver_char = None
ver_cycle = None
re_ver = re . compile ( " ^# \ s*define \ s+BLENDER_VERSION \ s+([0-9]+) " )
re_ver_char = re . compile ( " ^# \ s*define \ s+BLENDER_VERSION_CHAR \ s*( \ S*) " ) # optional arg
re_ver_cycle = re . compile ( " ^# \ s*define \ s+BLENDER_VERSION_CYCLE \ s*( \ S*) " ) # optional arg
2010-09-18 10:37:51 +00:00
for l in open ( fname , " r " ) :
2011-02-21 04:45:47 +00:00
match = re_ver . match ( l )
if match :
ver = int ( match . group ( 1 ) )
ver_base = " %d . %d " % ( ver / 100 , ver % 100 )
match = re_ver_char . match ( l )
if match :
ver_char = match . group ( 1 )
if ver_char == " BLENDER_CHAR_VERSION " :
ver_char = " "
match = re_ver_cycle . match ( l )
if match :
ver_cycle = match . group ( 1 )
if ver_cycle == " BLENDER_CYCLE_VERSION " :
ver_cycle = " "
if ( ver_base is not None ) and ( ver_char is not None ) and ( ver_cycle is not None ) :
# eg '2.56a-beta'
2012-12-20 08:54:37 +00:00
if ver_cycle != " release " :
2011-02-21 04:45:47 +00:00
ver_display = " %s %s - %s " % ( ver_base , ver_char , ver_cycle )
else :
2012-12-20 08:54:37 +00:00
ver_display = " %s %s " % ( ver_base , ver_char )
2011-02-21 04:45:47 +00:00
2011-11-17 19:43:59 +00:00
return ver_base , ver_display , ver_cycle
2011-02-21 04:45:47 +00:00
2010-09-18 10:37:51 +00:00
raise Exception ( " %s : missing version string " % fname )
2013-11-19 09:01:00 +00:00
def get_hash ( ) :
2014-06-20 16:13:20 +00:00
try :
2014-06-26 10:03:52 +00:00
build_hash = get_command_output ( [ ' git ' , ' rev-parse ' , ' --short ' , ' HEAD ' ] ) . strip ( )
2014-06-23 09:46:41 +00:00
except OSError :
2014-06-20 16:13:20 +00:00
build_hash = None
print ( " WARNING: could not use git to retrieve current Blender repository hash... " )
2014-07-02 18:29:50 +00:00
except subprocess . CalledProcessError as e :
build_hash = None
print ( " WARNING: git errored while retrieving current Blender repository hash ( %d )... " % e . returncode )
2013-11-19 09:01:00 +00:00
if build_hash == ' ' or build_hash == None :
build_hash = ' UNKNOWN '
2011-03-22 10:26:53 +00:00
2013-11-19 09:01:00 +00:00
return build_hash
2011-02-21 04:45:47 +00:00
2011-09-19 08:02:17 +00:00
def checkEndian ( ) :
2014-01-31 12:20:06 +00:00
return sys . byteorder
2011-09-19 08:02:17 +00:00
2011-02-21 04:45:47 +00:00
# This is used in creating the local config directories
2011-11-17 19:43:59 +00:00
VERSION , VERSION_DISPLAY , VERSION_RELEASE_CYCLE = get_version ( )
2013-11-19 09:01:00 +00:00
HASH = get_hash ( )
2011-09-19 08:02:17 +00:00
ENDIAN = checkEndian ( )
2010-07-05 07:06:19 +00:00
2006-02-04 14:15:10 +00:00
def print_arguments ( args , bc ) :
2009-12-05 00:26:20 +00:00
if len ( args ) :
for k , v in args . iteritems ( ) :
if type ( v ) == list :
v = ' ' . join ( v )
print ' \t ' + bc . OKBLUE + k + bc . ENDC + ' = ' + bc . OKGREEN + v + bc . ENDC
else :
print ' \t ' + bc . WARNING + ' No command-line arguments given ' + bc . ENDC
2006-02-04 14:15:10 +00:00
def validate_arguments ( args , bc ) :
2009-12-05 00:26:20 +00:00
opts_list = [
2013-06-10 00:42:16 +00:00
' WITH_BF_FREESTYLE ' , ' WITH_BF_PYTHON ' , ' WITH_BF_PYTHON_SAFETY ' , ' WITH_BF_PYTHON_SECURITY ' , ' BF_PYTHON ' , ' BF_PYTHON_VERSION ' , ' BF_PYTHON_INC ' , ' BF_PYTHON_BINARY ' , ' BF_PYTHON_LIB ' , ' BF_PYTHON_LIBPATH ' , ' BF_PYTHON_LIBPATH_ARCH ' , ' WITH_BF_STATICPYTHON ' , ' WITH_OSX_STATICPYTHON ' , ' BF_PYTHON_LIB_STATIC ' , ' BF_PYTHON_DLL ' , ' BF_PYTHON_ABI_FLAGS ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_OPENAL ' , ' BF_OPENAL ' , ' BF_OPENAL_INC ' , ' BF_OPENAL_LIB ' , ' BF_OPENAL_LIBPATH ' , ' WITH_BF_STATICOPENAL ' , ' BF_OPENAL_LIB_STATIC ' ,
2014-11-17 11:35:36 +00:00
' WITH_BF_SDL ' , ' BF_SDL ' , ' BF_SDL_INC ' , ' BF_SDL_LIB ' , ' BF_SDL_LIBPATH ' , ' WITH_BF_SDL_DYNLOAD ' ,
2013-03-27 07:19:54 +00:00
' WITH_BF_JACK ' , ' BF_JACK ' , ' BF_JACK_INC ' , ' BF_JACK_LIB ' , ' BF_JACK_LIBPATH ' , ' WITH_BF_JACK_DYNLOAD ' ,
2010-10-05 16:43:01 +00:00
' WITH_BF_SNDFILE ' , ' BF_SNDFILE ' , ' BF_SNDFILE_INC ' , ' BF_SNDFILE_LIB ' , ' BF_SNDFILE_LIBPATH ' , ' WITH_BF_STATICSNDFILE ' , ' BF_SNDFILE_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' BF_PTHREADS ' , ' BF_PTHREADS_INC ' , ' BF_PTHREADS_LIB ' , ' BF_PTHREADS_LIBPATH ' ,
' WITH_BF_OPENEXR ' , ' BF_OPENEXR ' , ' BF_OPENEXR_INC ' , ' BF_OPENEXR_LIB ' , ' BF_OPENEXR_LIBPATH ' , ' WITH_BF_STATICOPENEXR ' , ' BF_OPENEXR_LIB_STATIC ' ,
2010-08-03 11:25:34 +00:00
' WITH_BF_DDS ' , ' WITH_BF_CINEON ' , ' WITH_BF_HDR ' ,
2011-08-03 10:50:21 +00:00
' WITH_BF_FFMPEG ' , ' BF_FFMPEG_LIB ' , ' BF_FFMPEG_EXTRA ' , ' BF_FFMPEG ' , ' BF_FFMPEG_INC ' , ' BF_FFMPEG_DLL ' ,
2010-08-26 08:04:58 +00:00
' WITH_BF_STATICFFMPEG ' , ' BF_FFMPEG_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_OGG ' , ' BF_OGG ' , ' BF_OGG_LIB ' ,
2012-04-14 22:19:29 +00:00
' WITH_BF_FRAMESERVER ' ,
2013-01-14 15:53:17 +00:00
' WITH_BF_COMPOSITOR ' ,
2012-10-27 13:22:36 +00:00
' WITH_BF_JPEG ' , ' BF_JPEG ' , ' BF_JPEG_INC ' , ' BF_JPEG_LIB ' , ' BF_JPEG_LIBPATH ' , ' WITH_BF_STATICJPEG ' , ' BF_JPEG_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_OPENJPEG ' , ' BF_OPENJPEG ' , ' BF_OPENJPEG_INC ' , ' BF_OPENJPEG_LIB ' , ' BF_OPENJPEG_LIBPATH ' ,
' WITH_BF_REDCODE ' , ' BF_REDCODE ' , ' BF_REDCODE_INC ' , ' BF_REDCODE_LIB ' , ' BF_REDCODE_LIBPATH ' ,
2012-10-27 13:22:36 +00:00
' WITH_BF_PNG ' , ' BF_PNG ' , ' BF_PNG_INC ' , ' BF_PNG_LIB ' , ' BF_PNG_LIBPATH ' , ' WITH_BF_STATICPNG ' , ' BF_PNG_LIB_STATIC ' ,
2010-09-21 21:10:49 +00:00
' WITH_BF_TIFF ' , ' BF_TIFF ' , ' BF_TIFF_INC ' , ' BF_TIFF_LIB ' , ' BF_TIFF_LIBPATH ' , ' WITH_BF_STATICTIFF ' , ' BF_TIFF_LIB_STATIC ' ,
' WITH_BF_ZLIB ' , ' BF_ZLIB ' , ' BF_ZLIB_INC ' , ' BF_ZLIB_LIB ' , ' BF_ZLIB_LIBPATH ' , ' WITH_BF_STATICZLIB ' , ' BF_ZLIB_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_INTERNATIONAL ' ,
' WITH_BF_ICONV ' , ' BF_ICONV ' , ' BF_ICONV_INC ' , ' BF_ICONV_LIB ' , ' BF_ICONV_LIBPATH ' ,
2011-11-03 12:24:29 +00:00
' WITH_BF_GAMEENGINE ' ,
' WITH_BF_BULLET ' , ' BF_BULLET ' , ' BF_BULLET_INC ' , ' BF_BULLET_LIB ' ,
2012-11-27 09:52:20 +00:00
# 'WITH_BF_ELTOPO', # now only available in a branch
' BF_LAPACK ' , ' BF_LAPACK_LIB ' , ' BF_LAPACK_LIBPATH ' , ' BF_LAPACK_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' BF_WINTAB ' , ' BF_WINTAB_INC ' ,
2011-10-21 03:16:01 +00:00
' BF_FREETYPE ' , ' BF_FREETYPE_INC ' , ' BF_FREETYPE_LIB ' , ' BF_FREETYPE_LIBPATH ' , ' BF_FREETYPE_LIB_STATIC ' , ' WITH_BF_FREETYPE_STATIC ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_QUICKTIME ' , ' BF_QUICKTIME ' , ' BF_QUICKTIME_INC ' , ' BF_QUICKTIME_LIB ' , ' BF_QUICKTIME_LIBPATH ' ,
2010-10-05 16:43:01 +00:00
' WITH_BF_FFTW3 ' , ' BF_FFTW3 ' , ' BF_FFTW3_INC ' , ' BF_FFTW3_LIB ' , ' BF_FFTW3_LIBPATH ' , ' WITH_BF_STATICFFTW3 ' , ' BF_FFTW3_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_STATICOPENGL ' , ' BF_OPENGL ' , ' BF_OPENGL_INC ' , ' BF_OPENGL_LIB ' , ' BF_OPENGL_LIBPATH ' , ' BF_OPENGL_LIB_STATIC ' ,
2014-10-07 20:46:19 +00:00
' WITH_BF_EGL ' , ' WITH_BF_GLEW_ES ' , ' BF_GLEW_INC ' , ' WITH_BF_GL_PROFILE_CORE ' , ' WITH_BF_GL_PROFILE_COMPAT ' , ' WITH_BF_GL_PROFILE_ES20 ' ,
2014-10-31 17:34:25 +00:00
' WITH_BF_GLEW_MX ' , ' WITH_BF_GL_EGL ' , ' WITH_BF_GL_ANGLE ' ,
2014-10-07 20:46:19 +00:00
2009-12-05 00:26:20 +00:00
' WITH_BF_COLLADA ' , ' BF_COLLADA ' , ' BF_COLLADA_INC ' , ' BF_COLLADA_LIB ' , ' BF_OPENCOLLADA ' , ' BF_OPENCOLLADA_INC ' , ' BF_OPENCOLLADA_LIB ' , ' BF_OPENCOLLADA_LIBPATH ' , ' BF_PCRE ' , ' BF_PCRE_LIB ' , ' BF_PCRE_LIBPATH ' , ' BF_EXPAT ' , ' BF_EXPAT_LIB ' , ' BF_EXPAT_LIBPATH ' ,
2012-10-27 13:22:36 +00:00
' WITH_BF_STATICOPENCOLLADA ' , ' BF_OPENCOLLADA_LIB_STATIC ' ,
2009-12-05 00:26:20 +00:00
' WITH_BF_PLAYER ' ,
' WITH_BF_NOBLENDER ' ,
' WITH_BF_BINRELOC ' ,
' WITH_BF_LZO ' , ' WITH_BF_LZMA ' ,
' LCGDIR ' ,
' BF_CXX ' , ' WITH_BF_STATICCXX ' , ' BF_CXX_LIB_STATIC ' ,
' BF_TWEAK_MODE ' , ' BF_SPLIT_SRC ' ,
' WITHOUT_BF_INSTALL ' ,
2014-03-04 19:36:50 +00:00
' WITHOUT_BF_PYTHON_INSTALL ' , ' WITHOUT_BF_PYTHON_UNPACK ' ,
' WITH_BF_PYTHON_INSTALL_NUMPY ' , ' WITH_BF_PYTHON_INSTALL_REQUESTS ' ,
2010-02-12 12:29:39 +00:00
' WITHOUT_BF_OVERWRITE_INSTALL ' ,
2012-10-27 13:22:36 +00:00
' WITH_BF_OPENMP ' , ' BF_OPENMP ' , ' BF_OPENMP_LIBPATH ' , ' WITH_BF_STATICOPENMP ' , ' BF_OPENMP_STATIC_STATIC ' ,
2011-07-12 18:39:46 +00:00
' WITH_GHOST_SDL ' ,
2012-02-17 20:51:39 +00:00
' WITH_GHOST_XDND ' ,
2013-09-04 23:43:25 +00:00
' WITH_X11_XINPUT ' ,
' WITH_X11_XF86VMODE ' ,
2011-11-03 12:24:29 +00:00
' BF_GHOST_DEBUG ' ,
2010-01-14 13:42:15 +00:00
' BF_FANCY ' , ' BF_QUIET ' , ' BF_LINE_OVERWRITE ' ,
2009-12-05 00:26:20 +00:00
' BF_X264_CONFIG ' ,
' BF_XVIDCORE_CONFIG ' ,
' WITH_BF_DOCS ' ,
' BF_NUMJOBS ' ,
' BF_MSVS ' ,
2009-12-10 00:51:13 +00:00
' WITH_BF_RAYOPTIMIZATION ' ,
2010-01-05 14:30:55 +00:00
' BF_RAYOPTIMIZATION_SSE_FLAGS ' ,
2011-10-29 23:56:07 +00:00
' WITH_BF_FLUID ' ,
' WITH_BF_BOOLEAN ' ,
2011-12-31 03:34:44 +00:00
' WITH_BF_REMESH ' ,
2011-11-13 12:17:27 +00:00
' WITH_BF_OCEANSIM ' ,
2012-04-14 21:55:38 +00:00
' WITH_BF_SMOKE ' ,
2011-05-13 12:08:34 +00:00
' WITH_BF_CXX_GUARDEDALLOC ' ,
2011-06-03 20:44:23 +00:00
' WITH_BF_JEMALLOC ' , ' WITH_BF_STATICJEMALLOC ' , ' BF_JEMALLOC ' , ' BF_JEMALLOC_INC ' , ' BF_JEMALLOC_LIBPATH ' , ' BF_JEMALLOC_LIB ' , ' BF_JEMALLOC_LIB_STATIC ' ,
2011-11-03 12:24:29 +00:00
' BUILDBOT_BRANCH ' ,
2014-12-06 23:58:17 +00:00
' WITH_BF_IME ' ,
2011-11-03 12:40:15 +00:00
' WITH_BF_3DMOUSE ' , ' WITH_BF_STATIC3DMOUSE ' , ' BF_3DMOUSE ' , ' BF_3DMOUSE_INC ' , ' BF_3DMOUSE_LIB ' , ' BF_3DMOUSE_LIBPATH ' , ' BF_3DMOUSE_LIB_STATIC ' ,
2014-01-06 20:38:51 +00:00
' WITH_BF_CYCLES ' , ' WITH_BF_CYCLES_CUDA_BINARIES ' , ' BF_CYCLES_CUDA_NVCC ' , ' BF_CYCLES_CUDA_NVCC ' , ' WITH_BF_CYCLES_CUDA_THREADED_COMPILE ' , ' BF_CYCLES_CUDA_ENV ' ,
2011-11-09 19:02:42 +00:00
' WITH_BF_OIIO ' , ' WITH_BF_STATICOIIO ' , ' BF_OIIO ' , ' BF_OIIO_INC ' , ' BF_OIIO_LIB ' , ' BF_OIIO_LIB_STATIC ' , ' BF_OIIO_LIBPATH ' ,
2012-09-15 10:03:17 +00:00
' WITH_BF_OCIO ' , ' WITH_BF_STATICOCIO ' , ' BF_OCIO ' , ' BF_OCIO_INC ' , ' BF_OCIO_LIB ' , ' BF_OCIO_LIB_STATIC ' , ' BF_OCIO_LIBPATH ' ,
2012-11-12 02:30:16 +00:00
' WITH_BF_BOOST ' , ' WITH_BF_STATICBOOST ' , ' BF_BOOST ' , ' BF_BOOST_INC ' , ' BF_BOOST_LIB ' , ' BF_BOOST_LIB_INTERNATIONAL ' , ' BF_BOOST_LIB_STATIC ' , ' BF_BOOST_LIBPATH ' ,
2014-10-01 05:59:43 +00:00
' WITH_BF_LIBMV ' , ' WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS ' ,
2012-11-15 13:11:12 +00:00
' WITH_BF_CYCLES_OSL ' , ' WITH_BF_STATICOSL ' , ' BF_OSL ' , ' BF_OSL_INC ' , ' BF_OSL_LIB ' , ' BF_OSL_LIBPATH ' , ' BF_OSL_LIB_STATIC ' , ' BF_OSL_COMPILER ' ,
' WITH_BF_LLVM ' , ' WITH_BF_STATICLLVM ' , ' BF_LLVM ' , ' BF_LLVM_LIB ' , ' BF_LLVM_LIBPATH ' , ' BF_LLVM_LIB_STATIC ' , ' BF_PROGRAM_LINKFLAGS '
2009-12-05 00:26:20 +00:00
]
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
# Have options here that scons expects to be lists
opts_list_split = [
' BF_PYTHON_LINKFLAGS ' ,
' BF_OPENGL_LINKFLAGS ' ,
2014-10-07 20:46:19 +00:00
' BF_GL_DEFINITIONS ' ,
2009-12-05 00:26:20 +00:00
' CFLAGS ' , ' CCFLAGS ' , ' CXXFLAGS ' , ' CPPFLAGS ' ,
' REL_CFLAGS ' , ' REL_CCFLAGS ' , ' REL_CXXFLAGS ' ,
' BGE_CXXFLAGS ' ,
' BF_PROFILE_CFLAGS ' , ' BF_PROFILE_CCFLAGS ' , ' BF_PROFILE_CXXFLAGS ' , ' BF_PROFILE_LINKFLAGS ' ,
' BF_DEBUG_CFLAGS ' , ' BF_DEBUG_CCFLAGS ' , ' BF_DEBUG_CXXFLAGS ' ,
' C_WARN ' , ' CC_WARN ' , ' CXX_WARN ' ,
2013-12-08 14:35:06 +00:00
' LLIBS ' , ' PLATFORM_LINKFLAGS ' , ' MACOSX_ARCHITECTURE ' , ' MACOSX_SDK ' , ' XCODE_CUR_VER ' , ' C_COMPILER_ID ' ,
2014-10-04 13:00:26 +00:00
' BF_CYCLES_CUDA_BINARIES_ARCH ' , ' BF_PROGRAM_LINKFLAGS ' , ' MACOSX_DEPLOYMENT_TARGET ' ,
2014-12-03 16:51:55 +00:00
' WITH_BF_CYCLES_DEBUG ' , ' WITH_BF_CYCLES_LOGGING '
2009-12-05 00:26:20 +00:00
]
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
arg_list = [ ' BF_DEBUG ' , ' BF_QUIET ' , ' BF_CROSS ' , ' BF_UPDATE ' ,
' BF_INSTALLDIR ' , ' BF_TOOLSET ' , ' BF_BINNAME ' ,
2010-01-14 13:42:15 +00:00
' BF_BUILDDIR ' , ' BF_FANCY ' , ' BF_QUICK ' , ' BF_PROFILE ' , ' BF_LINE_OVERWRITE ' ,
2009-12-05 00:26:20 +00:00
' BF_BSC ' , ' BF_CONFIG ' ,
' BF_PRIORITYLIST ' , ' BF_BUILDINFO ' , ' CC ' , ' CXX ' , ' BF_QUICKDEBUG ' ,
' BF_LISTDEBUG ' , ' LCGDIR ' , ' BF_X264_CONFIG ' , ' BF_XVIDCORE_CONFIG ' ,
2013-06-18 11:55:32 +00:00
' BF_UNIT_TEST ' , ' BF_BITNESS ' , ' MSVS_VERSION ' ]
2009-12-05 00:26:20 +00:00
okdict = { }
for k , v in args . iteritems ( ) :
if ( k in opts_list ) or ( k in arg_list ) :
okdict [ k ] = v
elif k in opts_list_split :
okdict [ k ] = v . split ( ) # "" have already been stripped
else :
print ' \t ' + bc . WARNING + ' Invalid argument: ' + bc . ENDC + k + ' = ' + v
return okdict
2006-02-04 14:15:10 +00:00
def print_targets ( targs , bc ) :
2009-12-05 00:26:20 +00:00
if len ( targs ) > 0 :
for t in targs :
print ' \t ' + bc . OKBLUE + t + bc . ENDC
else :
print ' \t ' + bc . WARNING + ' No targets given, using ' + bc . ENDC + bc . OKGREEN + ' default ' + bc . ENDC
2006-02-04 14:15:10 +00:00
def validate_targets ( targs , bc ) :
2009-12-05 00:26:20 +00:00
valid_list = [ ' . ' , ' blender ' , ' blenderstatic ' , ' blenderplayer ' , ' webplugin ' ,
' blendernogame ' , ' blenderstaticnogame ' , ' blenderlite ' , ' release ' ,
2013-01-10 08:01:07 +00:00
' everything ' , ' clean ' , ' install-bin ' , ' install ' , ' nsis ' , ' buildslave ' ,
' cudakernels ' ]
2009-12-05 00:26:20 +00:00
oklist = [ ]
for t in targs :
if t in valid_list :
oklist . append ( t )
else :
print ' \t ' + bc . WARNING + ' Invalid target: ' + bc . ENDC + t
return oklist
2006-02-04 14:15:10 +00:00
2013-06-15 21:20:06 +00:00
class OurSpawn :
2009-12-05 00:26:20 +00:00
def ourspawn ( self , sh , escape , cmd , args , env ) :
2013-06-15 21:20:06 +00:00
newargs = " " . join ( args [ 1 : ] )
2009-12-05 00:26:20 +00:00
cmdline = cmd + " " + newargs
startupinfo = subprocess . STARTUPINFO ( )
proc = subprocess . Popen ( cmdline , stdin = subprocess . PIPE , stdout = subprocess . PIPE ,
2013-06-15 21:20:06 +00:00
stderr = subprocess . PIPE , startupinfo = startupinfo , shell = False , env = env )
2009-12-05 00:26:20 +00:00
data , err = proc . communicate ( )
rv = proc . wait ( )
2012-01-17 10:32:17 +00:00
if err :
print ( err )
2009-12-05 00:26:20 +00:00
return rv
2006-02-04 14:15:10 +00:00
2007-05-31 07:42:54 +00:00
def SetupSpawn ( env ) :
2013-06-15 21:20:06 +00:00
buf = OurSpawn ( )
2009-12-05 00:26:20 +00:00
env [ ' SPAWN ' ] = buf . ourspawn
2006-02-04 14:15:10 +00:00
2010-05-23 21:20:13 +00:00
def read_opts ( env , cfg , args ) :
2009-12-05 00:26:20 +00:00
localopts = Variables . Variables ( cfg , args )
localopts . AddVariables (
2012-04-07 18:26:54 +00:00
( ' LCGDIR ' , ' Location of SVN lib dir ' ) ,
( ' LIBDIR ' , ' Root dir of libs ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_PYTHON ' , ' Compile with python ' , True ) ) ,
2011-03-03 12:00:35 +00:00
( BoolVariable ( ' WITH_BF_PYTHON_SAFETY ' , ' Internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency) ' , False ) ) ,
2013-06-10 00:42:16 +00:00
( BoolVariable ( ' WITH_BF_PYTHON_SECURITY ' , ' Disables execution of scripts within blend files by default ' , True ) ) ,
2011-11-03 12:24:29 +00:00
( ' BF_PYTHON ' , ' Base path for python ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_PYTHON_VERSION ' , ' Python version to use ' , ' ' ) ,
2011-11-03 12:24:29 +00:00
( ' BF_PYTHON_INC ' , ' Include path for Python headers ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_PYTHON_BINARY ' , ' Path to the Python interpreter ' , ' ' ) ,
( ' BF_PYTHON_LIB ' , ' Python library ' , ' ' ) ,
2013-05-29 18:55:02 +00:00
( ' BF_PYTHON_LIBPATH_ARCH ' , ' Additional Python library under some linux flavors (arch-dependent) ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_PYTHON_DLL ' , ' Python dll - used on Windows only ' , ' ' ) ,
( ' BF_PYTHON_LIB_STATIC ' , ' Python static libraries ' , ' ' ) ,
( ' BF_PYTHON_LIBPATH ' , ' Library path ' , ' ' ) ,
( ' BF_PYTHON_LINKFLAGS ' , ' Python link flags ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_STATICPYTHON ' , ' Staticly link to python ' , False ) ) ,
2011-08-31 14:46:27 +00:00
( BoolVariable ( ' WITH_OSX_STATICPYTHON ' , ' Staticly link to python ' , True ) ) ,
2011-03-13 09:29:47 +00:00
( ' BF_PYTHON_ABI_FLAGS ' , ' Python ABI flags (suffix in library version: m, mu, etc) ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
2011-10-29 23:56:07 +00:00
( BoolVariable ( ' WITH_BF_FLUID ' , ' Build with Fluid simulation (Elbeem) ' , True ) ) ,
( BoolVariable ( ' WITH_BF_BOOLEAN ' , ' Build with boolean modifier ' , True ) ) ,
2011-12-31 03:34:44 +00:00
( BoolVariable ( ' WITH_BF_REMESH ' , ' Build with remesh modifier ' , True ) ) ,
2011-11-13 12:17:27 +00:00
( BoolVariable ( ' WITH_BF_OCEANSIM ' , ' Build with ocean simulation ' , False ) ) ,
2012-04-14 21:55:38 +00:00
( BoolVariable ( ' WITH_BF_SMOKE ' , ' Build with smoke simulation ' , True ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_PROFILE_FLAGS ' , ' Profiling compiler flags ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_OPENAL ' , ' Use OpenAL if true ' , False ) ) ,
2011-11-03 12:24:29 +00:00
( ' BF_OPENAL ' , ' Base path for OpenAL ' , ' ' ) ,
( ' BF_OPENAL_INC ' , ' Include path for python headers ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_OPENAL_LIB ' , ' Path to OpenAL library ' , ' ' ) ,
( ' BF_OPENAL_LIB_STATIC ' , ' Path to OpenAL static library ' , ' ' ) ,
( ' BF_OPENAL_LIBPATH ' , ' Path to OpenAL library ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_STATICOPENAL ' , ' Staticly link to openal ' , False ) ) ,
( BoolVariable ( ' WITH_BF_SDL ' , ' Use SDL if true ' , False ) ) ,
( ' BF_SDL ' , ' SDL base path ' , ' ' ) ,
( ' BF_SDL_INC ' , ' SDL include path ' , ' ' ) ,
( ' BF_SDL_LIB ' , ' SDL library ' , ' ' ) ,
( ' BF_SDL_LIBPATH ' , ' SDL library path ' , ' ' ) ,
2014-11-17 11:35:36 +00:00
( BoolVariable ( ' WITH_BF_SDL_DYNLOAD ' , ' Enable runtime dynamic SDL libraries loading (works only on Linux) ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_JACK ' , ' Enable jack support if true ' , True ) ) ,
( ' BF_JACK ' , ' jack base path ' , ' ' ) ,
( ' BF_JACK_INC ' , ' jack include path ' , ' ' ) ,
( ' BF_JACK_LIB ' , ' jack library ' , ' ' ) ,
( ' BF_JACK_LIBPATH ' , ' jack library path ' , ' ' ) ,
2013-03-27 07:19:54 +00:00
( BoolVariable ( ' WITH_BF_JACK_DYNLOAD ' , ' Enable runtime dynamic Jack libraries loading (works only on Linux) ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_SNDFILE ' , ' Enable sndfile support if true ' , True ) ) ,
( ' BF_SNDFILE ' , ' sndfile base path ' , ' ' ) ,
( ' BF_SNDFILE_INC ' , ' sndfile include path ' , ' ' ) ,
( ' BF_SNDFILE_LIB ' , ' sndfile library ' , ' ' ) ,
2010-10-05 16:43:01 +00:00
( ' BF_SNDFILE_LIB_STATIC ' , ' Path to sndfile static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_SNDFILE_LIBPATH ' , ' sndfile library path ' , ' ' ) ,
2010-10-05 16:43:01 +00:00
( BoolVariable ( ' WITH_BF_STATICSNDFILE ' , ' Staticly link to sndfile ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_PTHREADS ' , ' Pthreads base path ' , ' ' ) ,
( ' BF_PTHREADS_INC ' , ' Pthreads include path ' , ' ' ) ,
( ' BF_PTHREADS_LIB ' , ' Pthreads library ' , ' ' ) ,
( ' BF_PTHREADS_LIBPATH ' , ' Pthreads library path ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_OPENEXR ' , ' Use OPENEXR if true ' , True ) ) ,
( BoolVariable ( ' WITH_BF_STATICOPENEXR ' , ' Staticly link to OpenEXR ' , False ) ) ,
( ' BF_OPENEXR ' , ' OPENEXR base path ' , ' ' ) ,
( ' BF_OPENEXR_INC ' , ' OPENEXR include path ' , ' ' ) ,
( ' BF_OPENEXR_LIB ' , ' OPENEXR library ' , ' ' ) ,
( ' BF_OPENEXR_LIBPATH ' , ' OPENEXR library path ' , ' ' ) ,
( ' BF_OPENEXR_LIB_STATIC ' , ' OPENEXR static library ' , ' ' ) ,
2010-08-03 11:25:34 +00:00
( BoolVariable ( ' WITH_BF_DDS ' , ' Support DDS image format if true ' , True ) ) ,
( BoolVariable ( ' WITH_BF_CINEON ' , ' Support CINEON and DPX image formats if true ' , True ) ) ,
( BoolVariable ( ' WITH_BF_HDR ' , ' Support HDR image formats if true ' , True ) ) ,
2013-06-15 21:20:06 +00:00
2012-04-14 22:19:29 +00:00
( BoolVariable ( ' WITH_BF_FRAMESERVER ' , ' Support export to a frameserver ' , True ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_FFMPEG ' , ' Use FFMPEG if true ' , False ) ) ,
( ' BF_FFMPEG ' , ' FFMPEG base path ' , ' ' ) ,
( ' BF_FFMPEG_LIB ' , ' FFMPEG library ' , ' ' ) ,
2011-08-03 10:50:21 +00:00
( ' BF_FFMPEG_DLL ' , ' FFMPEG dll libraries to be installed ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_FFMPEG_EXTRA ' , ' FFMPEG flags that must be preserved ' , ' ' ) ,
( ' BF_FFMPEG_INC ' , ' FFMPEG includes ' , ' ' ) ,
( ' BF_FFMPEG_LIBPATH ' , ' FFMPEG library path ' , ' ' ) ,
2010-08-26 08:04:58 +00:00
( BoolVariable ( ' WITH_BF_STATICFFMPEG ' , ' Use static FFMPEG if true ' , False ) ) ,
( ' BF_FFMPEG_LIB_STATIC ' , ' Static FFMPEG libraries ' , ' ' ) ,
2013-06-15 21:20:06 +00:00
2012-01-10 13:33:53 +00:00
( BoolVariable ( ' WITH_BF_OGG ' , ' Link OGG, THEORA, VORBIS with FFMPEG if true ' ,
2009-12-05 00:26:20 +00:00
False ) ) ,
( ' BF_OGG ' , ' OGG base path ' , ' ' ) ,
( ' BF_OGG_LIB ' , ' OGG library ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_JPEG ' , ' Use JPEG if true ' , True ) ) ,
2012-10-27 13:22:36 +00:00
( BoolVariable ( ' WITH_BF_STATICJPEG ' , ' Staticly link to JPEG ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_JPEG ' , ' JPEG base path ' , ' ' ) ,
( ' BF_JPEG_INC ' , ' JPEG include path ' , ' ' ) ,
( ' BF_JPEG_LIB ' , ' JPEG library ' , ' ' ) ,
( ' BF_JPEG_LIBPATH ' , ' JPEG library path ' , ' ' ) ,
2012-10-27 13:22:36 +00:00
( ' BF_JPEG_LIB_STATIC ' , ' JPEG static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_OPENJPEG ' , ' Use OPENJPEG if true ' , False ) ) ,
( ' BF_OPENJPEG ' , ' OPENJPEG base path ' , ' ' ) ,
( ' BF_OPENJPEG_INC ' , ' OPENJPEG include path ' , ' ' ) ,
( ' BF_OPENJPEG_LIB ' , ' OPENJPEG library ' , ' ' ) ,
( ' BF_OPENJPEG_LIBPATH ' , ' OPENJPEG library path ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_REDCODE ' , ' Use REDCODE if true ' , False ) ) ,
( ' BF_REDCODE ' , ' REDCODE base path ' , ' ' ) ,
( ' BF_REDCODE_INC ' , ' REDCODE include path ' , ' ' ) ,
( ' BF_REDCODE_LIB ' , ' REDCODE library ' , ' ' ) ,
( ' BF_REDCODE_LIBPATH ' , ' REDCODE library path ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_PNG ' , ' Use PNG if true ' , True ) ) ,
2012-10-27 13:22:36 +00:00
( BoolVariable ( ' WITH_BF_STATICPNG ' , ' Staticly link to PNG ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_PNG ' , ' PNG base path ' , ' ' ) ,
( ' BF_PNG_INC ' , ' PNG include path ' , ' ' ) ,
( ' BF_PNG_LIB ' , ' PNG library ' , ' ' ) ,
( ' BF_PNG_LIBPATH ' , ' PNG library path ' , ' ' ) ,
2012-10-27 13:22:36 +00:00
( ' BF_PNG_LIB_STATIC ' , ' PNG static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
2010-07-04 15:35:23 +00:00
( BoolVariable ( ' WITH_BF_TIFF ' , ' Use TIFF if true ' , True ) ) ,
2010-09-21 21:10:49 +00:00
( BoolVariable ( ' WITH_BF_STATICTIFF ' , ' Staticly link to TIFF ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_TIFF ' , ' TIFF base path ' , ' ' ) ,
( ' BF_TIFF_INC ' , ' TIFF include path ' , ' ' ) ,
( ' BF_TIFF_LIB ' , ' TIFF library ' , ' ' ) ,
( ' BF_TIFF_LIBPATH ' , ' TIFF library path ' , ' ' ) ,
2010-09-21 21:10:49 +00:00
( ' BF_TIFF_LIB_STATIC ' , ' TIFF static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_ZLIB ' , ' Use ZLib if true ' , True ) ) ,
2010-09-21 21:10:49 +00:00
( BoolVariable ( ' WITH_BF_STATICZLIB ' , ' Staticly link to ZLib ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_ZLIB ' , ' ZLib base path ' , ' ' ) ,
( ' BF_ZLIB_INC ' , ' ZLib include path ' , ' ' ) ,
( ' BF_ZLIB_LIB ' , ' ZLib library ' , ' ' ) ,
( ' BF_ZLIB_LIBPATH ' , ' ZLib library path ' , ' ' ) ,
2010-09-21 21:10:49 +00:00
( ' BF_ZLIB_LIB_STATIC ' , ' ZLib static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
2012-11-11 19:46:36 +00:00
( BoolVariable ( ' WITH_BF_INTERNATIONAL ' , ' Use Boost::locale if true ' , True ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_ICONV ' , ' Use iconv if true ' , True ) ) ,
( ' BF_ICONV ' , ' iconv base path ' , ' ' ) ,
( ' BF_ICONV_INC ' , ' iconv include path ' , ' ' ) ,
( ' BF_ICONV_LIB ' , ' iconv library ' , ' ' ) ,
( ' BF_ICONV_LIBPATH ' , ' iconv library path ' , ' ' ) ,
2013-06-15 21:20:06 +00:00
2013-04-07 06:44:33 +00:00
( BoolVariable ( ' WITH_BF_FREESTYLE ' , ' Compile with freestyle ' , True ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_GAMEENGINE ' , ' Build with gameengine ' , False ) ) ,
( BoolVariable ( ' WITH_BF_BULLET ' , ' Use Bullet if true ' , True ) ) ,
2012-11-27 09:52:20 +00:00
# (BoolVariable('WITH_BF_ELTOPO', 'Use Eltopo collision library if true', False)), # this is now only available in a branch
2012-08-12 00:19:55 +00:00
( ' BF_LAPACK ' , ' LAPACK base path ' , ' ' ) ,
( ' BF_LAPACK_LIB ' , ' LAPACK library ' , ' ' ) ,
( ' BF_LAPACK_LIB_STATIC ' , ' LAPACK library ' , ' ' ) ,
( ' BF_LAPACK_LIBPATH ' , ' LAPACK library path ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_STATICLAPACK ' , ' Staticly link to LAPACK ' , False ) ) ,
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
( ' BF_BULLET ' , ' Bullet base dir ' , ' ' ) ,
( ' BF_BULLET_INC ' , ' Bullet include path ' , ' ' ) ,
( ' BF_BULLET_LIB ' , ' Bullet library ' , ' ' ) ,
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
( ' BF_WINTAB ' , ' WinTab base dir ' , ' ' ) ,
( ' BF_WINTAB_INC ' , ' WinTab include dir ' , ' ' ) ,
( ' BF_CXX ' , ' c++ base path for libstdc++, only used when static linking ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_STATICCXX ' , ' static link to stdc++ ' , False ) ) ,
( ' BF_CXX_LIB_STATIC ' , ' static library path for stdc++ ' , ' ' ) ,
2010-08-26 08:04:58 +00:00
2009-12-05 00:26:20 +00:00
( ' BF_FREETYPE ' , ' Freetype base path ' , ' ' ) ,
( ' BF_FREETYPE_INC ' , ' Freetype include path ' , ' ' ) ,
( ' BF_FREETYPE_LIB ' , ' Freetype library ' , ' ' ) ,
( ' BF_FREETYPE_LIBPATH ' , ' Freetype library path ' , ' ' ) ,
2010-08-26 08:04:58 +00:00
( BoolVariable ( ' WITH_BF_FREETYPE_STATIC ' , ' Use Static Freetype if true ' , False ) ) ,
( ' BF_FREETYPE_LIB_STATIC ' , ' Static Freetype library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_OPENMP ' , ' Use OpenMP if true ' , False ) ) ,
2012-10-27 13:22:36 +00:00
( BoolVariable ( ' WITH_BF_STATICOPENMP ' , ' Staticly link to OpenMP ' , False ) ) ,
2010-02-01 18:39:41 +00:00
( ' BF_OPENMP ' , ' Base path to OpenMP (used when cross-compiling with older versions of WinGW) ' , ' ' ) ,
( ' BF_OPENMP_INC ' , ' Path to OpenMP includes (used when cross-compiling with older versions of WinGW) ' , ' ' ) ,
( ' BF_OPENMP_LIBPATH ' , ' Path to OpenMP libraries (used when cross-compiling with older versions of WinGW) ' , ' ' ) ,
2011-07-12 18:39:46 +00:00
( BoolVariable ( ' WITH_GHOST_SDL ' , ' Enable building blender against SDL for windowing rather then the native APIs ' , False ) ) ,
2013-09-04 23:43:25 +00:00
( BoolVariable ( ' WITH_X11_XINPUT ' , ' Enable X11 Xinput (tablet support and unicode input) ' , True ) ) ,
( BoolVariable ( ' WITH_X11_XF86VMODE ' , ' Enable X11 video mode switching ' , True ) ) ,
2012-10-27 13:22:36 +00:00
( ' BF_OPENMP_LIB_STATIC ' , ' OpenMP static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_QUICKTIME ' , ' Use QuickTime if true ' , False ) ) ,
( ' BF_QUICKTIME ' , ' QuickTime base path ' , ' ' ) ,
( ' BF_QUICKTIME_INC ' , ' QuickTime include path ' , ' ' ) ,
( ' BF_QUICKTIME_LIB ' , ' QuickTime library ' , ' ' ) ,
( ' BF_QUICKTIME_LIBPATH ' , ' QuickTime library path ' , ' ' ) ,
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_FFTW3 ' , ' Use FFTW3 if true ' , False ) ) ,
( ' BF_FFTW3 ' , ' FFTW3 base path ' , ' ' ) ,
( ' BF_FFTW3_INC ' , ' FFTW3 include path ' , ' ' ) ,
( ' BF_FFTW3_LIB ' , ' FFTW3 library ' , ' ' ) ,
2010-10-05 16:43:01 +00:00
( ' BF_FFTW3_LIB_STATIC ' , ' FFTW3 static libraries ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( ' BF_FFTW3_LIBPATH ' , ' FFTW3 library path ' , ' ' ) ,
2010-10-05 16:43:01 +00:00
( BoolVariable ( ' WITH_BF_STATICFFTW3 ' , ' Staticly link to FFTW3 ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_STATICOPENGL ' , ' Use MESA if true ' , True ) ) ,
( ' BF_OPENGL ' , ' OpenGL base path ' , ' ' ) ,
( ' BF_OPENGL_INC ' , ' OpenGL include path ' , ' ' ) ,
( ' BF_OPENGL_LIB ' , ' OpenGL libraries ' , ' ' ) ,
( ' BF_OPENGL_LIBPATH ' , ' OpenGL library path ' , ' ' ) ,
( ' BF_OPENGL_LIB_STATIC ' , ' OpenGL static libraries ' , ' ' ) ,
( ' BF_OPENGL_LINKFLAGS ' , ' OpenGL link flags ' , ' ' ) ,
2014-10-31 17:12:21 +00:00
( BoolVariable ( ' WITH_BF_GLEW_MX ' , ' ' , False ) ) ,
2014-10-07 20:46:19 +00:00
( BoolVariable ( ' WITH_BF_GLEW_ES ' , ' ' , False ) ) ,
( BoolVariable ( ' WITH_BF_GL_EGL ' , ' ' , False ) ) ,
( BoolVariable ( ' WITH_BF_GL_PROFILE_COMPAT ' , ' ' , True ) ) ,
( BoolVariable ( ' WITH_BF_GL_PROFILE_CORE ' , ' ' , False ) ) ,
( BoolVariable ( ' WITH_BF_GL_PROFILE_ES20 ' , ' ' , False ) ) ,
( BoolVariable ( ' WITH_BF_GL_ANGLE ' , ' ' , False ) ) ,
( ' BF_GL_DEFINITIONS ' , ' ' , [ ] ) ,
( ' BF_GLEW_INC ' , ' ' , ' ' ) ,
) # end of opts.AddVariables()
localopts . AddVariables (
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_COLLADA ' , ' Build COLLADA import/export module if true ' , False ) ) ,
2012-10-27 13:22:36 +00:00
( BoolVariable ( ' WITH_BF_STATICOPENCOLLADA ' , ' Staticly link to OpenCollada ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_COLLADA ' , ' COLLADA base path ' , ' ' ) ,
( ' BF_COLLADA_INC ' , ' COLLADA include path ' , ' ' ) ,
( ' BF_COLLADA_LIB ' , ' COLLADA library ' , ' ' ) ,
( ' BF_OPENCOLLADA ' , ' OpenCollada base path ' , ' ' ) ,
( ' BF_OPENCOLLADA_INC ' , ' OpenCollada base include path ' , ' ' ) ,
( ' BF_OPENCOLLADA_LIB ' , ' OpenCollada library ' , ' ' ) ,
( ' BF_OPENCOLLADA_LIBPATH ' , ' OpenCollada library path ' , ' ' ) ,
( ' BF_PCRE ' , ' PCRE base path ' , ' ' ) ,
( ' BF_PCRE_LIB ' , ' PCRE library ' , ' ' ) ,
( ' BF_PCRE_LIBPATH ' , ' PCRE library path ' , ' ' ) ,
( ' BF_EXPAT ' , ' Expat base path ' , ' ' ) ,
( ' BF_EXPAT_LIB ' , ' Expat library ' , ' ' ) ,
( ' BF_EXPAT_LIBPATH ' , ' Expat library path ' , ' ' ) ,
2012-10-27 13:22:36 +00:00
( ' BF_OPENCOLLADA_LIB_STATIC ' , ' OpenCollada static library ' , ' ' ) ,
2013-06-15 21:20:06 +00:00
2011-05-13 12:08:34 +00:00
( BoolVariable ( ' WITH_BF_JEMALLOC ' , ' Use jemalloc if true ' , False ) ) ,
( BoolVariable ( ' WITH_BF_STATICJEMALLOC ' , ' Staticly link to jemalloc ' , False ) ) ,
( ' BF_JEMALLOC ' , ' jemalloc base path ' , ' ' ) ,
( ' BF_JEMALLOC_INC ' , ' jemalloc include path ' , ' ' ) ,
( ' BF_JEMALLOC_LIB ' , ' jemalloc library ' , ' ' ) ,
( ' BF_JEMALLOC_LIBPATH ' , ' jemalloc library path ' , ' ' ) ,
( ' BF_JEMALLOC_LIB_STATIC ' , ' jemalloc static library ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_PLAYER ' , ' Build blenderplayer if true ' , False ) ) ,
( BoolVariable ( ' WITH_BF_NOBLENDER ' , ' Do not build blender if true ' , False ) ) ,
2014-12-06 23:58:17 +00:00
( BoolVariable ( ' WITH_BF_IME ' , ' Enable Input Method Editor (IME) for complex Asian character input ' , False ) ) ,
2011-08-02 07:02:40 +00:00
( BoolVariable ( ' WITH_BF_3DMOUSE ' , ' Build blender with support of 3D mouses ' , False ) ) ,
2011-08-02 17:59:43 +00:00
( BoolVariable ( ' WITH_BF_STATIC3DMOUSE ' , ' Staticly link to 3d mouse library ' , False ) ) ,
( ' BF_3DMOUSE ' , ' 3d mouse library base path ' , ' ' ) ,
( ' BF_3DMOUSE_INC ' , ' 3d mouse library include path ' , ' ' ) ,
( ' BF_3DMOUSE_LIB ' , ' 3d mouse library ' , ' ' ) ,
( ' BF_3DMOUSE_LIBPATH ' , ' 3d mouse library path ' , ' ' ) ,
( ' BF_3DMOUSE_LIB_STATIC ' , ' 3d mouse static library ' , ' ' ) ,
2011-08-02 07:02:40 +00:00
2010-10-19 05:21:28 +00:00
( ' CFLAGS ' , ' C only flags ' , [ ] ) ,
( ' CCFLAGS ' , ' Generic C and C++ flags ' , [ ] ) ,
( ' CXXFLAGS ' , ' C++ only flags ' , [ ] ) ,
( ' BGE_CXXFLAGS ' , ' C++ only flags for BGE ' , [ ] ) ,
( ' CPPFLAGS ' , ' Defines ' , [ ] ) ,
( ' REL_CFLAGS ' , ' C only release flags ' , [ ] ) ,
( ' REL_CCFLAGS ' , ' Generic C and C++ release flags ' , [ ] ) ,
( ' REL_CXXFLAGS ' , ' C++ only release flags ' , [ ] ) ,
( ' C_WARN ' , ' C warning flags ' , [ ] ) ,
( ' CC_WARN ' , ' Generic C and C++ warning flags ' , [ ] ) ,
( ' CXX_WARN ' , ' C++ only warning flags ' , [ ] ) ,
( ' LLIBS ' , ' Platform libs ' , [ ] ) ,
( ' PLATFORM_LINKFLAGS ' , ' Platform linkflags ' , [ ] ) ,
2009-12-05 00:26:20 +00:00
( ' MACOSX_ARCHITECTURE ' , ' python_arch.zip select ' , ' ' ) ,
2013-11-06 20:59:04 +00:00
( ' MACOSX_SDK ' , ' Set OS X SDK ' , ' ' ) ,
2012-11-17 23:00:04 +00:00
( ' XCODE_CUR_VER ' , ' Detect XCode version ' , ' ' ) ,
( ' MACOSX_DEPLOYMENT_TARGET ' , ' Detect OS X target version ' , ' ' ) ,
2013-12-08 14:35:06 +00:00
( ' C_COMPILER_ID ' , ' Detect the resolved compiler ' , ' ' ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' BF_PROFILE ' , ' Add profiling information if true ' , False ) ) ,
2010-10-19 05:21:28 +00:00
( ' BF_PROFILE_CFLAGS ' , ' C only profiling flags ' , [ ] ) ,
( ' BF_PROFILE_CCFLAGS ' , ' C and C++ profiling flags ' , [ ] ) ,
( ' BF_PROFILE_CXXFLAGS ' , ' C++ only profiling flags ' , [ ] ) ,
( ' BF_PROFILE_LINKFLAGS ' , ' Profile linkflags ' , [ ] ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' BF_DEBUG ' , ' Add debug flags if true ' , False ) ) ,
2010-10-19 05:21:28 +00:00
( ' BF_DEBUG_CFLAGS ' , ' C only debug flags ' , [ ] ) ,
( ' BF_DEBUG_CCFLAGS ' , ' C and C++ debug flags ' , [ ] ) ,
( ' BF_DEBUG_CXXFLAGS ' , ' C++ only debug flags ' , [ ] ) ,
2009-12-05 00:26:20 +00:00
2010-10-05 13:39:45 +00:00
( BoolVariable ( ' BF_BSC ' , ' Create .bsc files (msvc only) ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( ' BF_BUILDDIR ' , ' Build dir ' , ' ' ) ,
( ' BF_INSTALLDIR ' , ' Installation dir ' , ' ' ) ,
2010-05-23 21:20:13 +00:00
( ' CC ' , ' C compiler to use ' , env [ ' CC ' ] ) ,
( ' CXX ' , ' C++ compiler to use ' , env [ ' CXX ' ] ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' BF_BUILDINFO ' , ' Buildtime in splash if true ' , True ) ) ,
( BoolVariable ( ' BF_TWEAK_MODE ' , ' Enable tweak mode if true ' , False ) ) ,
( 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 ) ) ,
2014-03-04 19:36:50 +00:00
( BoolVariable ( ' WITH_BF_PYTHON_INSTALL_NUMPY ' , ' install Python numpy module ' , False ) ) ,
( BoolVariable ( ' WITH_BF_PYTHON_INSTALL_REQUESTS ' , ' install Python requests module ' , False ) ) ,
2012-05-23 03:49:42 +00:00
( BoolVariable ( ' WITHOUT_BF_PYTHON_UNPACK ' , ' dont remove and unpack Python modules everytime if true ' , False ) ) ,
2010-02-13 10:55:04 +00:00
( BoolVariable ( ' WITHOUT_BF_OVERWRITE_INSTALL ' , ' dont remove existing files before breating the new install directory (set to False when making packages for others) ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' BF_FANCY ' , ' Enable fancy output if true ' , True ) ) ,
( BoolVariable ( ' BF_QUIET ' , ' Enable silent output if true ' , True ) ) ,
2010-01-14 13:42:15 +00:00
( BoolVariable ( ' BF_LINE_OVERWRITE ' , ' Enable overwriting of compile line in BF_QUIET mode if true ' , False ) ) ,
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_BINRELOC ' , ' Enable relocatable binary (linux only) ' , False ) ) ,
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' WITH_BF_LZO ' , ' Enable fast LZO pointcache compression ' , True ) ) ,
( BoolVariable ( ' WITH_BF_LZMA ' , ' Enable best LZMA pointcache compression ' , True ) ) ,
2013-06-15 21:20:06 +00:00
2011-11-07 12:55:18 +00:00
( BoolVariable ( ' WITH_BF_LIBMV ' , ' Enable libmv structure from motion library ' , True ) ) ,
2014-10-02 14:51:58 +00:00
( BoolVariable ( ' WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS ' , ' Enable fixed-size schur specializations ' , True ) ) ,
2013-06-15 21:20:06 +00:00
2012-06-30 22:44:36 +00:00
( BoolVariable ( ' WITH_BF_COMPOSITOR ' , ' Enable the tile based nodal compositor ' , True ) ) ,
2012-10-27 13:22:36 +00:00
) # end of opts.AddOptions()
2011-11-07 12:55:18 +00:00
2012-10-27 13:22:36 +00:00
localopts . AddVariables (
2009-12-05 00:26:20 +00:00
( ' BF_X264_CONFIG ' , ' configuration flags for x264 ' , ' ' ) ,
( ' BF_XVIDCORE_CONFIG ' , ' configuration flags for xvidcore ' , ' ' ) ,
2010-08-02 16:27:41 +00:00
# (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
( ' BF_CONFIG ' , ' SCons python config file used to set default options ' , ' user_config.py ' ) ,
( ' BF_NUMJOBS ' , ' Number of build processes to spawn ' , ' 1 ' ) ,
( ' BF_MSVS ' , ' Generate MSVS project files and solution ' , False ) ,
2010-08-02 16:27:41 +00:00
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' BF_UNIT_TEST ' , ' Build with unit test support. ' , False ) ) ,
2013-06-15 21:20:06 +00:00
2009-12-05 00:26:20 +00:00
( BoolVariable ( ' BF_GHOST_DEBUG ' , ' Make GHOST print events and info to stdout. (very verbose) ' , False ) ) ,
2013-06-15 21:20:06 +00:00
2009-12-10 00:51:13 +00:00
( BoolVariable ( ' WITH_BF_RAYOPTIMIZATION ' , ' Enable raytracer SSE/SIMD optimization. ' , False ) ) ,
2010-07-06 09:13:10 +00:00
( ' BF_RAYOPTIMIZATION_SSE_FLAGS ' , ' SSE flags ' , ' ' ) ,
2011-06-03 20:44:23 +00:00
( BoolVariable ( ' WITH_BF_CXX_GUARDEDALLOC ' , ' Enable GuardedAlloc for C++ memory allocation tracking. ' , False ) ) ,
( ' BUILDBOT_BRANCH ' , ' Buildbot branch name ' , ' ' ) ,
2011-11-09 19:02:42 +00:00
2011-11-08 20:40:02 +00:00
( BoolVariable ( ' WITH_BF_CYCLES ' , ' Build with the Cycles engine ' , True ) ) ,
2011-12-01 16:33:21 +00:00
( BoolVariable ( ' WITH_BF_CYCLES_CUDA_BINARIES ' , ' Build with precompiled CUDA binaries ' , False ) ) ,
2011-12-06 16:00:57 +00:00
( BoolVariable ( ' WITH_BF_CYCLES_CUDA_THREADED_COMPILE ' , ' Build several render kernels at once (using BF_NUMJOBS) ' , False ) ) ,
2011-12-01 16:33:21 +00:00
( ' BF_CYCLES_CUDA_NVCC ' , ' CUDA nvcc compiler path ' , ' ' ) ,
2013-12-29 13:42:02 +00:00
( ' BF_CYCLES_CUDA_ENV ' , ' preset environement nvcc will execute in ' , ' ' ) ,
2011-12-01 16:33:21 +00:00
( ' BF_CYCLES_CUDA_BINARIES_ARCH ' , ' CUDA architectures to compile binaries for ' , [ ] ) ,
2014-10-04 13:00:26 +00:00
( BoolVariable ( ' WITH_BF_CYCLES_DEBUG ' , ' Build Cycles engine with extra debugging capabilities ' , False ) ) ,
2014-12-03 17:45:12 +00:00
( BoolVariable ( ' WITH_BF_CYCLES_LOGGING ' , ' Build Cycles engine with logging support ' , True ) ) ,
2011-11-09 19:02:42 +00:00
2011-11-03 12:40:15 +00:00
( BoolVariable ( ' WITH_BF_OIIO ' , ' Build with OpenImageIO ' , False ) ) ,
2013-10-11 16:38:31 +00:00
( BoolVariable ( ' WITH_BF_STATICOIIO ' , ' Statically link to OpenImageIO ' , False ) ) ,
2011-11-09 17:22:55 +00:00
( ' BF_OIIO ' , ' OIIO root path ' , ' ' ) ,
2011-11-03 12:40:15 +00:00
( ' BF_OIIO_INC ' , ' OIIO include path ' , ' ' ) ,
( ' BF_OIIO_LIB ' , ' OIIO library ' , ' ' ) ,
( ' BF_OIIO_LIBPATH ' , ' OIIO library path ' , ' ' ) ,
2011-11-09 19:02:42 +00:00
( ' BF_OIIO_LIB_STATIC ' , ' OIIO static library ' , ' ' ) ,
2012-09-15 10:03:17 +00:00
( BoolVariable ( ' WITH_BF_OCIO ' , ' Build with OpenColorIO ' , False ) ) ,
( BoolVariable ( ' WITH_BF_STATICOCIO ' , ' Staticly link to OpenColorIO ' , False ) ) ,
( ' BF_OCIO ' , ' OCIO root path ' , ' ' ) ,
( ' BF_OCIO_INC ' , ' OCIO include path ' , ' ' ) ,
( ' BF_OCIO_LIB ' , ' OCIO library ' , ' ' ) ,
( ' BF_OCIO_LIBPATH ' , ' OCIO library path ' , ' ' ) ,
( ' BF_OCIO_LIB_STATIC ' , ' OCIO static library ' , ' ' ) ,
2011-11-03 12:40:15 +00:00
( BoolVariable ( ' WITH_BF_BOOST ' , ' Build with Boost ' , False ) ) ,
2011-11-09 19:02:42 +00:00
( BoolVariable ( ' WITH_BF_STATICBOOST ' , ' Staticly link to boost ' , False ) ) ,
2011-11-09 17:22:55 +00:00
( ' BF_BOOST ' , ' Boost root path ' , ' ' ) ,
2011-11-03 12:40:15 +00:00
( ' BF_BOOST_INC ' , ' Boost include path ' , ' ' ) ,
( ' BF_BOOST_LIB ' , ' Boost library ' , ' ' ) ,
2012-11-12 09:31:10 +00:00
( ' BF_BOOST_LIB_INTERNATIONAL ' , ' Boost library ' , ' ' ) ,
2011-11-09 19:02:42 +00:00
( ' BF_BOOST_LIBPATH ' , ' Boost library path ' , ' ' ) ,
2012-02-17 20:51:39 +00:00
( ' BF_BOOST_LIB_STATIC ' , ' Boost static library ' , ' ' ) ,
2012-08-20 20:13:37 +00:00
( BoolVariable ( ' WITH_GHOST_XDND ' , ' Build with drag-n-drop support on Linux platforms using XDND protocol ' , True ) ) ,
2012-11-15 13:11:12 +00:00
( BoolVariable ( ' WITH_BF_CYCLES_OSL ' , ' Build with OSL sypport in Cycles ' , False ) ) ,
( BoolVariable ( ' WITH_BF_STATICOSL ' , ' Staticly link to OSL ' , False ) ) ,
( ' BF_OSL ' , ' OSL root path ' , ' ' ) ,
( ' BF_OSL_INC ' , ' OSL include path ' , ' ' ) ,
( ' BF_OSL_LIB ' , ' OSL library ' , ' ' ) ,
( ' BF_OSL_LIBPATH ' , ' OSL library path ' , ' ' ) ,
( ' BF_OSL_LIB_STATIC ' , ' OSL static library ' , ' ' ) ,
( ' BF_OSL_COMPILER ' , ' OSL compiler ' , ' ' ) ,
( BoolVariable ( ' WITH_BF_LLVM ' , ' Build with LLVM sypport (required for OSL) ' , False ) ) ,
( BoolVariable ( ' WITH_BF_STATICLLVM ' , ' Staticly link to LLVM ' , False ) ) ,
( ' BF_LLVM ' , ' LLVM root path ' , ' ' ) ,
( ' BF_LLVM_LIB ' , ' LLVM library ' , ' ' ) ,
( ' BF_LLVM_LIBPATH ' , ' LLVM library path ' , ' ' ) ,
( ' BF_LLVM_LIB_STATIC ' , ' LLVM static library ' , ' ' ) ,
( ' BF_PROGRAM_LINKFLAGS ' , ' Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna) ' , ' ' )
2009-12-05 00:26:20 +00:00
) # end of opts.AddOptions()
return localopts
2006-02-04 14:15:10 +00:00
2011-03-22 10:26:53 +00:00
def buildbot_zip ( src , dest , package_name , extension ) :
import zipfile
ln = len ( src ) + 1 # one extra to remove leading os.sep when cleaning root for package_root
flist = list ( )
# create list of tuples containing file and archive name
for root , dirs , files in os . walk ( src ) :
package_root = os . path . join ( package_name , root [ ln : ] )
flist . extend ( [ ( os . path . join ( root , file ) , os . path . join ( package_root , file ) ) for file in files ] )
if extension == ' .zip ' :
package = zipfile . ZipFile ( dest , ' w ' , zipfile . ZIP_DEFLATED )
package . comment = package_name + ' is a zip-file containing the Blender software. Visit http://www.blender.org for more information. '
for entry in flist :
package . write ( entry [ 0 ] , entry [ 1 ] )
package . close ( )
else :
import tarfile
package = tarfile . open ( dest , ' w:bz2 ' )
for entry in flist :
package . add ( entry [ 0 ] , entry [ 1 ] , recursive = False )
package . close ( )
bb_zip_name = os . path . normpath ( src + os . sep + ' .. ' + os . sep + ' buildbot_upload.zip ' )
print ( " creating %s " % ( bb_zip_name ) )
bb_zip = zipfile . ZipFile ( bb_zip_name , ' w ' , zipfile . ZIP_DEFLATED )
print ( " writing %s to %s " % ( dest , bb_zip_name ) )
bb_zip . write ( dest , os . path . split ( dest ) [ 1 ] )
bb_zip . close ( )
2011-04-02 21:11:22 +00:00
print ( " removing unneeded packed file %s (to keep install directory clean) " % ( dest ) )
os . remove ( dest )
2011-03-22 10:26:53 +00:00
print ( " done. " )
def buildslave_print ( target , source , env ) :
return " Running buildslave target "
def buildslave ( target = None , source = None , env = None ) :
"""
Builder for buildbot integration . Used by buildslaves of http : / / builder . blender . org only .
"""
2012-04-24 12:57:58 +00:00
if env [ ' OURPLATFORM ' ] in ( ' win32-vc ' , ' win64-vc ' , ' win32-mingw ' , ' darwin ' , ' win64-mingw ' ) :
2011-03-22 10:26:53 +00:00
extension = ' .zip '
else :
extension = ' .tar.bz2 '
2012-04-28 08:45:55 +00:00
if env [ ' OURPLATFORM ' ] == ' win32-mingw ' :
platform = ' mingw32 '
2012-04-28 08:47:37 +00:00
elif env [ ' OURPLATFORM ' ] == ' win64-mingw ' :
2012-04-28 08:45:55 +00:00
platform = ' mingw64 '
else :
platform = env [ ' OURPLATFORM ' ] . split ( ' - ' ) [ 0 ]
2011-08-21 13:31:46 +00:00
if platform == ' linux ' :
2011-04-01 21:22:19 +00:00
import platform
2013-06-24 05:55:05 +00:00
if " glibc27 " in env [ ' BF_INSTALLDIR ' ] :
glibc = " glibc27 "
elif " glibc211 " in env [ ' BF_INSTALLDIR ' ] :
glibc = " glibc211 "
2012-10-29 16:07:16 +00:00
2011-04-01 21:22:19 +00:00
bitness = platform . architecture ( ) [ 0 ]
if bitness == ' 64bit ' :
2012-10-29 16:07:16 +00:00
platform = ' linux- ' + glibc + ' -x86_64 '
2011-04-01 21:22:19 +00:00
elif bitness == ' 32bit ' :
2012-10-29 16:07:16 +00:00
platform = ' linux- ' + glibc + ' -i686 '
2011-06-03 20:44:23 +00:00
if platform == ' darwin ' :
2012-11-17 23:00:04 +00:00
platform = ' OSX- ' + env [ ' MACOSX_DEPLOYMENT_TARGET ' ] + ' - ' + env [ ' MACOSX_ARCHITECTURE ' ]
2011-06-03 20:44:23 +00:00
2013-06-18 11:55:32 +00:00
2011-06-03 20:44:23 +00:00
branch = env [ ' BUILDBOT_BRANCH ' ]
2011-04-01 21:22:19 +00:00
2011-03-22 10:26:53 +00:00
outdir = os . path . abspath ( env [ ' BF_INSTALLDIR ' ] )
2013-11-19 09:01:00 +00:00
package_name = ' blender- ' + VERSION + ' - ' + HASH + ' - ' + platform
2011-06-03 20:44:23 +00:00
if branch != ' ' :
package_name = branch + ' - ' + package_name
2011-03-22 10:26:53 +00:00
package_dir = os . path . normpath ( outdir + os . sep + ' .. ' + os . sep + package_name )
package_archive = os . path . normpath ( outdir + os . sep + ' .. ' + os . sep + package_name + extension )
try :
if os . path . exists ( package_archive ) :
os . remove ( package_archive )
if os . path . exists ( package_dir ) :
shutil . rmtree ( package_dir )
except Exception , ex :
sys . stderr . write ( ' Failed to clean up old package files: ' + str ( ex ) + ' \n ' )
return 1
buildbot_zip ( outdir , package_archive , package_name , extension )
return 0
2007-05-31 11:15:47 +00:00
def NSIS_print ( target , source , env ) :
2010-07-06 09:13:10 +00:00
return " Creating NSIS installer for Blender "
2007-05-31 11:15:47 +00:00
def NSIS_Installer ( target = None , source = None , env = None ) :
2010-07-06 09:13:10 +00:00
print " = " * 35
2007-05-31 11:15:47 +00:00
2012-04-24 12:57:58 +00:00
if env [ ' OURPLATFORM ' ] not in ( ' win32-vc ' , ' win32-mingw ' , ' win64-vc ' , ' win64-mingw ' ) :
2009-12-05 00:26:20 +00:00
print " NSIS installer is only available on Windows. "
2013-06-15 21:20:06 +00:00
exit ( )
2012-04-25 11:15:55 +00:00
if env [ ' OURPLATFORM ' ] in ( ' win32-vc ' , ' win32-mingw ' ) :
2010-07-06 09:19:52 +00:00
bitness = ' 32 '
2012-04-25 11:15:55 +00:00
elif env [ ' OURPLATFORM ' ] in ( ' win64-vc ' , ' win64-mingw ' ) :
2010-07-06 09:19:52 +00:00
bitness = ' 64 '
2010-07-06 09:13:10 +00:00
2009-12-05 00:26:20 +00:00
start_dir = os . getcwd ( )
2010-07-05 19:59:27 +00:00
rel_dir = os . path . join ( start_dir , ' release ' , ' windows ' , ' installer ' )
install_base_dir = start_dir + os . sep
bf_installdir = os . path . join ( os . getcwd ( ) , env [ ' BF_INSTALLDIR ' ] )
bf_installdir = os . path . normpath ( bf_installdir )
doneroot = False
rootdirconts = [ ]
datafiles = ' '
2011-06-01 13:13:55 +00:00
deldatafiles = ' '
deldatadirs = ' '
2010-07-05 19:59:27 +00:00
l = len ( bf_installdir )
2013-06-15 21:20:06 +00:00
2010-07-05 19:59:27 +00:00
for dp , dn , df in os . walk ( bf_installdir ) :
2011-06-01 13:13:55 +00:00
# install
2010-07-05 19:59:27 +00:00
if not doneroot :
for f in df :
rootdirconts . append ( os . path . join ( dp , f ) )
doneroot = True
else :
2010-07-06 09:13:10 +00:00
if len ( df ) > 0 :
Windows installer and Path changes, fixing various issues:
* Windows installer not working for non-admin users and multiple users
* Addon scripts not installing next to user configuration
* Portable install not being taken into account in all places
The main problem was the windows installer was installing system scripts in
AppData next to the user configuration directory, which is not shared between
users. Now these are installed in ProgramFiles, and only addon scripts added
by the users go to AppData.
On all platforms, addon scripts were sometimes getting installed between
system scripts, because the scripts folder in the executable directory was
given precedence over the user configuration folder, that is no longer done
now. So addons now behave like user configuration, they are preserved even
if you download a newer build of the same blender version.
If you have an installation of 2.57 on windows, the addon install location
will not change until we do the version bump to 2.58, to avoid conflicts with
the existing the installed 2.57 version.
The old behavior of giving precedence to the local folder was done to support
portable install, where all configuration is written to the local folder. This
is now implemented differently: if and only if a "config" folder exists in the
local folder, portable install will be assumed, and files will only be written
to that local folder.
2011-05-27 09:57:53 +00:00
datafiles + = " \n " + r ' SetOutPath $INSTDIR ' + dp [ l : ] + " \n \n "
2010-07-06 09:13:10 +00:00
for f in df :
outfile = os . path . join ( dp , f )
datafiles + = ' File ' + outfile + " \n "
2009-12-05 00:26:20 +00:00
2011-06-01 13:13:55 +00:00
# uninstall
deldir = dp [ l + 1 : ]
if len ( deldir ) > 0 :
deldatadirs = " RMDir $INSTDIR \\ " + deldir + " \n " + deldatadirs
deldatadirs = " RMDir /r $INSTDIR \\ " + deldir + " \\ __pycache__ \n " + deldatadirs
for f in df :
deldatafiles + = ' Delete \" $INSTDIR \\ ' + os . path . join ( deldir , f ) + " \" \n "
2009-12-05 00:26:20 +00:00
#### change to suit install dir ####
inst_dir = install_base_dir + env [ ' BF_INSTALLDIR ' ]
2013-06-15 21:20:06 +00:00
2011-03-29 12:10:41 +00:00
os . chdir ( rel_dir )
2009-12-05 00:26:20 +00:00
ns = open ( " 00.sconsblender.nsi " , " r " )
ns_cnt = str ( ns . read ( ) )
ns . close ( )
2010-07-05 19:59:27 +00:00
# var replacements
2010-07-06 09:13:10 +00:00
ns_cnt = string . replace ( ns_cnt , " [DISTDIR] " , os . path . normpath ( inst_dir + os . sep ) )
2011-02-21 04:45:47 +00:00
ns_cnt = string . replace ( ns_cnt , " [VERSION] " , VERSION_DISPLAY )
2010-07-06 09:13:10 +00:00
ns_cnt = string . replace ( ns_cnt , " [SHORTVERSION] " , VERSION )
2010-07-05 19:59:27 +00:00
ns_cnt = string . replace ( ns_cnt , " [RELDIR] " , os . path . normpath ( rel_dir ) )
2010-07-06 09:19:52 +00:00
ns_cnt = string . replace ( ns_cnt , " [BITNESS] " , bitness )
2009-12-05 00:26:20 +00:00
# do root
rootlist = [ ]
2010-07-05 19:59:27 +00:00
for rootitem in rootdirconts :
rootlist . append ( " File \" " + rootitem + " \" " )
2009-12-05 00:26:20 +00:00
rootstring = string . join ( rootlist , " \n " )
2010-07-05 19:59:27 +00:00
rootstring = rootstring
2009-12-05 00:26:20 +00:00
rootstring + = " \n \n "
ns_cnt = string . replace ( ns_cnt , " [ROOTDIRCONTS] " , rootstring )
2010-07-05 19:59:27 +00:00
2009-12-05 00:26:20 +00:00
# do delete items
delrootlist = [ ]
2010-07-05 19:59:27 +00:00
for rootitem in rootdirconts :
delrootlist . append ( " Delete $INSTDIR \\ " + rootitem [ l + 1 : ] )
2009-12-05 00:26:20 +00:00
delrootstring = string . join ( delrootlist , " \n " )
delrootstring + = " \n "
ns_cnt = string . replace ( ns_cnt , " [DELROOTDIRCONTS] " , delrootstring )
2010-07-05 19:59:27 +00:00
ns_cnt = string . replace ( ns_cnt , " [DODATAFILES] " , datafiles )
2011-06-01 13:13:55 +00:00
ns_cnt = string . replace ( ns_cnt , " [DELDATAFILES] " , deldatafiles )
ns_cnt = string . replace ( ns_cnt , " [DELDATADIRS] " , deldatadirs )
2009-12-05 00:26:20 +00:00
tmpnsi = os . path . normpath ( install_base_dir + os . sep + env [ ' BF_BUILDDIR ' ] + os . sep + " 00.blender_tmp.nsi " )
new_nsis = open ( tmpnsi , ' w ' )
new_nsis . write ( ns_cnt )
new_nsis . close ( )
2010-07-06 09:13:10 +00:00
print " NSIS Installer script created "
2009-12-05 00:26:20 +00:00
os . chdir ( start_dir )
2010-07-06 09:13:10 +00:00
print " Launching ' makensis ' "
2009-12-05 00:26:20 +00:00
cmdline = " makensis " + " \" " + tmpnsi + " \" "
startupinfo = subprocess . STARTUPINFO ( )
2012-04-25 11:15:55 +00:00
#startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
2009-12-05 00:26:20 +00:00
proc = subprocess . Popen ( cmdline , stdin = subprocess . PIPE , stdout = subprocess . PIPE ,
stderr = subprocess . PIPE , startupinfo = startupinfo , shell = True )
data , err = proc . communicate ( )
rv = proc . wait ( )
if rv != 0 :
print
print data . strip ( ) . split ( " \n " ) [ - 1 ]
return rv
2007-05-31 11:15:47 +00:00
2013-01-10 08:01:07 +00:00
def cudakernels_print ( target , source , env ) :
return " Running cudakernels target "
def cudakernels ( target = None , source = None , env = None ) :
"""
Builder for cuda kernels compilation . Used by release build environment only
"""
# Currently nothing to do, everything is handled by a dependency resolver
pass
2011-02-18 09:39:15 +00:00
def check_environ ( ) :
problematic_envvars = " "
for i in os . environ :
try :
os . environ [ i ] . decode ( ' ascii ' )
except UnicodeDecodeError :
problematic_envvars = problematic_envvars + " %s = %s \n " % ( i , os . environ [ i ] )
if len ( problematic_envvars ) > 0 :
print ( " ================ \n \n " )
print ( " @@ ABORTING BUILD @@ \n " )
print ( " PROBLEM DETECTED WITH ENVIRONMENT " )
print ( " --------------------------------- \n \n " )
print ( " A problem with one or more environment variable was found " )
print ( " Their value contain non-ascii characters. Check the below " )
print ( " list and override them locally to be ASCII-clean by doing " )
print ( " ' set VARNAME=cleanvalue ' on the command-line prior to " )
print ( " starting the build process: \n " )
print ( problematic_envvars )
return False
else :
return True