rpms/widelands/devel widelands.scons.patch, NONE, 1.1 widelands.flagfix.patch, 1.1, 1.2 widelands.spec, 1.2, 1.3

Karol Trzcionka (karlik) fedora-extras-commits at redhat.com
Sun Aug 26 00:26:13 UTC 2007


Author: karlik

Update of /cvs/pkgs/rpms/widelands/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19576/widelands/devel

Modified Files:
	widelands.flagfix.patch widelands.spec 
Added Files:
	widelands.scons.patch 
Log Message:
Patching for compatibility with scons 0.97


widelands.scons.patch:

--- NEW FILE widelands.scons.patch ---
--- ./build/scons-tools/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./build/scons-tools/SConscript	2007-08-25 01:14:21.000000000 +0200
@@ -1,4 +1,5 @@
 Import('env')
+
 from Distribute import distadd
 
 distadd(env, 'build/scons-tools/SConscript')
--- ./build/scons-tools/Distribute.py.org	2007-03-15 21:15:45.000000000 +0100
+++ ./build/scons-tools/Distribute.py	2007-08-25 13:32:36.000000000 +0200
@@ -1,4 +1,5 @@
 import SCons
+from SCons.Script import *
 import os, shutil, glob, distutils.dir_util
 import tempfile, tarfile
 from zipfile import *
@@ -107,7 +108,7 @@ def doinst(target, source, env):
 	shutil.rmtree(tmpdir)
 
 def douninst(target, source, env):
-	for (name, location, compress) in env['INSTFILES']:
+	for (name, location, compress, filetype) in env['INSTFILES']:
 		if os.path.isfile(location):
 			os.remove(location)
 		if os.path.isdir(location):
--- ./build/scons-tools/scons_configure.py.org	2007-03-04 18:25:06.000000000 +0100
+++ ./build/scons-tools/scons_configure.py	2007-08-25 13:36:07.000000000 +0200
@@ -40,48 +40,6 @@ def write_buildid(build_id):
 	build_id_file.close()
 
 ################################################################################
-# verbatim copy from env.ParseConfig for parsing `sdl-config`
-# it's a nested function there, so we can't use it directly
-
-#TODO: this can be dropped once we use scons-0.97
-
-def parse_conf(env, output):
-            dict = {
-                'ASFLAGS'       : [],
-                'CCFLAGS'       : [],
-                'CPPFLAGS'      : [],
-                'CPPPATH'       : [],
-                'LIBPATH'       : [],
-                'LIBS'          : [],
-                'LINKFLAGS'     : [],
-            }
-            static_libs = []
-
-            params = string.split(output)
-            for arg in params:
-                if arg[0] != '-':
-                    static_libs.append(arg)
-                elif arg[:2] == '-L':
-                    dict['LIBPATH'].append(arg[2:])
-                elif arg[:2] == '-l':
-                    dict['LIBS'].append(arg[2:])
-                elif arg[:2] == '-I':
-                    dict['CPPPATH'].append(arg[2:])
-                elif arg[:4] == '-Wa,':
-                    dict['ASFLAGS'].append(arg)
-                elif arg[:4] == '-Wl,':
-                    dict['LINKFLAGS'].append(arg)
-                elif arg[:4] == '-Wp,':
-                    dict['CPPFLAGS'].append(arg)
-                elif arg == '-pthread':
-                    dict['CCFLAGS'].append(arg)
-                    dict['LINKFLAGS'].append(arg)
-                else:
-                    dict['CCFLAGS'].append(arg)
-            apply(env.Append, (), dict)
-            return static_libs
-
-################################################################################
 
 def parse_cli(env):
 	if env['use_ggz']:
@@ -183,24 +141,6 @@ def CheckLinkerFlag(context, link_flag, 
 	context.Result( ret )
 	return
 
-################################################################################
-
-#TODO: this can be dropped once we use scons-0.97
-def ParseSDLConfig(env, confstring):
-	words=confstring.split()
-
-	for i, w in enumerate(words):
-		if w=='-framework':
-#remove implicitly causes the new element i to be the former i+1, so the next
-#two lines remove two consecutive tokens
-			words.remove(w)
-			w2=words.pop(i)
-			env.Append(LINKFLAGS=w+' '+w2)
-
-# problematic flags have been taken care of, call the standard parser
-	parse_conf(env, string.join(words))
-
-	return
 
 ################################################################################
 
@@ -259,7 +199,7 @@ def do_configure(config_h_file, conf, en
 		print 'Could not find an SDL version >= 1.2.8!'
 		env.Exit(1)
 	else:
-		env.ParseConfig(env['sdlconfig']+' --libs --cflags', ParseSDLConfig)
+		env.ParseConfig(env['sdlconfig']+' --libs --cflags')
 
 	#disabled until somebody finds time and courage to actually work on this #fweber
 	#if not conf.CheckParaguiConfig(env):
--- ./doc/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./doc/SConscript	2007-08-25 01:16:34.000000000 +0200
@@ -1,4 +1,4 @@
-Import('env')
+Import('*')
 from Distribute import distadd
 
 #instadd(env, 'doc/filename', 'doc')
--- ./src/editor/tools/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./src/editor/tools/SConscript	2007-08-25 01:18:53.000000000 +0200
@@ -1,7 +1,8 @@
 Import('*')
 
-SRC=Glob('*.cc')
+SRC=simpleglob("*.cc")
 
 localenv=editorenv.Copy()
 
 lib=localenv.StaticLibrary(target='editortools', source=SRC)
+
--- ./src/editor/ui_menus/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./src/editor/ui_menus/SConscript	2007-08-25 01:19:35.000000000 +0200
@@ -1,7 +1,8 @@
 Import('*')
 
-SRC=Glob('*.cc')
+SRC=simpleglob("*.cc")
 
 localenv=editorenv.Copy()
 
 lib=localenv.StaticLibrary(target='editoruimenus', source=SRC)
+
--- ./src/editor/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./src/editor/SConscript	2007-08-25 01:18:17.000000000 +0200
@@ -1,10 +1,10 @@
 Import('*')
 
-SRC=Glob('*.cc')
+SRC=simpleglob("*.cc")
 
 editorenv=srcenv.Copy()
 
-Export('editorenv', 'Glob')
+Export('editorenv')
 
 SConscript('ui_menus/SConscript')
 SConscript('tools/SConscript')
--- ./src/ui/ui_basic/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./src/ui/ui_basic/SConscript	2007-08-25 01:21:35.000000000 +0200
@@ -1,7 +1,8 @@
 Import('*')
 
-SRC=Glob('*.cc')
+SRC=simpleglob("*.cc")
 
 localenv=srcenv.Copy()
 
 lib=localenv.StaticLibrary(target='uibasic', source=SRC)
+
--- ./src/ui/ui_fs_menus/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./src/ui/ui_fs_menus/SConscript	2007-08-25 01:22:02.000000000 +0200
@@ -1,7 +1,8 @@
 Import('*')
 
-SRC=Glob('*.cc')
+SRC=simpleglob("*.cc")
 
 localenv=srcenv.Copy()
 
 lib=localenv.StaticLibrary(target='uifsmenus', source=SRC)
+
--- ./src/SConscript.org	2007-02-19 20:33:47.000000000 +0100
+++ ./src/SConscript	2007-08-25 01:32:11.000000000 +0200
@@ -3,7 +3,7 @@ Import('*')
 #TODO: find a way to remove the .orig files astyle leaves around. Probably in
 #      scons-tools/astyle.py
 
-SRC=Glob('*.cc')
+SRC=simpleglob("*.cc")
 
 srcenv=env.Copy()
 
@@ -16,7 +16,7 @@ srcenv.Append(CPPPATH=[
 		'#/src/editor/ui_menus',
 		])
 
-Export('srcenv', 'Glob')
+Export('srcenv')
 srcenv.Append(LIBS='uibasic', LIBPATH='ui/ui_basic')
 srcenv.Append(LIBS='uifsmenus', LIBPATH='ui/ui_fs_menus')
 srcenv.Append(LIBS='editor', LIBPATH='editor')
@@ -27,7 +27,7 @@ SConscript('editor/SConscript')
 SConscript('ui/ui_basic/SConscript')
 SConscript('ui/ui_fs_menus/SConscript')
 
-INDENTLIST=[
+srcenv.Append(INDENTLIST=[
 	'disk_filesystem.h',
 	'disk_filesystem.cc',
 	'filesystem.h',
@@ -51,8 +51,8 @@ INDENTLIST=[
 	'wlapplication.h',
 	'wlapplication.cc',
 	'zip_exceptions.h',
-	]
-indent=srcenv.astyle(source=INDENTLIST)
+	])
+indent=srcenv.astyle(source=srcenv['INDENTLIST'])
 env.Alias("indent", indent)
 
 binary=srcenv.Program(target='widelands', source=SRC)
--- ./SConstruct.org	2007-03-12 22:39:30.000000000 +0100
+++ ./SConstruct	2007-08-25 13:10:32.000000000 +0200
@@ -13,6 +13,10 @@ from scons_configure import *
 from Distribute import *
 from detect_revision import *
 
+#Sanity checks
+EnsurePythonVersion(2, 4)
+EnsureSConsVersion(0, 97)
+
 #Speedup. If you have problems with inconsistent or wrong builds, look here first
 SetOption('max_drift', 1)
 SetOption('implicit_cache', 1)
@@ -21,37 +25,13 @@ SetOption('implicit_cache', 1)
 print
 
 ########################################################################### Glob
-# glob.glob does not work with BuildDir(), so use the following replacement from
-# http://www.scons.org/cgi-bin/wiki/BuildDirGlob?highlight=%28glob%29
-# which I modified slightly to return a list of filenames instead of nodes
-def Glob(match):
-	"""Similar to glob.glob, except globs SCons nodes, and thus sees
-	generated files and files from build directories.  Basically, it sees
-	anything SCons knows about.  A key subtlety is that since this function
-	operates on generated nodes as well as source nodes on the filesystem,
-	it needs to be called after builders that generate files you want to
-	include.
-	"""
-
-	def fn_filter(node):
-		fn = str(node)
-		return fnmatch.fnmatch(os.path.basename(fn), match)
-
-	here = Dir('.')
-
-	children = here.all_children()
-	nodes = map(File, filter(fn_filter, children))
-	node_srcs = [n.srcnode() for n in nodes]
-	filenames=[]
-
-	src = here.srcnode()
-	if src is not here:
-		src_children = map(File, filter(fn_filter, src.all_children()))
-		for s in src_children:
-			 if s not in node_srcs:
-			 	filenames.append(os.path.basename(str(s)))
+def simpleglob(pattern='*', directory='.'):
+        entries=[]
 
-	return filenames
+	for entry in os.listdir(Dir(directory).srcnode().abspath):
+		if fnmatch.fnmatchcase(entry, pattern):
+			entries.append(entry)
+	return entries
 
 ######################################################### find $ROOT -name $GLOB
 
@@ -289,7 +269,7 @@ print
 
 SConsignFile('build/scons-signatures')
 BUILDDIR='build/'+TARGET+'-'+env['build']
-Export('env', 'Glob', 'BUILDDIR', 'PhonyTarget')
+Export('env', 'BUILDDIR', 'PhonyTarget', 'simpleglob')
 
 ####################################################################### buildcat
 
@@ -336,11 +316,11 @@ instadd(env, 'COPYING', 'doc')
 instadd(env, 'CREDITS', 'doc')
 instadd(env, 'widelands', filetype='binary')
 
-install=env.Install('installtarget', '')
+install=env.Install('installtarget', 'build-widelands.sh')
 Alias('install', install)
 AlwaysBuild(install)
 
-uninstall=env.Uninstall('uninstalltarget', '')
+uninstall=env.Uninstall('uninstalltarget', 'build-widelands.sh')
 Alias('uninstall', uninstall)
 AlwaysBuild(uninstall)
 
@@ -357,7 +337,7 @@ distadd(env, 'SConstruct')
 distadd(env, 'build-widelands.sh')
 distadd(env, 'macos')
 
-dist=env.DistPackage('widelands-'+env['build_id'], '')
+dist=env.DistPackage('widelands-'+env['build_id'], 'build-widelands.sh')
 Alias('dist', dist)
 AlwaysBuild(dist)
 

widelands.flagfix.patch:

Index: widelands.flagfix.patch
===================================================================
RCS file: /cvs/pkgs/rpms/widelands/devel/widelands.flagfix.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- widelands.flagfix.patch	7 May 2007 09:29:12 -0000	1.1
+++ widelands.flagfix.patch	26 Aug 2007 00:26:10 -0000	1.2
@@ -1,6 +1,6 @@
---- ./build/scons-tools/scons_configure.py.flagfix	2007-03-04 18:25:06.000000000 +0100
-+++ ./build/scons-tools/scons_configure.py	2007-04-30 11:41:58.000000000 +0200
-@@ -319,57 +319,4 @@
+--- ./build/scons-tools/scons_configure.py.flagfix	2007-08-25 13:36:07.000000000 +0200
++++ ./build/scons-tools/scons_configure.py	2007-08-25 13:47:16.000000000 +0200
+@@ -259,57 +259,4 @@ def do_configure(config_h_file, conf, en
  			print 'Could not find efence, so doing a debug-efence build is impossible !'
  			env.Exit(1)
  


Index: widelands.spec
===================================================================
RCS file: /cvs/pkgs/rpms/widelands/devel/widelands.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- widelands.spec	8 May 2007 17:41:50 -0000	1.2
+++ widelands.spec	26 Aug 2007 00:26:10 -0000	1.3
@@ -1,15 +1,16 @@
 %define build_id build10
 Name:           widelands
 Version:        0
-Release:        0.4.%{build_id}%{?dist}
+Release:        0.5.%{build_id}%{?dist}
 Summary:        Open source realtime-strategy game
 
 Group:          Amusements/Games
-License:        GPL
+License:        GPLv2+
 URL:            http://www.widelands.org
 Source0:        http://prdownloads.sourceforge.net/%{name}/%{name}-%{build_id}-source.tar.bz2
 Patch0:         widelands.workfix.patch
 Patch1:         widelands.flagfix.patch
+Patch2:         widelands.scons.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: SDL_mixer-devel SDL_image-devel SDL_net-devel SDL_ttf-devel
@@ -31,6 +32,7 @@
 %setup -q -n %{name}
 %patch0 -p0
 %patch1 -p0
+%patch2 -p0
 sed -i 's#LOCALE_PATH "locale"#LOCALE_PATH "%{_datadir}/%{name}/locale"##' src/constants.h
 sed -i 's#flagi#%{optflags}##' build/scons-tools/scons_configure.py
 sed -i 's#doc#txts##' txts/SConscript
@@ -90,6 +92,8 @@
 %{_datadir}/%{name}/*s*
 
 %changelog
+* Sat Aug 25 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.5.build10
+- Patching for compatibility with scons 0.97
 * Tue May 08 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.4.build10
 - Change BRs for ppc64
 * Sun May 06 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.3.build10




More information about the fedora-extras-commits mailing list