6 import SCons.Options.BoolOption
18 Options = SCons.Options
19 BoolOption = SCons.Options.BoolOption
21 def print_arguments(args, bc):
23 for k,v in args.iteritems():
24 print '\t'+bc.OKBLUE+k+bc.ENDC+' = '+bc.OKGREEN + v + bc.ENDC
26 print '\t'+bc.WARNING+'No command-line arguments given'+bc.ENDC
28 def validate_arguments(args, bc):
30 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LINKFLAGS',
31 'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH',
32 'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
33 'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
35 'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH',
37 'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC',
38 'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
39 'WITH_BF_PNG', 'BF_PNG', 'BF_PNG_INC', 'BF_PNG_LIB', 'BF_PNG_LIBPATH',
40 'BF_TIFF', 'BF_TIFF_INC',
41 'WITH_BF_ZLIB', 'BF_ZLIB', 'BF_ZLIB_INC', 'BF_ZLIB_LIB', 'BF_ZLIB_LIBPATH',
42 'WITH_BF_INTERNATIONAL',
43 'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'BF_GETTEXT_LIBPATH',
44 'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
45 'WITH_BF_ODE', 'BF_ODE', 'BF_ODE_INC', 'BF_ODE_LIB',
46 'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
47 'BF_SOLID', 'BF_SOLID_INC', 'BF_WINTAB', 'BF_WINTAB_INC',
49 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
50 'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
51 'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', 'BF_OPENGL_LINKFLAGS',
52 'WITH_BF_FTGL', 'BF_FTGL', 'BF_FTGL_INC', 'BF_FTGL_LIB',
56 'CFLAGS', 'CCFLAGS', 'CPPFLAGS',
57 'REL_CFLAGS', 'REL_CCFLAGS',
58 'C_WARN', 'CC_WARN', 'LLIBS', 'PLATFORM_LINKFLAGS',
59 'BF_PROFILE_FLAGS', 'LCGDIR', 'WITH_BF_VERSE',
61 'VERSE_BUILD_BINARY', 'VERSE_BUILD_DIR', 'VERSE_REGEN_PROTO',
62 'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
66 'BF_FANCY', 'BF_QUIET',
71 arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE',
72 'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME',
73 'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE',
74 'BF_DEBUG_FLAGS', 'BF_BSC', 'BF_CONFIG',
75 'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG',
76 'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG']
78 all_list = opts_list + arg_list
81 for k,v in args.iteritems():
85 print '\t'+bc.WARNING+'Invalid argument: '+bc.ENDC+k+'='+v
89 def print_targets(targs, bc):
92 print '\t'+bc.OKBLUE+t+bc.ENDC
94 print '\t'+bc.WARNING+'No targets given, using '+bc.ENDC+bc.OKGREEN+'default'+bc.ENDC
96 def validate_targets(targs, bc):
97 valid_list = ['.', 'blender', 'blenderstatic', 'blenderplayer', 'webplugin',
98 'blendernogame', 'blenderstaticnogame', 'release',
99 'everything', 'clean', 'install-bin', 'install', 'nsis']
105 print '\t'+bc.WARNING+'Invalid target: '+bc.ENDC+t
109 def ourspawn(self, sh, escape, cmd, args, env):
110 newargs = string.join(args[1:], ' ')
111 cmdline = cmd + " " + newargs
112 startupinfo = subprocess.STARTUPINFO()
113 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
114 proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
115 stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
116 data, err = proc.communicate()
124 def SetupSpawn( env ):
127 env['SPAWN'] = buf.ourspawn
130 def read_opts(cfg, args):
131 localopts = Options.Options(cfg, args)
132 localopts.AddOptions(
133 ('VERSE_BUILD_BINARY', 'Build a release or debug binary.', 'release'),
134 ('VERSE_BUILD_DIR', 'Target directory for intermediate files.', "${BF_BUILDDIR}/extern/verse"),
135 ('VERSE_REGEN_PROTO', 'Whether to regenerate the protocol files', 'yes'),
136 (BoolOption('WITH_BF_VERSE', 'Use VERSE if true', 'false')),
137 ('BF_VERSE_INCLUDE', 'verse include dir', '/usr/include'),
138 ('LCGDIR', 'location of cvs lib dir'),
139 ('VERSE_BUILD_BINARY', 'Build a release or debug binary.', 'release'),
140 ('VERSE_BUILD_DIR', 'Target directory for intermediate files.', "${BF_BUILDDIR}/extern/verse"),
141 ('VERSE_REGEN_PROTO', 'Whether to regenerate the protocol files', 'yes'),
142 ('BF_DEBUG_LIBS', 'list of libraries to build with debug symbols'),
143 ('BF_PYTHON', 'base path for python', ''),
144 ('BF_PYTHON_VERSION', 'Python version to use', ''),
145 ('BF_PYTHON_INC', 'include path for Python headers', ''),
146 ('BF_PYTHON_BINARY', 'Path to the Python interpreter', ''),
147 ('BF_PYTHON_LIB', 'Python library', ''),
148 ('BF_PYTHON_LIBPATH', 'Library path', ''),
149 ('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
150 (BoolOption('BF_NO_ELBEEM', 'Disable Fluid Sim', 'false')),
151 (BoolOption('WITH_BF_YAFRAY', 'Enable Yafray', 'true')),
152 (BoolOption('WITH_BF_OPENAL', 'Use OpenAL if true', '')),
153 ('BF_OPENAL', 'base path for OpenAL', ''),
154 ('BF_OPENAL_INC', 'include path for python headers', ''),
155 ('BF_OPENAL_LIB', 'Path to OpenAL library', ''),
156 ('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
158 (BoolOption('WITH_BF_SDL', 'Use SDL if true', '')),
159 ('BF_SDL', 'SDL base path', ''),
160 ('BF_SDL_INC', 'SDL include path', ''), #$(shell $(BF_SDL)/bin/sdl-config --cflags)
161 ('BF_SDL_LIB', 'SDL library', ''), #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
162 ('BF_SDL_LIBPATH', 'SDL library path', ''),
164 ('BF_PTHREADS', 'Pthreads base path', ''),
165 ('BF_PTHREADS_INC', 'Pthreads include path', ''),
166 ('BF_PTHREADS_LIB', 'Pthreads library', ''),
167 ('BF_PTHREADS_LIBPATH', 'Pthreads library path', ''),
169 (BoolOption('WITH_BF_FMOD', 'Use FMOD if true', 'false')),
170 # BF_FMOD = $(LCGDIR)/fmod
172 (BoolOption('WITH_BF_OPENEXR', 'Use OPENEXR if true', 'true')),
173 ('BF_OPENEXR', 'OPENEXR base path', ''),
174 ('BF_OPENEXR_INC', 'OPENEXR include path', ''),
175 ('BF_OPENEXR_LIB', 'OPENEXR library', ''),
176 ('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
178 (BoolOption('WITH_BF_DDS', 'Use DDS if true', 'true')),
180 (BoolOption('WITH_BF_FFMPEG', 'Use FFMPEG if true', 'false')),
181 ('BF_FFMPEG', 'FFMPEG base path', ''),
182 ('BF_FFMPEG_LIB', 'FFMPEG library', ''),
183 ('BF_FFMPEG_EXTRA', 'FFMPEG flags that must be preserved', ''),
185 ('BF_FFMPEG_INC', 'FFMPEG includes', ''),
186 ('BF_FFMPEG_LIBPATH', 'FFMPEG library path', ''),
189 (BoolOption('WITH_BF_JPEG', 'Use JPEG if true', 'true')),
190 ('BF_JPEG', 'JPEG base path', ''),
191 ('BF_JPEG_INC', 'JPEG include path', ''),
192 ('BF_JPEG_LIB', 'JPEG library', ''),
193 ('BF_JPEG_LIBPATH', 'JPEG library path', ''),
195 (BoolOption('WITH_BF_OPENJPEG', 'Use OPENJPEG if true', 'false')),
196 ('BF_OPENJPEG', 'OPENJPEG base path', ''),
197 ('BF_OPENJPEG_INC', 'OPENJPEG include path', ''),
198 ('BF_OPENJPEG_LIB', 'OPENJPEG library', ''),
199 ('BF_OPENJPEG_LIBPATH', 'OPENJPEG library path', ''),
201 (BoolOption('WITH_BF_REDCODE', 'Use REDCODE if true', 'false')),
202 ('BF_REDCODE', 'REDCODE base path', ''),
203 ('BF_REDCODE_INC', 'REDCODE include path', ''),
204 ('BF_REDCODE_LIB', 'REDCODE library', ''),
205 ('BF_REDCODE_LIBPATH', 'REDCODE library path', ''),
207 (BoolOption('WITH_BF_PNG', 'Use PNG if true', 'true')),
208 ('BF_PNG', 'PNG base path', ''),
209 ('BF_PNG_INC', 'PNG include path', ''),
210 ('BF_PNG_LIB', 'PNG library', ''),
211 ('BF_PNG_LIBPATH', 'PNG library path', ''),
213 ('BF_TIFF', 'TIFF base path', ''),
214 ('BF_TIFF_INC', 'TIFF include path', ''),
216 (BoolOption('WITH_BF_ZLIB', 'Use ZLib if true', 'true')),
217 ('BF_ZLIB', 'ZLib base path', ''),
218 ('BF_ZLIB_INC', 'ZLib include path', ''),
219 ('BF_ZLIB_LIB', 'ZLib library', ''),
220 ('BF_ZLIB_LIBPATH', 'ZLib library path', ''),
222 (BoolOption('WITH_BF_INTERNATIONAL', 'Use Gettext and Freetype if true', 'true')),
224 ('BF_GETTEXT', 'gettext base path', ''),
225 ('BF_GETTEXT_INC', 'gettext include path', ''),
226 ('BF_GETTEXT_LIB', 'gettext library', ''),
227 ('BF_GETTEXT_LIBPATH', 'gettext library path', ''),
229 (BoolOption('WITH_BF_ICONV', 'Use iconv if true', 'true')),
230 ('BF_ICONV', 'iconv base path', ''),
231 ('BF_ICONV_INC', 'iconv include path', ''),
232 ('BF_ICONV_LIB', 'iconv library', ''),
233 ('BF_ICONV_LIBPATH', 'iconv library path', ''),
235 (BoolOption('WITH_BF_GAMEENGINE', 'Build with gameengine' , 'true')),
237 (BoolOption('WITH_BF_ODE', 'Use ODE if true', 'true')),
238 ('BF_ODE', 'ODE base path', ''),
239 ('BF_ODE_INC', 'ODE include path' , ''),
240 ('BF_ODE_LIB', 'ODE library', ''),
242 (BoolOption('WITH_BF_BULLET', 'Use Bullet if true', 'true')),
243 ('BF_BULLET', 'Bullet base dir', ''),
244 ('BF_BULLET_INC', 'Bullet include path', ''),
245 ('BF_BULLET_LIB', 'Bullet library', ''),
247 ('BF_SOLID', 'Solid base dir', '#/extern/solid'),
248 ('BF_SOLID_INC', 'Solid include path', ''),
249 ('BF_WINTAB', 'WinTab base dir', ''),
250 ('BF_WINTAB_INC', 'WinTab include dir', ''),
252 ##WITH_BF_NSPR = 'true'
253 ##BF_NSPR = $(LCGDIR)/nspr
254 ##BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
256 ### Uncomment the following line to use Mozilla inplace of netscape
257 ##CPPFLAGS += -DMOZ_NOT_NET
258 ### Location of MOZILLA/Netscape header files...
259 ##BF_MOZILLA = $(LCGDIR)/mozilla
260 ##BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
262 ### Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
263 ### if this is not set.
265 ### Be paranoid regarding library creation (do not update archives)
266 ##BF_PARANOID = 'true'
268 ### enable freetype2 support for text objects
269 ('BF_FREETYPE', 'Freetype base path', ''),
270 ('BF_FREETYPE_INC', 'Freetype include path', ''),
271 ('BF_FREETYPE_LIB', 'Freetype library', ''),
272 ('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
274 (BoolOption('WITH_BF_OPENMP', 'Use OpenMP if true', 'false')),
276 (BoolOption('WITH_BF_QUICKTIME', 'Use QuickTime if true', 'false')),
277 ('BF_QUICKTIME', 'QuickTime base path', ''),
278 ('BF_QUICKTIME_INC', 'QuickTime include path', ''),
279 ('BF_QUICKTIME_LIB', 'QuickTime library', ''),
280 ('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''),
282 (BoolOption('WITH_BF_STATICOPENGL', 'Use MESA if true', 'true')),
283 ('BF_OPENGL', 'OpenGL base path', ''),
284 ('BF_OPENGL_INC', 'OpenGL include path', ''),
285 ('BF_OPENGL_LIB', 'OpenGL libraries', ''),
286 ('BF_OPENGL_LIBPATH', 'OpenGL library path', ''),
287 ('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
288 ('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
290 (BoolOption('WITH_BF_FTGL', 'Use FTGL if true', 'true')),
291 ('BF_FTGL', 'FTGL base path', ''),
292 ('BF_FTGL_INC', 'FTGL include path', ''),
293 ('BF_FTGL_LIB', 'FTGL libraries', ''),
295 (BoolOption('WITH_BF_GLEXT', 'Enable GL Extensions', 'true')),
296 (BoolOption('WITH_BF_PLAYER', 'Build blenderplayer if true', 'false')),
298 ('CFLAGS', 'C-compiler flags', ''),
299 ('CCFLAGS', 'C++-compiler flags', ''),
300 ('CPPFLAGS', 'Defines', ''),
301 ('REL_CFLAGS', 'C release flags', ''),
302 ('REL_CCFLAGS', 'C++ release flags', ''),
304 ('C_WARN', 'C warning flags', ''),
305 ('CC_WARN', 'C++ warning flags', ''),
307 ('LLIBS', 'Platform libs', ''),
308 ('PLATFORM_LINKFLAGS', 'Platform linkflags', ''),
310 (BoolOption('BF_PROFILE', 'Add profiling information if true', 'false')),
311 ('BF_PROFILE_FLAGS', 'Profiling flags', ''),
313 (BoolOption('BF_DEBUG', 'Add debug flags if true', 'false')),
314 ('BF_DEBUG_FLAGS', 'Debug flags', ''),
316 (BoolOption('BF_BSC', 'Create .bsc files (msvc only)', 'true')),
318 ('BF_BUILDDIR', 'Build dir', ''),
319 ('BF_INSTALLDIR', 'Installation dir', ''),
321 ('CC', 'C compiler to use', ''),
322 ('CXX', 'C++ compiler to use', ''),
324 (BoolOption('BF_BUILDINFO', 'Buildtime in splash if true', 'true')),
326 (BoolOption('BF_TWEAK_MODE', 'Enable tweak mode if true', 'false')),
327 (BoolOption('BF_SPLIT_SRC', 'Split src lib into several chunks if true', 'false')),
328 (BoolOption('WITHOUT_BF_INSTALL', 'dont install if true', 'false')),
329 (BoolOption('BF_FANCY', 'Enable fancy output if true', 'true')),
330 (BoolOption('BF_QUIET', 'Enable silent output if true', 'true')),
331 (BoolOption('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', 'false')),
333 ('BF_X264_CONFIG', 'configuration flags for x264', ''),
334 ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
336 ) # end of opts.AddOptions()
340 def NSIS_print(target, source, env):
341 return "Creating NSIS installer for Blender 3D"
343 def NSIS_Installer(target=None, source=None, env=None):
345 if env['OURPLATFORM'] != 'win32-vc' and env['OURPLATFORM'] != 'win32-mingw':
346 print "NSIS installer is only available on Windows."
349 start_dir = os.getcwd()
350 rel_dir = start_dir + "\\release\\windows\\installer\\"
351 install_base_dir = start_dir + "\\"
353 if not os.path.exists(install_base_dir+env['BF_INSTALLDIR']+'/plugins/include'):
354 os.mkdir(install_base_dir+env['BF_INSTALLDIR']+'/plugins/include')
356 for f in glob.glob('source/blender/blenpluginapi/*.h'):
357 shutil.copy(f,install_base_dir+env['BF_INSTALLDIR']+'/plugins/include')
359 shutil.copy('source/blender/blenpluginapi/plugin.def',install_base_dir+env['BF_INSTALLDIR']+'/plugins/include/')
363 version = v.read()[:-1]
364 shortver = version.split('.')[0] + version.split('.')[1]
367 #### change to suit install dir ####
368 inst_dir = install_base_dir + env['BF_INSTALLDIR']
370 os.chdir("windows/installer")
372 ns = open("00.sconsblender.nsi","r")
374 ns_cnt = str(ns.read())
379 rootdir = os.listdir(inst_dir+"\\")
380 for rootitem in rootdir:
381 if os.path.isdir(inst_dir+"\\"+ rootitem) == 0:
382 rootlist.append("File \"" + os.path.normpath(inst_dir) + "\\" + rootitem+"\"")
383 rootstring = string.join(rootlist, "\n ")
385 ns_cnt = string.replace(ns_cnt, "[ROOTDIRCONTS]", rootstring)
389 for rootitem in rootdir:
390 if os.path.isdir(inst_dir + rootitem) == 0:
391 delrootlist.append("Delete $INSTDIR\\" + rootitem)
392 delrootstring = string.join(delrootlist, "\n ")
393 delrootstring += "\n"
394 ns_cnt = string.replace(ns_cnt, "[DELROOTDIRCONTS]", delrootstring)
398 scriptpath = "%s%s" % (inst_dir, "\\.blender\\scripts")
399 scriptdir = os.listdir(scriptpath)
400 for scriptitem in scriptdir:
401 scriptfile = "%s\\%s" % (scriptpath, scriptitem)
402 if os.path.isdir(scriptfile) == 0:
403 scriptfile = os.path.normpath(scriptfile)
404 scriptlist.append("File \"%s\"" % scriptfile)
405 scriptstring = string.join(scriptlist, "\n ")
406 scriptstring += "\n\n"
407 ns_cnt = string.replace(ns_cnt, "[SCRIPTCONTS]", scriptstring)
409 # do scripts\bpymodules
411 bpymodpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpymodules")
412 bpymoddir = os.listdir(bpymodpath)
414 for bpymoditem in bpymoddir:
415 bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
416 if os.path.isdir(bpymodfile) == 0:
417 bpymodfile = os.path.normpath(bpymodfile)
418 bpymodlist.append("File \"%s\"" % bpymodfile)
419 bpymodstring = string.join(bpymodlist, "\n ")
420 bpymodstring += "\n\n"
421 ns_cnt = string.replace(ns_cnt, "[SCRIPTMODCONTS]", bpymodstring)
423 # do scripts\bpymodules\colladaimex
425 bpymodpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpymodules\\ColladaImEx")
426 bpymoddir = os.listdir(bpymodpath)
428 for bpymoditem in bpymoddir:
429 bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
430 if os.path.isdir(bpymodfile) == 0:
431 bpymodfile=os.path.normpath(bpymodfile)
432 colladalist.append("File \"%s\"" % bpymodfile)
433 bpymodstring = string.join(colladalist, "\n ")
434 bpymodstring += "\n\n"
435 ns_cnt = string.replace(ns_cnt, "[SCRIPTMODCOLLADACONT]", bpymodstring)
439 bpydatapath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpydata")
440 bpydatadir = os.listdir(bpydatapath)
441 for bpydataitem in bpydatadir:
442 bpydatafile = "%s\\%s" % (bpydatapath, bpydataitem)
443 if os.path.isdir(bpydatafile) == 0:
444 bpydatalist.append("File \"%s\"" % bpydatafile)
445 bpydatastring = string.join(bpydatalist, "\n ")
446 bpydatastring += "\n\n"
447 ns_cnt = string.replace(ns_cnt, "[SCRIPTDATACONTS]", bpydatastring)
451 plugincludepath = "%s%s" % (inst_dir, "\\plugins\\include")
452 plugincludedir = os.listdir(plugincludepath)
453 for plugincludeitem in plugincludedir:
454 plugincludefile = "%s\\%s" % (plugincludepath, plugincludeitem)
455 if os.path.isdir(plugincludefile) == 0:
456 if plugincludefile.find('.h') or plugincludefile.find('.DEF'):
457 plugincludefile = os.path.normpath(plugincludefile)
458 plugincludelist.append("File \"%s\"" % plugincludefile)
459 plugincludestring = string.join(plugincludelist, "\n ")
460 plugincludestring += "\n\n"
461 ns_cnt = string.replace(ns_cnt, "[PLUGINCONTS]", plugincludestring)
463 # do scripts\bpydata\config
465 cfgpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpydata\\config")
466 cfgdir = os.listdir(cfgpath)
467 for cfgitem in cfgdir:
468 cfgfile = "%s\\%s" % (cfgpath, cfgitem)
469 if os.path.isdir(cfgfile) == 0:
470 cfglist.append("File \"%s\"" % cfgfile)
471 cfgstring = string.join(cfglist, "\n ")
473 ns_cnt = string.replace(ns_cnt, "[SCRIPTDATACFGCONTS]", cfgstring)
477 dotblenddir = os.listdir(inst_dir+"\\.blender")
478 for dotblenditem in dotblenddir:
479 if os.path.isdir(inst_dir + "\\.blender\\" + dotblenditem) == 0:
480 dotblendlist.append("File \"" + os.path.normpath(inst_dir) + "\\.blender\\" +
482 dotblendstring = string.join(dotblendlist, "\n ")
483 dotblendstring += "\n\n"
484 ns_cnt = string.replace(ns_cnt, "[DOTBLENDERCONTS]", dotblendstring)
489 langdir = os.listdir(inst_dir + "\\.blender\\locale")
490 for langitem in langdir:
491 if os.path.isdir(inst_dir + "\\.blender\\locale\\" + langitem) == 1:
492 langfiles.append("SetOutPath $BLENDERHOME\\.blender\\locale\\" + langitem + "\\LC_MESSAGES")
493 langfiles.append("File \"" + os.path.normpath(inst_dir) + "\\.blender\\locale\\"
494 + langitem + "\\LC_MESSAGES\\blender.mo\"")
495 langstring = string.join(langfiles, "\n ")
497 ns_cnt = string.replace(ns_cnt, "[LANGUAGECONTS]", langstring)
500 ns_cnt = string.replace(ns_cnt, "DISTDIR", os.path.normpath(inst_dir+"\\"))
501 ns_cnt = string.replace(ns_cnt, "SHORTVER", shortver)
502 ns_cnt = string.replace(ns_cnt, "VERSION", version)
503 ns_cnt = string.replace(ns_cnt, "RELDIR", os.path.normpath(rel_dir))
505 tmpnsi = os.path.normpath(install_base_dir+os.sep+env['BF_BUILDDIR']+os.sep+"00.blender_tmp.nsi")
506 new_nsis = open(tmpnsi, 'w')
507 new_nsis.write(ns_cnt)
512 cmdline = "makensis " + "\""+tmpnsi+"\""
514 startupinfo = subprocess.STARTUPINFO()
515 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
516 proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
517 stderr=subprocess.PIPE, startupinfo=startupinfo, shell = True)
518 data, err = proc.communicate()