Commits

Anonymous committed 1a90db8

Added SVN revision to generated SIS

  • Participants
  • Parent commits eb2813c
  • Branches symbian_s60

Comments (0)

Files changed (2)

File symbian/BuildPygameRelease.py

-""" Full build configuration for pygame """
+""" Full build configuration for pygame 
+For SVN support, install pysvn.
+"""
 
 import sys
 import time
 
 from glob import glob
 from scons_symbian.config.constants import CAPS_SELF_SIGNED
+from scons_symbian.arguments import COMPILER, RELEASE
+
 
 BASE_CMD = "scons dosis=true"
 
     # Build pygame
     args["pythonsis"]  = sisname
     args["pythonsis"]  = sisname
-    args["sisappname"] = '"pygame for S60"'
-    args["package"]    = "pygame_%s.sis" % version
+    args["sisappname"] = '"pygame for S60"' 
     args['sisversion'] = '1,%d,%d%s' % ( int(version[2:4]), int( version[4:6]),version[6:])
     args['sisuid'] = hex(UID_PACKAGE).replace("L","")
     args['appuid'] = hex(UID_PYGAMEAPP).replace("L","")

File symbian/SConstruct

+import time
 from scons_symbian import *
 
+constants.SIGNSIS_OUTPUT_EXTENSION = ".sisx"
 gcce.GCCE_OPTIMIZATION_FLAGS = "-O2 -fno-unit-at-a-time"
 
+
+SVNREVISION = ""
+
+#-------------------------------------------------------------------Get SVN info
+try:
+    import pysvn
+    SVNCLIENT = pysvn.Client()
+    SVNREVISION = "_SVN-%d" % ( SVNCLIENT.info(".")["revision"].number )
+except ImportError:
+    pass
+
+#-------------------------------------------------------------Initialize globals
+
+DATE = list(time.gmtime()[:3])    
+DATE = [ str(x).zfill(2) for x in DATE ]
+DATE = "".join( DATE )    
+
 # Pygame's installer package
-PACKAGE_NAME = ARGUMENTS.get( "package",    "pygame.sis" )
+PACKAGE_NAME = ARGUMENTS.get( "package", "pygame-S60%(REVISION)s_%(DATE)s_%(COMPILER)s-%(RELEASE)s.sis" % \
+                            {   "DATE"     : DATE, 
+                                "REVISION" : SVNREVISION, 
+                                "COMPILER" : COMPILER.upper(), 
+                                "RELEASE"  : RELEASE.upper() 
+                            } )
 
 #: Name of the title on installer.
 PACKAGE_TITLE = ARGUMENTS.get( "sisappname", "pygame for S60" )
 else:
     C_LIBRARY = ["estlib"]
     C_INCLUDE = join( EPOC32_INCLUDE, "libc" )
-     
-UID_PACKAGE    = ARGUMENTS.get( "sisuid" )
-UID_PYGAMEAPP  = ARGUMENTS.get( "appuid" )
-UID_SDL        = ARGUMENTS.get( "sdluid" )
-UID_JPEG       = ARGUMENTS.get( "jpeguid" )
-UID_PNG        = ARGUMENTS.get( "pnguid" )
 
 CAPABILITIES  = ARGUMENTS.get( "capabilities", "").split("+")
-if len(CAPABILITIES) == 0: CAPABILITIES = CAPS_SELF_SIGNED
+if len(CAPABILITIES) == 0:
+    CAPABILITIES = CAPS_SELF_SIGNED
+    constants.SIGNSIS_OUTPUT_EXTENSION = "selfsigned.sisx"
 
 SISVERSION    = ARGUMENTS.get( "sisversion", "1,0,0").split(",")
 PYTHON_INCLUDE = ARGUMENTS.get( "pythoninclude", EPOC32_INCLUDE + "/python")
 KEY  = ARGUMENTS.get("privkey", None)
 PASSPHRASE  = ARGUMENTS.get("passphrase", "" )
 
+#-----------------------------------------------------------------------Get UIDs     
+UID_PACKAGE    = ARGUMENTS.get( "sisuid" )
+UID_PYGAMEAPP  = ARGUMENTS.get( "appuid" )
+UID_SDL        = ARGUMENTS.get( "sdluid" )
+UID_JPEG       = ARGUMENTS.get( "jpeguid" )
+UID_PNG        = ARGUMENTS.get( "pnguid" )
+
 
 EMBEDDED_PYTHON_SIS = ARGUMENTS.get( "pythonsis", "none" )
 if EMBEDDED_PYTHON_SIS.lower() != "none" and COMPILER != COMPILER_WINSCW: