diff --git a/boswars-2.7-sconstruct-py3.patch b/boswars-2.7-sconstruct-py3.patch new file mode 100644 index 0000000..907fc71 --- /dev/null +++ b/boswars-2.7-sconstruct-py3.patch @@ -0,0 +1,148 @@ +diff -up boswars/SConstruct.orig boswars/SConstruct +--- boswars/SConstruct.orig 2019-02-18 13:24:41.686792985 +0100 ++++ boswars/SConstruct 2019-02-18 13:25:32.790212451 +0100 +@@ -81,63 +81,6 @@ def buildSourcesList(builddir): + return sources + sourcesEngine = buildSourcesList('build') + +-def ParseConfig(env, command, function=None): +- import subprocess +- +- """ +- Copied from the scons, copyright 2001-2004 The SCons Foundation. +- Adapted by Francois Beerten to use the exit value of pkg-config. +- """ +- # the default parse function +- def parse_conf(env, output): +- flags = { +- 'ASFLAGS' : [], +- 'CCFLAGS' : [], +- 'CPPFLAGS' : [], +- 'CPPPATH' : [], +- 'LIBPATH' : [], +- 'LIBS' : [], +- 'LINKFLAGS' : [], +- } +- static_libs = [] +- +- params = output.split() +- for arg in params: +- if arg[0] != '-': +- static_libs.append(arg) +- elif arg[:2] == '-L': +- flags['LIBPATH'].append(arg[2:]) +- elif arg[:2] == '-l': +- flags['LIBS'].append(arg[2:]) +- elif arg[:2] == '-I': +- flags['CPPPATH'].append(arg[2:]) +- elif arg[:4] == '-Wa,': +- flags['ASFLAGS'].append(arg) +- elif arg[:4] == '-Wl,': +- flags['LINKFLAGS'].append(arg) +- elif arg[:4] == '-Wp,': +- flags['CPPFLAGS'].append(arg) +- elif arg == '-pthread': +- flags['CCFLAGS'].append(arg) +- flags['LINKFLAGS'].append(arg) +- else: +- flags['CCFLAGS'].append(arg) +- apply(env.Append, (), flags) +- return static_libs +- +- if function is None: +- function = parse_conf +- if type(command) is type(""): +- command = [env.subst(i) for i in command.split()] +- p = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) +- read,_ = p.communicate() +- exitcode = p.wait() +- if exitcode == 0: +- return (0, function(env, read)) +- else: +- return (exitcode, []) +- + def CheckOpenGL(env, conf): + opengl = {} + opengl['linux'] = { +@@ -169,12 +169,7 @@ def CheckOpenGL(env, conf): + return True + + def CheckLuaLib(env, conf): +- if not 'USE_WIN32' in env['CPPDEFINES']: +- if env.WhereIs('pkg-config'): +- for packagename in ['lua-5.1', 'lua51', 'lua']: +- exitcode,_ = ParseConfig(env, 'pkg-config --cflags --libs ' + packagename) +- if exitcode == 0: +- break ++ env.ParseConfig('pkg-config --cflags --libs lua-5.1') + if conf.CheckLibWithHeader('lua-5.1', 'lua.h', 'c'): + return 1 + if conf.CheckLibWithHeader('lua5.1', 'lua.h', 'c'): +@@ -185,22 +127,34 @@ def CheckLuaLib(env, conf): + def AutoConfigure(env): + conf = Configure(env) + ++ ## Ensure all these are in the env dict, to avoid key errors later ++ flags = { ++ 'ASFLAGS' : [], ++ 'CCFLAGS' : [], ++ 'CPPFLAGS' : [], ++ 'CPPPATH' : [], ++ 'LIBPATH' : [], ++ 'LIBS' : [], ++ 'LINKFLAGS' : [], ++ } ++ env.Append(*(), **flags) ++ + ## check for required libs ## + if not conf.CheckLibWithHeader('png', 'png.h', 'c'): +- print 'Did not find png library or headers, exiting!' ++ print('Did not find png library or headers, exiting!') + Exit(1) + if not conf.CheckLibWithHeader('z', 'zlib.h', 'c'): +- print 'Did not find the zlib library or headers, exiting!' ++ print('Did not find the zlib library or headers, exiting!') + Exit(1) + if not 'USE_WIN32' in env['CPPDEFINES'] and not sys.platform.startswith('freebsd'): + if not conf.CheckLib('dl'): +- print 'Did not find dl library or header which is needed on some systems for lua. Exiting!' ++ print('Did not find dl library or header which is needed on some systems for lua. Exiting!') + Exit(1) + if not CheckLuaLib(env, conf): +- print 'Did not find required lua library. Exiting!' ++ print('Did not find required lua library. Exiting!') + Exit(1) + if not CheckOpenGL(env, conf): +- print 'Did not find required OpenGL library. Exiting!' ++ print('Did not find required OpenGL library. Exiting!') + Exit(1) + + # Check for optional libraries # +@@ -232,7 +232,7 @@ def AutoConfigure(env): + env.ParseConfig('sdl-config --libs') + if sys.platform != "darwin" and not '-Dmain=SDL_main' in env['CCFLAGS']: + if not conf.CheckLibWithHeader('SDL', 'SDL.h', 'c'): +- print 'Did not find SDL library or headers, exiting!' ++ print('Did not find SDL library or headers, exiting!') + Exit(1) + + env = conf.Finish() +@@ -245,14 +245,14 @@ def AutoConfigureIfNeeded(env, name): + # Remove outdated cache file + os.remove(cachename) + if optionsChanged or not os.path.exists(cachename): +- print cachename + " doesn't exist or out of date." +- print "Generating new build config cache ..." ++ print(cachename + " doesn't exist or out of date.") ++ print("Generating new build config cache ...") + cache = DefineOptions(cachename, {}) + AutoConfigure(env) + cache.Save(cachename, env) + else: + cache = DefineOptions(cachename, {}) +- print "Using " + cachename ++ print("Using " + cachename) + cache.Update(env) + + AutoConfigureIfNeeded(env, '') diff --git a/boswars.spec b/boswars.spec index 03f0957..c5d3216 100644 --- a/boswars.spec +++ b/boswars.spec @@ -1,6 +1,6 @@ Name: boswars Version: 2.7 -Release: 17.svn160110%{?dist} +Release: 18.svn160110%{?dist} Summary: Bos Wars is a futuristic real-time strategy game License: GPLv2 URL: http://www.boswars.org/ @@ -17,9 +17,10 @@ Patch0: boswars-2.4.1-SConstruct.patch #Patch2: boswars-2.6.1-lua-5.2.patch # Use compat-lua51 for now Patch3: boswars-2.7-compat-lua-5.1.patch +Patch4: boswars-2.7-sconstruct-py3.patch BuildRequires: libtheora-devel libvorbis-devel SDL-devel libGL-devel -BuildRequires: compat-tolua++-devel libpng-devel scons desktop-file-utils -BuildRequires: libappstream-glib +BuildRequires: compat-tolua++-devel libpng-devel python3-scons +BuildRequires: libappstream-glib desktop-file-utils Requires: hicolor-icon-theme xorg-x11-utils %description @@ -29,9 +30,7 @@ Bos Wars aims to create a completly original and fun open source RTS game. %prep -%setup -q -n %{name} -%patch0 -p1 -%patch3 -p1 +%autosetup -p1 -n %{name} iconv -f ISO-8859-1 -t UTF8 doc/guichan-copyright.txt > guichan-copyright.txt find campaigns engine maps -type f -executable -exec chmod -x {} ';' # we want to use the system version of these @@ -39,7 +38,7 @@ rm engine/tolua/*.h engine/tolua/tolua_*.cpp %build -scons %{?_smp_mflags} opengl=1 CC="gcc $RPM_OPT_FLAGS" CXX="g++ $RPM_OPT_FLAGS" +scons-3 %{?_smp_mflags} opengl=1 CC="gcc $RPM_OPT_FLAGS" CXX="g++ $RPM_OPT_FLAGS" LIBPATH=%{_libdir} %install @@ -76,6 +75,10 @@ install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man6 %changelog +* Mon Feb 18 2019 Hans de Goede - 2.7-18.svn160110 +- Fix FTBFS with scons-3.0.4 (rhbz#1674710) +- Switch to python3-scons + * Thu Jan 31 2019 Fedora Release Engineering - 2.7-17.svn160110 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild