[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29971] trunk/blender: == SCons ==

Nathan Letwory nathan at letworyinteractive.com
Mon Jul 5 09:06:19 CEST 2010


Revision: 29971
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29971
Author:   jesterking
Date:     2010-07-05 09:06:19 +0200 (Mon, 05 Jul 2010)

Log Message:
-----------
== SCons ==

Updated to comply with datafiles filepath patch.

I've tried to do some changes for OSX too, but I'm not sure if they're correct,
so OSX people, please test and report.

Modified Paths:
--------------
    trunk/blender/SConstruct
    trunk/blender/tools/Blender.py
    trunk/blender/tools/btools.py

Modified: trunk/blender/SConstruct
===================================================================
--- trunk/blender/SConstruct	2010-07-05 06:51:12 UTC (rev 29970)
+++ trunk/blender/SConstruct	2010-07-05 07:06:19 UTC (rev 29971)
@@ -56,6 +56,8 @@
 btools = tools.btools
 B = tools.Blender
 
+VERSION = tools.btools.VERSION # This is used in creating the local config directories
+
 ### globals ###
 platform = sys.platform
 quickie = None
@@ -193,7 +195,7 @@
 # NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
 # TODO: perhaps we need an option (off by default) to not do this altogether...
 if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
-	scriptsDir = env['BF_INSTALLDIR'] + os.sep + '.blender' + os.sep + 'scripts'
+	scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
 	if os.path.isdir(scriptsDir):
 		print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
 		shutil.rmtree(scriptsDir)
@@ -434,8 +436,8 @@
 	
 	blenderinstall = env.Install(dir=dir, source=B.program_list)
 
-#-- .blender
-#- dont do .blender and scripts for darwin, it is already in the bundle
+#-- local path = config files in install dir: installdir\VERSION
+#- dont do config and scripts for darwin, it is already in the bundle
 dotblendlist = []
 datafileslist = []
 datafilestargetlist = []
@@ -460,13 +462,13 @@
 				if 'locale' in dp:
 					datafileslist.append(os.path.join(dp,f))
 					if env['WITH_BF_FHS']:	dir= os.path.join(*([BLENDERPATH] + ['datafiles'] + dp.split(os.sep)[2:]))	# skip bin/.blender
-					else:					dir= os.path.join(*([BLENDERPATH] + ['.blender'] + ['datafiles'] + dp.split(os.sep)[1:]))	# skip bin
+					else:					dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:]))	# skip bin
 					datafilestargetlist.append(dir + os.sep + f)
 
 				else:
 					dotblendlist.append(os.path.join(dp, f))
 					if env['WITH_BF_FHS']:	dir= os.path.join(*([BLENDERPATH] + ['config'] + dp.split(os.sep)[2:]))	# skip bin/.blender
-					else:					dir= os.path.join(*([BLENDERPATH] + ['.blender'] + ['config'] + dp.split(os.sep)[1:]))	# skip bin
+					else:					dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['config'] + dp.split(os.sep)[1:]))	# skip bin
 					
 					dottargetlist.append(dir + os.sep + f)
 					
@@ -479,7 +481,7 @@
 			dotblenderinstall.append(env.Install(dir=td, source=srcfile))
 		
 		if env['WITH_BF_PYTHON']:
-			#-- .blender/scripts
+			#-- local/VERSION/scripts
 			scriptpaths=['release/scripts']
 			for scriptpath in scriptpaths:
 				for dp, dn, df in os.walk(scriptpath):
@@ -487,7 +489,7 @@
 						dn.remove('.svn')
 					
 					if env['WITH_BF_FHS']:		dir = BLENDERPATH
-					else:						dir = os.path.join(env['BF_INSTALLDIR'], '.blender')				
+					else:						dir = os.path.join(env['BF_INSTALLDIR'], VERSION)				
 					dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
 					
 					source=[os.path.join(dp, f) for f in df if f[-3:]!='pyc']

Modified: trunk/blender/tools/Blender.py
===================================================================
--- trunk/blender/tools/Blender.py	2010-07-05 06:51:12 UTC (rev 29970)
+++ trunk/blender/tools/Blender.py	2010-07-05 07:06:19 UTC (rev 29971)
@@ -31,6 +31,8 @@
 import SCons.Tool
 import bcolors
 bc = bcolors.bcolors()
