diff options
author | Jean-Luc Peurière <jlp@nerim.net> | 2006-02-05 14:28:28 +0300 |
---|---|---|
committer | Jean-Luc Peurière <jlp@nerim.net> | 2006-02-05 14:28:28 +0300 |
commit | a91c07715238c3da8bdec8c02fa7322e11cec13e (patch) | |
tree | da7a0cf5d2afaee6f0489bb4a51f514aface62fb | |
parent | 257124a44f98119bd576a6e43fa529506a950c7c (diff) |
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
-rw-r--r-- | SConstruct | 5 | ||||
-rw-r--r-- | config/darwin-config.py | 3 | ||||
-rw-r--r-- | tools/Blender.py | 51 |
3 files changed, 55 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct index cd63bc5fd36..82473f086ad 100644 --- a/SConstruct +++ b/SConstruct @@ -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 diff --git a/config/darwin-config.py b/config/darwin-config.py index 64ede228670..5450897b431 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -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' diff --git a/tools/Blender.py b/tools/Blender.py index e3d4740d0e5..54780738b9b 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -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 |