X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=config.py;h=f872a25e1897f981a8e7d6e4a05f8e5af416a2ef;hb=a2a93d30dfcce802e911c14ed67c48d63ebed3e0;hp=07b6483e3676f4e4d89dbbf3994bd52812b00620;hpb=48410b113dd2036e69dbf723a39ec9af02fc9b12;p=xonotic%2Fnetradiant.git diff --git a/config.py b/config.py index 07b6483e..f872a25e 100644 --- a/config.py +++ b/config.py @@ -3,7 +3,7 @@ import sys, traceback, platform, re, commands, platform, subprocess if __name__ != '__main__': from SCons.Script import * -import utils +import utils, urllib2, zipfile, shutil # config = debug release # aliases are going to be very needed here @@ -33,7 +33,7 @@ class Config: # platforms for which to assemble a setup self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] # paks to assemble in the setup - self.setup_packs = [ 'Q3Pack', 'UrTPack', 'UFOAIPack', 'Q2WPack', 'ReactionPack' ] + self.setup_packs = [ 'Q3Pack', 'UrTPack', ] # 'UFOAIPack', 'Q2WPack', 'ReactionPack' ] def __repr__( self ): return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected ) @@ -76,7 +76,7 @@ class Config: config['shared'] = False Export( 'utils', 'settings', 'config' ) build_dir = os.path.join( 'build', config_name, 'radiant' ) - BuildDir( build_dir, '.', duplicate = 0 ) + VariantDir( build_dir, '.', duplicate = 0 ) lib_objects = [] for project in [ 'libs/synapse/synapse.vcproj', 'libs/cmdlib/cmdlib.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj' ]: Export( 'project' ) @@ -93,7 +93,7 @@ class Config: config['shared'] = True Export( 'project', 'config' ) build_dir = os.path.join( 'build', config_name, 'shobjs' ) - BuildDir( build_dir, '.', duplicate = 0 ) + VariantDir( build_dir, '.', duplicate = 0 ) shlib_objects_extra[libname] = SConscript( os.path.join( build_dir, 'SConscript.lib' ) ) for project in [ 'plugins/vfspk3/vfspk3.vcproj', @@ -105,6 +105,7 @@ class Config: 'plugins/model/model.vcproj', 'plugins/imagepng/imagepng.vcproj', 'plugins/imagewal/imagewal.vcproj', + 'plugins/imagehl/imagehl.vcproj', 'plugins/imagem8/imagem8.vcproj', 'plugins/spritemodel/spritemodel.vcproj', 'plugins/textool/textool.vcproj', @@ -157,7 +158,7 @@ class Config: config['shared'] = False Export( 'utils', 'settings', 'config' ) build_dir = os.path.join( 'build', config_name, 'q3map2' ) - BuildDir( build_dir, '.', duplicate = 0 ) + VariantDir( build_dir, '.', duplicate = 0 ) lib_objects = [] for project in [ 'tools/quake3/common/quake3-common.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]: Export( 'project' ) @@ -246,8 +247,8 @@ class Config: env.Append( CXXFLAGS = [ '-g' ] ) env.Append( CPPDEFINES = [ '_DEBUG' ] ) else: - env.Append( CFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations', '-fno-strict-aliasing' ] ) - env.Append( CXXFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations','-fno-strict-aliasing' ] ) + env.Append( CFLAGS = [ '-O2', '-fno-strict-aliasing' ] ) + env.Append( CXXFLAGS = [ '-O2', '-fno-strict-aliasing' ] ) def CheckoutOrUpdate( self, svnurl, path ): if ( os.path.exists( path ) ): @@ -260,9 +261,20 @@ class Config: def FetchGamePaks( self, path ): for pak in self.setup_packs: - if ( pak == 'Q3Pack' or pak == 'UrTPack' or pak == 'UFOAIPack' or pak == 'Q2WPack' or pak == 'ReactionPack' ): - svnurl = 'https://zerowing.idsoftware.com/svn/radiant.gamepacks/%s/trunk' % pak - self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) ) + svnurl = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pak + self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) ) + + def CopyTree( self, src, dst): + for root, dirs, files in os.walk( src ): + target_dir = os.path.join( dst, root[root.find( '/' )+1:] ) + print ( target_dir ) + if ( not os.path.exists( target_dir ) ): + os.mkdir( target_dir ) + + for file in files: + shutil.copy( os.path.join( root, file ), os.path.join( target_dir, file ) ) + + def Setup( self ): try: @@ -283,14 +295,26 @@ class Config: 'STLport-5.2.1-4.zip' ]: if ( not os.path.exists( lib_archive ) ): - cmd = [ 'wget', '-N', 'http://porky.nerius.com/radiant-libs-win32/%s' % lib_archive ] - print( repr( cmd ) ) - subprocess.check_call( cmd ) + print( 'downloading %s' % lib_archive ) + archive_web_request = urllib2.urlopen( 'http://icculus.org/gtkradiant/files/1.6.2/%s' % lib_archive ) + archive_File = open( lib_archive, 'wb' ) + while True: + data = archive_web_request.read( 1048576 ) #read 1mb at a time + if not data: + break + archive_File.write( data ) + + archive_web_request.close() + archive_File.close() + + print( 'unpacking %s' % lib_archive ) lib_archive_path = os.path.abspath( lib_archive ) os.chdir( os.path.dirname( backup_cwd ) ) - cmd = [ 'unzip', '-o', lib_archive_path ] - print( repr( cmd ) ) - subprocess.check_call( cmd ) + + archive_Zip = zipfile.ZipFile( lib_archive_path, 'r' ) + archive_Zip.extractall() + archive_Zip.close() + os.chdir( backup_cwd ) # copy all the dependent runtime data to the install directory @@ -327,18 +351,15 @@ class Config: 'gtkglext-1.2.0/bin/libgtkglext-win32-1.0-0.dll', 'libxml2-2.7.3/bin/libxml2-2.dll' ]: - cmd = [ 'cp', '-v', os.path.join( srcdir, dll ), 'install' ] - print( repr( cmd ) ) - subprocess.check_call( cmd ) + shutil.copy( os.path.join( srcdir, dll ), 'install' ) + for extra in [ 'gtk-2.16.6/etc', 'gtk-2.16.6/share', 'gtkglext-1.2.0/share', 'libxml2-2.7.3/share' ]: - cmd = [ 'cp', '-r', '-v', os.path.join( srcdir, extra ), 'install' ] - print( repr( cmd ) ) - subprocess.check_call( cmd ) + self.CopyTree( os.path.join( srcdir, extra ), 'install' ) # parse the config statement line to produce/update an existing config list # the configs expose a list of keywords and accepted values, which the engine parses out