+import btools
+VERSION = btools.VERSION
 
 Split = SCons.Util.Split
 Action = SCons.Action.Action
@@ -466,7 +468,7 @@
 	py_target = env.subst( env['BF_INSTALLDIR'] )
 	if py_target[0]=='#':
 		py_target=py_target[1:]
-	py_target+= '/.blender/python/lib/' 
+	py_target = os.path.join(py_target, VERSION, 'python', 'lib')
 	def printexception(func,path,ex):
 		if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
 			print str(func) + ' failed on ' + str(path)
@@ -521,27 +523,27 @@
 	commands.getoutput(cmd)
 	cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,builddir, binary, binary)
 	commands.getoutput(cmd)
-	cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/'%(builddir, binary)
+	cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(builddir, binary, VERSION)
 #	print cmd
 	commands.getoutput(cmd)
-	cmd = builddir + '/%s.app/Contents/MacOS/.blender'%binary
-	shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
-	shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
-	cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/Resources/'%(bldroot,builddir,binary)
+	cmd = builddir + '/%s.app/Contents/MacOS/VERSION'%(binary,VERSION)
+	shutil.copy(bldroot + '/bin/'+VERSION+'/.bfont.ttf', cmd)
+	shutil.copy(bldroot + '/bin/'+VERSION+'/.Blanguages', cmd)
+	cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,builddir,binary)
+	commands.getoutput(cmd)
+	cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,builddir,binary,VERSION)
+	commands.getoutput(cmd)
+	cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,builddir,binary)
+	commands.getoutput(cmd)
+	cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(builddir,binary, VERSION)
+	commands.getoutput(cmd)
+	cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,builddir,binary,VERSION)
 	commands.getoutput(cmd) 
-	cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
-	commands.getoutput(cmd) 
-	cmd = 'cp %s/bin/.blender/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,builddir,binary)
-	commands.getoutput(cmd) 
-	cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/python/'%(builddir,binary)
-	commands.getoutput(cmd) 
-	cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/.blender/python/'%(libdir,python_zip,builddir,binary)
-	commands.getoutput(cmd) 
-	cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
+	cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,builddir,binary,VERSION)
 	commands.getoutput(cmd)
-	cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
+	cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,builddir,binary,VERSION)
 	commands.getoutput(cmd)
-	cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
+	cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,builddir,binary,VERSION)
 	commands.getoutput(cmd)
 	cmd = 'chmod +x  %s/%s.app/Contents/MacOS/%s'%(builddir,binary, binary)
 	commands.getoutput(cmd)
@@ -559,7 +561,7 @@
 
 def UnixPyBundle(target=None, source=None, env=None):
 	# Any Unix except osx
-	#-- .blender/python/lib/python3.1
+	#-- VERSION/python/lib/python3.1
 	
 	import commands
 	
@@ -568,7 +570,7 @@
 		commands.getoutput(cmd)
 	
 	if env['WITH_BF_FHS']:	dir = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION']) # BLENDERPATH
-	else:					dir = os.path.join(env['BF_INSTALLDIR'], '.blender')
+	else:					dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
 	
 	py_src =	env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
 	py_target =	env.subst( dir + '/python/lib/python'+env['BF_PYTHON_VERSION'] )

Modified: trunk/blender/tools/btools.py
===================================================================
--- trunk/blender/tools/btools.py	2010-07-05 06:51:12 UTC (rev 29970)
+++ trunk/blender/tools/btools.py	2010-07-05 07:06:19 UTC (rev 29971)
@@ -1,4 +1,3 @@
-
 import os
 import os.path
 import SCons.Options
@@ -16,6 +15,8 @@
 Variables = SCons.Variables
 BoolVariable = SCons.Variables.BoolVariable
 
+VERSION = '2.52' # This is used in creating the local config directories
+
 def print_arguments(args, bc):
     if len(args):
         for k,v in args.iteritems():





More information about the Bf-blender-cvs mailing list