Scons/darwin (OSX): blender.app package is now created correctly in the install folder

This commit is contained in:
Damien Plisson
2010-07-14 18:19:34 +00:00
parent 8e3a9634a3
commit a6a646cf5b

View File

@@ -498,7 +498,9 @@ def AppIt(target=None, source=None, env=None):
builddir, b = os.path.split(a) builddir, b = os.path.split(a)
libdir = env['LCGDIR'][1:] libdir = env['LCGDIR'][1:]
osxarch = env['MACOSX_ARCHITECTURE'] osxarch = env['MACOSX_ARCHITECTURE']
installdir = env['BF_INSTALLDIR']
print("compiled architecture: %s"%(osxarch)) print("compiled architecture: %s"%(osxarch))
print("Installing to %s"%(installdir))
if libdir == '../lib/darwin-9.x.universal': if libdir == '../lib/darwin-9.x.universal':
python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
else: else:
@@ -513,45 +515,45 @@ def AppIt(target=None, source=None, env=None):
sourcedir = bldroot + '/source/darwin/%s.app'%binary sourcedir = bldroot + '/source/darwin/%s.app'%binary
sourceinfo = bldroot + "/source/darwin/%s.app/Contents/Info.plist"%binary sourceinfo = bldroot + "/source/darwin/%s.app/Contents/Info.plist"%binary
targetinfo = builddir +'/' + "%s.app/Contents/Info.plist"%binary targetinfo = installdir +'/' + "%s.app/Contents/Info.plist"%binary
cmd = builddir + '/' +'%s.app'%binary cmd = installdir + '/' +'%s.app'%binary
if os.path.isdir(cmd): if os.path.isdir(cmd):
shutil.rmtree(cmd) shutil.rmtree(cmd)
shutil.copytree(sourcedir, cmd) shutil.copytree(sourcedir, cmd)
cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo) cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,builddir, binary, binary) cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,installdir, binary, binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(builddir, binary, VERSION) cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(installdir, binary, VERSION)
# print cmd # print cmd
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = builddir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION) cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd) shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd) shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,builddir,binary) cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,builddir,binary,VERSION) cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,builddir,binary) cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(builddir,binary, VERSION) cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,builddir,binary,VERSION) cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,builddir,binary,VERSION) cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,builddir,binary,VERSION) cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,builddir,binary,VERSION) cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(builddir,binary, binary) cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(builddir, binary) cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(builddir, binary) cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(builddir, binary) cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd) commands.getoutput(cmd)
# extract copy system python, be sure to update other build systems # extract copy system python, be sure to update other build systems