packaging in bundle of the Os X binary. result in the bin of build dir

Important note, the install target install only the binary not the
packaged bunde for the moment
This commit is contained in:
Jean-Luc Peurière 2006-02-05 11:28:28 +00:00
parent 257124a44f
commit a91c077152
3 changed files with 55 additions and 4 deletions

@ -57,6 +57,7 @@ B.possible_types = ['core', 'common', 'blender', 'intern',
'international', 'game', 'game2',
'player', 'player2', 'system']
B.binarykind = ['blender' , 'blenderplayer']
##################################
# target and argument validation #
##################################
@ -223,7 +224,7 @@ dobj = B.buildinfo(env, "dynamic")
thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(env)
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs)
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['WITH_BF_PLAYER']:
playerlist = B.create_blender_liblist(env, 'player')
playerlist += B.create_blender_liblist(env, 'core')
@ -233,7 +234,7 @@ if env['WITH_BF_PLAYER']:
playerlist += B.create_blender_liblist(env, 'game')
playerlist += B.create_blender_liblist(env, 'game2')
playerlist += B.create_blender_liblist(env, 'player2')
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs)
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
##### Now define some targets

@ -62,7 +62,8 @@ BF_FTGL = '#extern/bFTGL'
BF_FTGL_INC = BF_FTGL + '/include'
BF_FTGL_LIB = 'extern_ftgl'
WITH_BF_GAMEENGINE='false'
WITH_BF_GAMEENGINE='true'
WITH_BF_PLAYER='false'
WITH_BF_ODE = 'false'
BF_ODE = LCGDIR + '/ode'

@ -259,11 +259,57 @@ def set_quiet_output(env):
env['BUILDERS']['Library'] = static_lib
env['BUILDERS']['Program'] = program
def my_appit_print(target, source, env):
a = '%s' % (target[0])
d, f = os.path.split(a)
return "making bundle for " + f
def AppIt(target=None, source=None, env=None):
import shutil
import commands
import os.path
a = '%s' % (target[0])
builddir, b = os.path.split(a)
bldroot = env.Dir('.').abspath
binary = env['BINARYKIND']
sourcedir = bldroot + '/source/darwin/%s.app'%binary
sourceinfo = bldroot + "/source/darwin/%s.app/Contents/Info.plist"%binary
targetinfo = builddir +'/' + "%s.app/Contents/Info.plist"%binary
cmd = builddir + '/' +'%s.app'%binary
if os.path.isdir(cmd):
shutil.rmtree(cmd)
shutil.copytree(sourcedir, cmd)
cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo)
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)
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)
commands.getoutput(cmd)
cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
commands.getoutput(cmd)
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
commands.getoutput(cmd)
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(builddir,binary, binary)
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name CVS -prune -exec rm -rf {} \;'%(builddir, binary)
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(builddir, binary)
commands.getoutput(cmd)
#### END ACTION STUFF #########
class BlenderEnvironment(SConsEnvironment):
def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None):
if not self or not libname or not sources:
print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
@ -293,7 +339,7 @@ class BlenderEnvironment(SConsEnvironment):
# note: libs is a global
add_lib_to_dict(libs, libtype, libname, priority)
def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None):
def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''):
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
lenv = self.Copy()
if lenv['OURPLATFORM']=='win32-vc':
@ -311,6 +357,9 @@ class BlenderEnvironment(SConsEnvironment):
prog = lenv.Program(target=builddir+'bin/'+progname, source=sources)
SConsEnvironment.Default(self, prog)
program_list.append(prog)
if lenv['OURPLATFORM']=='darwin':
lenv['BINARYKIND'] = binarykind
lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
## TODO: have register for libs/programs, so that we test only that
# which have expressed their need to be tested in their own sconscript