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_PNG', 'Use PNG if true', 'true')),
196 ('BF_PNG', 'PNG base path', ''),
197 ('BF_PNG_INC', 'PNG include path', ''),
198 ('BF_PNG_LIB', 'PNG library', ''),
199 ('BF_PNG_LIBPATH', 'PNG library path', ''),
201 ('BF_TIFF', 'TIFF base path', ''),
202 ('BF_TIFF_INC', 'TIFF include path', ''),
204 (BoolOption('WITH_BF_ZLIB', 'Use ZLib if true', 'true')),
205 ('BF_ZLIB', 'ZLib base path', ''),
206 ('BF_ZLIB_INC', 'ZLib include path', ''),
207 ('BF_ZLIB_LIB', 'ZLib library', ''),
208 ('BF_ZLIB_LIBPATH', 'ZLib library path', ''),
210 (BoolOption('WITH_BF_INTERNATIONAL', 'Use Gettext and Freetype if true', 'true')),
212 ('BF_GETTEXT', 'gettext base path', ''),
213 ('BF_GETTEXT_INC', 'gettext include path', ''),
214 ('BF_GETTEXT_LIB', 'gettext library', ''),
215 ('BF_GETTEXT_LIBPATH', 'gettext library path', ''),
217 (BoolOption('WITH_BF_ICONV', 'Use iconv if true', 'true')),
218 ('BF_ICONV', 'iconv base path', ''),
219 ('BF_ICONV_INC', 'iconv include path', ''),
220 ('BF_ICONV_LIB', 'iconv library', ''),
221 ('BF_ICONV_LIBPATH', 'iconv library path', ''),
223 (BoolOption('WITH_BF_GAMEENGINE', 'Build with gameengine' , 'true')),
225 (BoolOption('WITH_BF_ODE', 'Use ODE if true', 'true')),
226 ('BF_ODE', 'ODE base path', ''),
227 ('BF_ODE_INC', 'ODE include path' , ''),
228 ('BF_ODE_LIB', 'ODE library', ''),
230 (BoolOption('WITH_BF_BULLET', 'Use Bullet if true', 'true')),
231 ('BF_BULLET', 'Bullet base dir', ''),
232 ('BF_BULLET_INC', 'Bullet include path', ''),
233 ('BF_BULLET_LIB', 'Bullet library', ''),
235 ('BF_SOLID', 'Solid base dir', '#/extern/solid'),
236 ('BF_SOLID_INC', 'Solid include path', ''),
237 ('BF_WINTAB', 'WinTab base dir', ''),
238 ('BF_WINTAB_INC', 'WinTab include dir', ''),
240 ##WITH_BF_NSPR = 'true'
241 ##BF_NSPR = $(LCGDIR)/nspr
242 ##BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
244 ### Uncomment the following line to use Mozilla inplace of netscape
245 ##CPPFLAGS += -DMOZ_NOT_NET
246 ### Location of MOZILLA/Netscape header files...
247 ##BF_MOZILLA = $(LCGDIR)/mozilla
248 ##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
250 ### Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
251 ### if this is not set.
253 ### Be paranoid regarding library creation (do not update archives)
254 ##BF_PARANOID = 'true'
256 ### enable freetype2 support for text objects
257 ('BF_FREETYPE', 'Freetype base path', ''),
258 ('BF_FREETYPE_INC', 'Freetype include path', ''),
259 ('BF_FREETYPE_LIB', 'Freetype library', ''),
260 ('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
262 (BoolOption('WITH_BF_OPENMP', 'Use OpenMP if true', 'false')),
264 (BoolOption('WITH_BF_QUICKTIME', 'Use QuickTime if true', 'false')),
265 ('BF_QUICKTIME', 'QuickTime base path', ''),
266 ('BF_QUICKTIME_INC', 'QuickTime include path', ''),
267 ('BF_QUICKTIME_LIB', 'QuickTime library', ''),
268 ('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''),
270 (BoolOption('WITH_BF_STATICOPENGL', 'Use MESA if true', 'true')),
271 ('BF_OPENGL', 'OpenGL base path', ''),
272 ('BF_OPENGL_INC', 'OpenGL include path', ''),
273 ('BF_OPENGL_LIB', 'OpenGL libraries', ''),
274 ('BF_OPENGL_LIBPATH', 'OpenGL library path', ''),
275 ('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
276 ('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
278 (BoolOption('WITH_BF_FTGL', 'Use FTGL if true', 'true')),
279 ('BF_FTGL', 'FTGL base path', ''),
280 ('BF_FTGL_INC', 'FTGL include path', ''),
281 ('BF_FTGL_LIB', 'FTGL libraries', ''),
283 (BoolOption('WITH_BF_GLEXT', 'Enable GL Extensions', 'true')),
284 (BoolOption('WITH_BF_PLAYER', 'Build blenderplayer if true', 'false')),
286 ('CFLAGS', 'C-compiler flags', ''),
287 ('CCFLAGS', 'C++-compiler flags', ''),
288 ('CPPFLAGS', 'Defines', ''),
289 ('REL_CFLAGS', 'C release flags', ''),
290 ('REL_CCFLAGS', 'C++ release flags', ''),
292 ('C_WARN', 'C warning flags', ''),
293 ('CC_WARN', 'C++ warning flags', ''),
295 ('LLIBS', 'Platform libs', ''),
296 ('PLATFORM_LINKFLAGS', 'Platform linkflags', ''),
298 (BoolOption('BF_PROFILE', 'Add profiling information if true', 'false')),
299 ('BF_PROFILE_FLAGS', 'Profiling flags', ''),
301 (BoolOption('BF_DEBUG', 'Add debug flags if true', 'false')),
302 ('BF_DEBUG_FLAGS', 'Debug flags', ''),
304 (BoolOption('BF_BSC', 'Create .bsc files (msvc only)', 'true')),
306 ('BF_BUILDDIR', 'Build dir', ''),
307 ('BF_INSTALLDIR', 'Installation dir', ''),
309 ('CC', 'C compiler to use', ''),
310 ('CXX', 'C++ compiler to use', ''),
312 (BoolOption('BF_BUILDINFO', 'Buildtime in splash if true', 'true')),
314 (BoolOption('BF_TWEAK_MODE', 'Enable tweak mode if true', 'false')),
315 (BoolOption('BF_SPLIT_SRC', 'Split src lib into several chunks if true', 'false')),
316 (BoolOption('WITHOUT_BF_INSTALL', 'dont install if true', 'false')),
317 (BoolOption('BF_FANCY', 'Enable fancy output if true', 'true')),
318 (BoolOption('BF_QUIET', 'Enable silent output if true', 'true')),
319 (BoolOption('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', 'false')),
321 ('BF_X264_CONFIG', 'configuration flags for x264', ''),
322 ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
324 ) # end of opts.AddOptions()
328 def NSIS_print(target, source, env):
329 return "Creating NSIS installer for Blender 3D"
331 def NSIS_Installer(target=None, source=None, env=None):
333 if env['OURPLATFORM'] != 'win32-vc' and env['OURPLATFORM'] != 'win32-mingw':
334 print "NSIS installer is only available on Windows."
337 start_dir = os.getcwd()
338 rel_dir = start_dir + "\\release\\windows\\installer\\"
339 install_base_dir = start_dir + "\\"
341 if not os.path.exists(install_base_dir+env['BF_INSTALLDIR']+'/plugins/include'):
342 os.mkdir(install_base_dir+env['BF_INSTALLDIR']+'/plugins/include')
344 for f in glob.glob('source/blender/blenpluginapi/*.h'):
345 shutil.copy(f,install_base_dir+env['BF_INSTALLDIR']+'/plugins/include')
347 shutil.copy('source/blender/blenpluginapi/plugin.def',install_base_dir+env['BF_INSTALLDIR']+'/plugins/include/')
351 version = v.read()[:-1]
352 shortver = version.split('.')[0] + version.split('.')[1]
355 #### change to suit install dir ####
356 inst_dir = install_base_dir + env['BF_INSTALLDIR']
358 os.chdir("windows/installer")
360 ns = open("00.sconsblender.nsi","r")
362 ns_cnt = str(ns.read())
367 rootdir = os.listdir(inst_dir+"\\")
368 for rootitem in rootdir:
369 if os.path.isdir(inst_dir+"\\"+ rootitem) == 0:
370 rootlist.append("File \"" + os.path.normpath(inst_dir) + "\\" + rootitem+"\"")
371 rootstring = string.join(rootlist, "\n ")
373 ns_cnt = string.replace(ns_cnt, "[ROOTDIRCONTS]", rootstring)
377 for rootitem in rootdir:
378 if os.path.isdir(inst_dir + rootitem) == 0:
379 delrootlist.append("Delete $INSTDIR\\" + rootitem)
380 delrootstring = string.join(delrootlist, "\n ")
381 delrootstring += "\n"
382 ns_cnt = string.replace(ns_cnt, "[DELROOTDIRCONTS]", delrootstring)
386 scriptpath = "%s%s" % (inst_dir, "\\.blender\\scripts")
387 scriptdir = os.listdir(scriptpath)
388 for scriptitem in scriptdir:
389 scriptfile = "%s\\%s" % (scriptpath, scriptitem)
390 if os.path.isdir(scriptfile) == 0:
391 scriptfile = os.path.normpath(scriptfile)
392 scriptlist.append("File \"%s\"" % scriptfile)
393 scriptstring = string.join(scriptlist, "\n ")
394 scriptstring += "\n\n"
395 ns_cnt = string.replace(ns_cnt, "[SCRIPTCONTS]", scriptstring)
397 # do scripts\bpymodules
399 bpymodpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpymodules")
400 bpymoddir = os.listdir(bpymodpath)
402 for bpymoditem in bpymoddir:
403 bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
404 if os.path.isdir(bpymodfile) == 0:
405 bpymodfile = os.path.normpath(bpymodfile)
406 bpymodlist.append("File \"%s\"" % bpymodfile)
407 bpymodstring = string.join(bpymodlist, "\n ")
408 bpymodstring += "\n\n"
409 ns_cnt = string.replace(ns_cnt, "[SCRIPTMODCONTS]", bpymodstring)
411 # do scripts\bpymodules\colladaimex
413 bpymodpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpymodules\\ColladaImEx")
414 bpymoddir = os.listdir(bpymodpath)
416 for bpymoditem in bpymoddir:
417 bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
418 if os.path.isdir(bpymodfile) == 0:
419 bpymodfile=os.path.normpath(bpymodfile)
420 colladalist.append("File \"%s\"" % bpymodfile)
421 bpymodstring = string.join(colladalist, "\n ")
422 bpymodstring += "\n\n"
423 ns_cnt = string.replace(ns_cnt, "[SCRIPTMODCOLLADACONT]", bpymodstring)
427 bpydatapath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpydata")
428 bpydatadir = os.listdir(bpydatapath)
429 for bpydataitem in bpydatadir:
430 bpydatafile = "%s\\%s" % (bpydatapath, bpydataitem)
431 if os.path.isdir(bpydatafile) == 0:
432 bpydatalist.append("File \"%s\"" % bpydatafile)
433 bpydatastring = string.join(bpydatalist, "\n ")
434 bpydatastring += "\n\n"
435 ns_cnt = string.replace(ns_cnt, "[SCRIPTDATACONTS]", bpydatastring)
439 plugincludepath = "%s%s" % (inst_dir, "\\plugins\\include")
440 plugincludedir = os.listdir(plugincludepath)
441 for plugincludeitem in plugincludedir:
442 plugincludefile = "%s\\%s" % (plugincludepath, plugincludeitem)
443 if os.path.isdir(plugincludefile) == 0:
444 if plugincludefile.find('.h') or plugincludefile.find('.DEF'):
445 plugincludefile = os.path.normpath(plugincludefile)
446 plugincludelist.append("File \"%s\"" % plugincludefile)
447 plugincludestring = string.join(plugincludelist, "\n ")
448 plugincludestring += "\n\n"
449 ns_cnt = string.replace(ns_cnt, "[PLUGINCONTS]", plugincludestring)
451 # do scripts\bpydata\config
453 cfgpath = "%s%s" % (inst_dir, "\\.blender\\scripts\\bpydata\\config")
454 cfgdir = os.listdir(cfgpath)
455 for cfgitem in cfgdir:
456 cfgfile = "%s\\%s" % (cfgpath, cfgitem)
457 if os.path.isdir(cfgfile) == 0:
458 cfglist.append("File \"%s\"" % cfgfile)
459 cfgstring = string.join(cfglist, "\n ")
461 ns_cnt = string.replace(ns_cnt, "[SCRIPTDATACFGCONTS]", cfgstring)
465 dotblenddir = os.listdir(inst_dir+"\\.blender")
466 for dotblenditem in dotblenddir:
467 if os.path.isdir(inst_dir + "\\.blender\\" + dotblenditem) == 0:
468 dotblendlist.append("File \"" + os.path.normpath(inst_dir) + "\\.blender\\" +
470 dotblendstring = string.join(dotblendlist, "\n ")
471 dotblendstring += "\n\n"
472 ns_cnt = string.replace(ns_cnt, "[DOTBLENDERCONTS]", dotblendstring)
477 langdir = os.listdir(inst_dir + "\\.blender\\locale")
478 for langitem in langdir:
479 if os.path.isdir(inst_dir + "\\.blender\\locale\\" + langitem) == 1:
480 langfiles.append("SetOutPath $BLENDERHOME\\.blender\\locale\\" + langitem + "\\LC_MESSAGES")
481 langfiles.append("File \"" + os.path.normpath(inst_dir) + "\\.blender\\locale\\"
482 + langitem + "\\LC_MESSAGES\\blender.mo\"")
483 langstring = string.join(langfiles, "\n ")
485 ns_cnt = string.replace(ns_cnt, "[LANGUAGECONTS]", langstring)
488 ns_cnt = string.replace(ns_cnt, "DISTDIR", os.path.normpath(inst_dir+"\\"))
489 ns_cnt = string.replace(ns_cnt, "SHORTVER", shortver)
490 ns_cnt = string.replace(ns_cnt, "VERSION", version)
491 ns_cnt = string.replace(ns_cnt, "RELDIR", os.path.normpath(rel_dir))
493 tmpnsi = os.path.normpath(install_base_dir+os.sep+env['BF_BUILDDIR']+os.sep+"00.blender_tmp.nsi")
494 new_nsis = open(tmpnsi, 'w')
495 new_nsis.write(ns_cnt)
500 cmdline = "makensis " + "\""+tmpnsi+"\""
502 startupinfo = subprocess.STARTUPINFO()
503 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
504 proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
505 stderr=subprocess.PIPE, startupinfo=startupinfo, shell = True)
506 data, err = proc.communicate()