Changeset 240

Show
Ignore:
Timestamp:
04/05/08 16:38:49 (3 months ago)
Author:
timo
Message:

working on more installation functionality

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant/config.py

    r239 r240  
    1414        # not used atm, but useful to keep a list in mind 
    1515        # may use them eventually for the 'all' and other aliases expansions? 
    16         target_choices = utils.Enum( 'radiant', 'q3map2'
     16        target_choices = utils.Enum( 'radiant', 'q3map2', 'setup'
    1717        config_choices = utils.Enum( 'debug', 'release' ) 
    1818 
     
    3030                self.cxx = 'g++' 
    3131                self.install_directory = 'install' 
     32                 
     33                # platforms for which to assemble a setup 
     34                self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] 
     35                # paks to assemble in the setup 
     36                self.setup_packs = [ 'Q3Pack', 'UrTPack' ] 
    3237 
    3338        def __repr__( self ): 
     
    4853        def _processInstallDir( self, ops ): 
    4954                self.install_directory = os.path.normpath( os.path.expanduser( ops[0] ) ) 
     55 
     56        def _processSetupPlatforms( self, ops ): 
     57                self.setup_platforms = ops 
     58 
     59        def _processSetupPacks( self, ops ): 
     60                self.setup_packs = ops 
    5061 
    5162        def setupParser( self, operators ): 
     
    5566                operators['cxx'] = self._processCXX 
    5667                operators['install_directory'] = self._processInstallDir 
     68                operators['setup_platforms'] = self._processSetupPlatforms 
     69                operators['setup_packs'] = self._processSetupPacks 
    5770 
    5871        def emit_radiant( self ): 
     
    168181                        self.emit_q3map2() 
    169182 
     183                try: 
     184                        self.target_selected.index( 'setup' ) 
     185                except: 
     186                        pass 
     187                else: 
     188                        self.Setup() 
     189 
    170190        def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False, useZ = False, usePNG = False ): 
    171191                env['CC'] = self.cc 
     
    228248                        env.Append( CFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations', '-fno-strict-aliasing' ] ) 
    229249                        env.Append( CXXFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations','-fno-strict-aliasing' ] ) 
    230                         #env.Append( CFLAGS = [ '-march=pentium3' ] ) 
    231  
    232 #               env.Append( LINKFLAGS = [ '-m32' ] ) 
     250 
     251        def CheckoutOrUpdate( self, svnurl, path ): 
     252                if ( os.path.exists( path ) ): 
     253                        # NOTE: check the svnurl matches? 
     254                        cmd = 'svn update "%s"' % path 
     255                        print cmd 
     256                else: 
     257                        cmd = 'svn checkout %s "%s"' % ( svnurl, path ) 
     258                ret = os.system( cmd ) 
     259                if ( ret != 0 ): 
     260                        raise 'checkout or update failed' 
     261                         
     262 
     263        def FetchGamePaks( self, path ): 
     264                for pak in self.setup_packs: 
     265                        if ( pak == 'Q3Pack' or pak == 'UrTPack' ): 
     266                                svnurl = 'https://zerowing.idsoftware.com/svn/radiant.gamepacks/%s/trunk' % pak 
     267                                self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) ) 
     268 
     269        def Setup( self ): 
     270                for platform in self.setup_platforms: 
     271                        if ( platform == 'local' ): 
     272                                # special case, fetch external paks under the local install directory 
     273                                self.FetchGamePaks( self.install_directory ) 
    233274 
    234275# parse the config statement line to produce/update an existing config list 
  • GtkRadiant/branches/ZeroRadiant/radiant/preferences.cpp

    r237 r240  
    32453245        fprintf( fg, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>\n<game\n" ); 
    32463246        fprintf( fg, "  name=\"%s\"\n", m_strName.GetBuffer() ); 
    3247         fprintf( fg, "  gametools=\"%sgames/%s\"\n", g_strAppPath.GetBuffer(), m_strName.GetBuffer() ); 
    32483247        fprintf( fg, "  enginepath=\"%s\"\n", m_strEngine.GetBuffer() ); 
    32493248        switch ( m_availGames[ m_nComboSelect ] ) { 
    32503249        case GAME_Q2: { 
     3250                fprintf( fg, "  gametools=\"%sgames/quake2\"\n", g_strAppPath.GetBuffer() ); 
    32513251                fprintf( fg, "  prefix=\".quake2\"\n" ); 
    32523252                Str source = g_strAppPath.GetBuffer(); 
     
    32593259        } 
    32603260        case GAME_Q3: { 
     3261                fprintf( fg, "  gametools=\"%sgames/quake3\"\n", g_strAppPath.GetBuffer() ); 
    32613262                fprintf( fg, "  prefix=\".q3a\"\n" ); 
    32623263                Str source = g_strAppPath.GetBuffer(); 
     
    32693270        } 
    32703271        case GAME_URT: { 
     3272                fprintf( fg, "  gametools=\"%sgames/q3ut4\"\n", g_strAppPath.GetBuffer() ); 
    32713273                fprintf( fg, "  prefix=\".q3a\"\n" ); 
    32723274                Str source = g_strAppPath.GetBuffer(); 
     
    32793281        } 
    32803282        case GAME_UFOAI: { 
     3283                fprintf( fg, "  gametools=\"%sgames/ufoai\"\n", g_strAppPath.GetBuffer() ); 
    32813284                fprintf( fg, "  prefix=\".ufoai\"\n" ); 
    32823285                Str source = g_strAppPath.GetBuffer(); 
     
    32893292        } 
    32903293        case GAME_Q2W: { 
     3294                fprintf( fg, "  gametools=\"%sgames/q2w\"\n", g_strAppPath.GetBuffer() ); 
    32913295                fprintf( fg, "  prefix=\".quake2world\"\n" ); 
    32923296                Str source = g_strAppPath.GetBuffer(); 
     
    32993303        } 
    33003304        case GAME_WARSOW: { 
     3305                fprintf( fg, "  gametools=\"%sgames/warsow\"\n", g_strAppPath.GetBuffer() ); 
    33013306                fprintf( fg, "  prefix=\".warsow\"\n" ); 
    33023307                Str source = g_strAppPath.GetBuffer(); 
     
    33093314        } 
    33103315        case GAME_NEXUIZ: { 
     3316                fprintf( fg, "  gametools=\"%sgames/nexuiz\"\n", g_strAppPath.GetBuffer() ); 
    33113317                fprintf( fg, "  prefix=\".nexuiz\"\n" ); 
    33123318                Str source = g_strAppPath.GetBuffer();