Advertisement
Guest User

gtkradiant.avoid-svn-dl_remove-bundled-libs.patch

a guest
Apr 1st, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.65 KB | None | 0 0
  1. diff -u ../Gtkradiant.orig/config.py ./config.py
  2. --- ../Gtkradiant.orig/config.py 2013-03-30 15:24:40.000000000 +0100
  3. +++ ./config.py 2013-04-01 16:22:41.952115000 +0200
  4. @@ -3,12 +3,19 @@
  5. if __name__ != '__main__':
  6. from SCons.Script import *
  7.  
  8. -import utils, urllib2, zipfile, shutil, pprint, subprocess, re, os.path
  9. +import utils, urllib2, zipfile, shutil, pprint, subprocess, re
  10.  
  11. # config = debug release
  12. +# aliases are going to be very needed here
  13. +# we have dependency situations too
  14. # target =
  15.  
  16. class Config:
  17. + # not used atm, but useful to keep a list in mind
  18. + # may use them eventually for the 'all' and other aliases expansions?
  19. + target_choices = utils.Enum( 'radiant', 'q3map2', 'q3data', 'setup' )
  20. + config_choices = utils.Enum( 'debug', 'release' )
  21. +
  22. # aliases
  23. # 'all' -> for each choices
  24. # 'gamecode' for the targets, 'game' 'cgame' 'ui'
  25. @@ -25,8 +32,8 @@
  26.  
  27. # platforms for which to assemble a setup
  28. self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ]
  29. - # paks to assemble in the setup
  30. - self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ]
  31. + # paks to assemble in the setup
  32. + self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ]
  33.  
  34. def __repr__( self ):
  35. return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected )
  36. @@ -97,7 +104,7 @@
  37. 'plugins/entity/entity.vcproj',
  38. 'plugins/image/image.vcproj',
  39. 'plugins/model/model.vcproj',
  40. - 'plugins/imagepng/imagepng.vcproj',
  41. +# 'plugins/imagepng/imagepng.vcproj',
  42. 'plugins/imagewal/imagewal.vcproj',
  43. 'plugins/imagehl/imagehl.vcproj',
  44. 'plugins/imagem8/imagem8.vcproj',
  45. @@ -201,7 +208,7 @@
  46. Depends( finish_command, DEFAULT_TARGETS )
  47. Default( finish_command )
  48.  
  49. - def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False, useZ = False, usePNG = False ):
  50. + def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useZ = False ):
  51. env['CC'] = self.cc
  52. env['CXX'] = self.cxx
  53. ( ret, xml2 ) = commands.getstatusoutput( 'xml2-config --cflags' )
  54. @@ -212,24 +219,42 @@
  55. env.Append( LINKFLAGS = xml2libs.split( ' ' ) )
  56. baseflags = [ '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ]
  57.  
  58. + if ( self.platform == 'Darwin' ):
  59. + env.Append( CPPPATH = [ '/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' ] )
  60. +
  61. if ( useGtk ):
  62. - env.ParseConfig( 'pkg-config gtk+-2.0 --cflags --libs' )
  63. - env.ParseConfig( 'pkg-config x11 --cflags --libs' )
  64. + ( ret, gtk2 ) = commands.getstatusoutput( 'pkg-config gtk+-2.0 --cflags' )
  65. + if ( ret != 0 ):
  66. + print 'pkg-config gtk+-2.0 failed'
  67. + assert( False )
  68. + baseflags += gtk2.split( ' ' )
  69. + gtk2libs = commands.getoutput( 'pkg-config gtk+-2.0 --libs' )
  70. + env.Append( LINKFLAGS = gtk2libs.split( ' ' ) )
  71. else:
  72. # always setup at least glib
  73. - env.ParseConfig( 'pkg-config glib-2.0 --cflags --libs' )
  74. + ( ret, glib ) = commands.getstatusoutput( 'pkg-config glib-2.0 --cflags' )
  75. + if ( ret != 0 ):
  76. + print 'pkg-config glib-2.0 failed'
  77. + assert( False )
  78. + baseflags += glib.split( ' ' )
  79. + gliblibs = commands.getoutput( 'pkg-config glib-2.0 --libs' )
  80. + env.Append( LINKFLAGS = gliblibs.split( ' ' ) )
  81.  
  82. if ( useGtkGL ):
  83. - env.ParseConfig( 'pkg-config glu --cflags --libs' )
  84. - env.ParseConfig( 'pkg-config gtkglext-1.0 --cflags --libs' )
  85. - if ( useJPEG ):
  86. - env.Append( LIBS = 'jpeg' )
  87. - if ( usePNG ):
  88. - pnglibs = 'png'
  89. - env.Append( LIBS = pnglibs.split( ' ' ) )
  90. - env.ParseConfig( 'pkg-config zlib --cflags --libs' )
  91. - if ( useZ ):
  92. - env.ParseConfig( 'pkg-config zlib --cflags --libs' )
  93. + ( ret, gtkgl ) = commands.getstatusoutput( 'pkg-config gtkglext-1.0 --cflags' )
  94. + if ( ret != 0 ):
  95. + print 'pkg-config gtkglext-1.0 failed'
  96. + assert( False )
  97. + baseflags += gtkgl.split( ' ' )
  98. + gtkgllibs = commands.getoutput( 'pkg-config gtkglext-1.0 --libs' )
  99. + env.Append( LINKFLAGS = gtkgllibs.split( ' ' ) )
  100. +# if ( useJPEG ):
  101. +# env.Append( LIBS = 'jpeg' )
  102. +# if ( usePNG ):
  103. +# pnglibs = 'png z'
  104. +# env.Append( LIBS = pnglibs.split( ' ' ) )
  105. + if ( useZ ):
  106. + env.Append( LIBS = 'z' )
  107.  
  108. env.Append( CCFLAGS = baseflags )
  109. env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] )
  110. @@ -246,19 +271,19 @@
  111. # this lets us catch libjpg and libpng libraries that we put in the same directory as radiant.bin
  112. env.Append( LINKFLAGS = '-Wl,-rpath,.' )
  113.  
  114. - def CheckoutOrUpdate( self, svnurl, path ):
  115. - if ( os.path.exists( path ) ):
  116. - cmd = [ 'svn', 'update', path ]
  117. - else:
  118. - cmd = [ 'svn', 'checkout', svnurl, path ]
  119. - print( repr( cmd ) )
  120. - subprocess.check_call( cmd )
  121. -
  122. -
  123. - def FetchGamePaks( self, path ):
  124. - for pak in self.setup_packs:
  125. - svnurl = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pak
  126. - self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) )
  127. +# def CheckoutOrUpdate( self, svnurl, path ):
  128. +# if ( os.path.exists( path ) ):
  129. +# cmd = [ 'svn', 'update', path ]
  130. +# else:
  131. +# cmd = [ 'svn', 'checkout', svnurl, path ]
  132. +# print( repr( cmd ) )
  133. +# subprocess.check_call( cmd )
  134. +#
  135. +#
  136. +# def FetchGamePaks( self, path ):
  137. +# for pak in self.setup_packs:
  138. +# svnurl = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pak
  139. +# self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) )
  140.  
  141. def CopyTree( self, src, dst):
  142. for root, dirs, files in os.walk( src ):
  143. @@ -277,7 +302,9 @@
  144. pass
  145. else:
  146. # special case, fetch external paks under the local install directory
  147. - self.FetchGamePaks( self.install_directory )
  148. +# self.FetchGamePaks( self.install_directory )
  149. +#fedora "patch" to avoid download the whole archive every rpmbuild
  150. + pass
  151. # NOTE: unrelated to self.setup_platforms - grab support files and binaries and install them
  152. if ( self.platform == 'Windows' ):
  153. backup_cwd = os.getcwd()
  154. @@ -285,7 +312,7 @@
  155. 'gtk+-bundle-2.16.6-20100912-3-win32.zip',
  156. 'gtkglext-1.2.0-3-win32.zip',
  157. 'libxml2-2.7.3-2-win32.zip',
  158. - 'jpeg-8c-4-win32.zip',
  159. +# 'jpeg-8c-4-win32.zip',
  160. 'STLport-5.2.1-4.zip'
  161. ]:
  162. if ( not os.path.exists( lib_archive ) ):
  163. @@ -335,7 +362,7 @@
  164. 'gtk-2.16.6/bin/libpangocairo-1.0-0.dll',
  165. 'gtk-2.16.6/bin/libpangoft2-1.0-0.dll',
  166. 'gtk-2.16.6/bin/libpangowin32-1.0-0.dll',
  167. - 'gtk-2.16.6/bin/libpng14-14.dll',
  168. +# 'gtk-2.16.6/bin/libpng14-14.dll',
  169. 'gtk-2.16.6/bin/zlib1.dll',
  170. 'gtk-2.16.6/lib/GNU.Gettext.dll',
  171. 'gtk-2.16.6/lib/gtk-2.0/2.10.0/engines/libpixmap.dll',
  172. @@ -368,13 +395,13 @@
  173. match = filter( lambda l : l.find( libname ) != -1, output.split( '\n' ) )[0]
  174. return re.split( '.*=> (.*) .*', match )[1]
  175.  
  176. - jpeg_path = find_library( module_ldd, 'libjpeg' )
  177. - print( 'JPEG library: %s' % repr( jpeg_path ) )
  178. - png_path = find_library( module_ldd, 'libpng' )
  179. - print( 'PNG library: %s' % repr( png_path ) )
  180. +# jpeg_path = find_library( module_ldd, 'libjpeg' )
  181. +# print( 'JPEG library: %s' % repr( jpeg_path ) )
  182. +# png_path = find_library( module_ldd, 'libpng' )
  183. +# print( 'PNG library: %s' % repr( png_path ) )
  184.  
  185. - shutil.copy( jpeg_path, 'install' )
  186. - shutil.copy( png_path, 'install' )
  187. +# shutil.copy( jpeg_path, 'install' )
  188. +# shutil.copy( png_path, 'install' )
  189.  
  190. # parse the config statement line to produce/update an existing config list
  191. # the configs expose a list of keywords and accepted values, which the engine parses out
  192. Sottodirectory in comune: ../Gtkradiant.orig/contrib e ./contrib
  193. Sottodirectory in comune: ../Gtkradiant.orig/docs e ./docs
  194. Sottodirectory in comune: ../Gtkradiant.orig/include e ./include
  195. Sottodirectory in comune: ../Gtkradiant.orig/install e ./install
  196. Sottodirectory in comune: ../Gtkradiant.orig/libs e ./libs
  197. Sottodirectory in comune: ../Gtkradiant.orig/plugins e ./plugins
  198. Sottodirectory in comune: ../Gtkradiant.orig/po e ./po
  199. Sottodirectory in comune: ../Gtkradiant.orig/radiant e ./radiant
  200. Sottodirectory in comune: ../Gtkradiant.orig/regression_tests e ./regression_tests
  201. diff -u ../Gtkradiant.orig/SConscript.module ./SConscript.module
  202. --- ../Gtkradiant.orig/SConscript.module 2013-03-30 15:24:40.000000000 +0100
  203. +++ ./SConscript.module 2013-04-01 17:00:03.520036341 +0200
  204. @@ -10,14 +10,15 @@
  205. ( libpath, libname ) = os.path.split( project )
  206. libname = os.path.splitext( libname )[0]
  207.  
  208. -env = Environment( ENV = os.environ )
  209. +env = Environment()
  210.  
  211. -useJPEG = True
  212. +#useJPEG = True
  213. useGtk = True
  214. useZ = True
  215. -usePNG = True
  216. +#usePNG = True
  217.  
  218. -settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useJPEG = useJPEG, useZ = useZ, usePNG = usePNG )
  219. +#settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useJPEG = useJPEG, useZ = useZ, usePNG = usePNG )
  220. +settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useZ = useZ )
  221. proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) )
  222.  
  223. # some filtering. may need to improve that
  224. Sottodirectory in comune: ../Gtkradiant.orig/tools e ./tools
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement