From 390bc8f0bcd7ee66fdcc80604c94c7135d9157a0 Mon Sep 17 00:00:00 2001 From: OscarL Date: Sun, 21 May 2023 11:45:32 -0300 Subject: [PATCH] btanks: fix build, move to $appsDir. (#8699) Applied some of the Debian patches from: https://sources.debian.org/src/btanks/0.9.8083-9/debian/patches/ Consistent "SDL / BGLView::UnlockGL()" related crash on close. Works nicely otherwise. Closes #7886. --- games-action/btanks/btanks-0.9.8083.recipe | 49 ++-- .../btanks/patches/btanks-0.9.8083.patchset | 42 +++- .../btanks/patches/debian/gcc-4.6.patch | 26 ++ .../btanks/patches/debian/gcc-4.7.patch | 231 ++++++++++++++++++ .../btanks/patches/debian/python3.patch | 98 ++++++++ .../btanks/patches/debian/scons.patch | 112 +++++++++ 6 files changed, 528 insertions(+), 30 deletions(-) create mode 100644 games-action/btanks/patches/debian/gcc-4.6.patch create mode 100644 games-action/btanks/patches/debian/gcc-4.7.patch create mode 100644 games-action/btanks/patches/debian/python3.patch create mode 100644 games-action/btanks/patches/debian/scons.patch diff --git a/games-action/btanks/btanks-0.9.8083.recipe b/games-action/btanks/btanks-0.9.8083.recipe index 88948aeb6..52fa055db 100644 --- a/games-action/btanks/btanks-0.9.8083.recipe +++ b/games-action/btanks/btanks-0.9.8083.recipe @@ -9,25 +9,32 @@ COPYRIGHT="2006-2009 Battle Tanks team 2007-2008 Netive Media Group 2005-2007 Vladimir Menshakov" LICENSE="GNU GPL v2" -REVISION="2" +REVISION="3" SOURCE_URI="http://downloads.sourceforge.net/project/btanks/btanks-source/btanks-$portVersion.tar.bz2" CHECKSUM_SHA256="3fd2ce6a2b45f7a60c3b114fa9aff13cb3dd9fbb6a65cdc9798b76c4fa2c4341" -PATCHES="btanks-$portVersion.patchset" +PATCHES=" + debian/gcc-4.6.patch + debian/gcc-4.7.patch + debian/python3.patch + debian/scons.patch + btanks-$portVersion.patchset + " -ARCHITECTURES="all" +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" PROVIDES=" btanks$secondaryArchSuffix = $portVersion - cmd:btanks$secondaryArchSuffix = $portVersion - cmd:bted$secondaryArchSuffix = $portVersion + app:btanks = $portVersion + app:bted = $portVersion " REQUIRES=" haiku$secondaryArchSuffix lib:libexpat$secondaryArchSuffix lib:libGLU$secondaryArchSuffix lib:liblua$secondaryArchSuffix - lib:libsdl$secondaryArchSuffix - lib:libsdl_image$secondaryArchSuffix + lib:libSDL$secondaryArchSuffix + lib:libSDL_image$secondaryArchSuffix lib:libsmpeg$secondaryArchSuffix lib:libvorbis$secondaryArchSuffix lib:libz$secondaryArchSuffix @@ -38,8 +45,8 @@ BUILD_REQUIRES=" devel:libexpat$secondaryArchSuffix devel:libglu$secondaryArchSuffix devel:liblua$secondaryArchSuffix - devel:libsdl$secondaryArchSuffix - devel:libsdl_image$secondaryArchSuffix + devel:libSDL$secondaryArchSuffix + devel:libSDL_image$secondaryArchSuffix devel:libsmpeg$secondaryArchSuffix devel:libvorbis$secondaryArchSuffix devel:libz$secondaryArchSuffix @@ -55,20 +62,20 @@ BUILD_PREREQUIRES=" BUILD() { - scons $jobArgs . mode=release - sh ./pack-resources.sh + scons $jobArgs . \ + mode=release \ + CXXFLAGS="-Wno-register" \ + prefix="$appsDir/btanks" \ + lib_dir="$appsDir/btanks/lib" \ + plugins_dir="$appsDir/btanks/lib" \ + resources_dir="$appsDir/btanks" } INSTALL() { - mkdir -p $appsDir/btanks/lib - cp btanks bted $appsDir/btanks/ - cp build/release/clunk/libclunk.so \ - build/release/engine/libbtanks_engine.so \ - build/release/mrt/libmrt.so \ - build/release/objects/libbt_objects.so \ - build/release/sdlx/libsdlx.so \ - $appsDir/btanks/lib/ - cp data/tiles/icon.png $appsDir/btanks/ - cp resources.dat $appsDir/btanks/ + scons install + mv $appsDir/btanks/bin/* $appsDir/btanks/ + rm -rf $appsDir/btanks/bin + addAppDeskbarSymlink $appsDir/btanks/btanks "BTanks" + addAppDeskbarSymlink $appsDir/btanks/bted "BTanks Editor" } diff --git a/games-action/btanks/patches/btanks-0.9.8083.patchset b/games-action/btanks/patches/btanks-0.9.8083.patchset index 6301489c5..2ac9f603c 100644 --- a/games-action/btanks/patches/btanks-0.9.8083.patchset +++ b/games-action/btanks/patches/btanks-0.9.8083.patchset @@ -1,4 +1,4 @@ -From 996dae7f1aefc245cf6c43ae29f6ccaea6066c2e Mon Sep 17 00:00:00 2001 +From 2eb219a77d0f2ea6dc87be2cb054a7ea06f6e457 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 17 May 2015 18:03:50 +0000 Subject: Haiku patch @@ -27,7 +27,7 @@ index afdb48f..5637922 100644 + if sys.platform != 'haiku1': + have_sse = conf.CheckLibWithHeader('m', "xmmintrin.h", 'c', '_mm_set_ss(1.0f);', False) + else: -+ have_sse = True ++ have_sse = False else: have_sse = conf.CheckLibWithHeader('kernel32', "xmmintrin.h", 'c', '_mm_set_ss(1.0f);', False) # hackish lib :( @@ -67,7 +67,7 @@ index 4bd218d..8ac233d 100644 #include "mrt/chunk.h" +#ifndef lua_open -+#define lua_open() luaL_newstate() ++#define lua_open() luaL_newstate() +#endif + using namespace luaxx; @@ -296,17 +296,17 @@ index c239b53..1afab0c 100644 if (SDL_GL_LoadLibrary(NULL) != 0) { -- -1.8.3.4 +2.37.3 -From 16a043a288475be461646ba5d4fd76205b148177 Mon Sep 17 00:00:00 2001 +From 075b9c43837b6db1517f1b2844b139f958f059a1 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 17 May 2015 21:20:06 +0000 Subject: Settings directory diff --git a/mrt/directory.cpp b/mrt/directory.cpp -index dfc672f..bdfafe6 100644 +index dfc672f..8881eaa 100644 --- a/mrt/directory.cpp +++ b/mrt/directory.cpp @@ -21,6 +21,10 @@ @@ -320,14 +320,15 @@ index dfc672f..bdfafe6 100644 using namespace mrt; Directory::Directory() : _handle(0) {} -@@ -195,7 +199,13 @@ const std::string Directory::get_home() { +@@ -195,7 +199,14 @@ const std::string Directory::get_home() { } const std::string Directory::get_app_dir(const std::string &name, const std::string &shortname) { +#ifdef __HAIKU__ + char settingsPath[PATH_MAX]; + find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, settingsPath, sizeof(settingsPath)); -+ std::string path = settingsPath + "/" + shortname; ++ std::string path = settingsPath; ++ path += "/" + shortname; +#else std::string path = get_home() + "/." + shortname; +#endif @@ -335,5 +336,28 @@ index dfc672f..bdfafe6 100644 try { dir.create(path); -- -1.8.3.4 +2.37.3 + + +From 631ff04a413b21e7bf6908d13f17177b967b804e Mon Sep 17 00:00:00 2001 +From: Oscar Lesta +Date: Sun, 30 Apr 2023 05:20:41 -0300 +Subject: Fix for Lua 5.3 + + +diff --git a/engine/luaxx/state.cpp b/engine/luaxx/state.cpp +index ddaf0fd..a350386 100644 +--- a/engine/luaxx/state.cpp ++++ b/engine/luaxx/state.cpp +@@ -63,7 +63,7 @@ static const char * chunk_reader(lua_State *L, void *data, size_t *size) { + void State::load(const std::string &fname, const mrt::Chunk &data) { + //throw_ex(("implement me[%s]", fname.c_str())); + reader_state x(data); +- int err = lua_load(state, chunk_reader, &x, fname.c_str(), NULL); ++ int err = lua_load(state, chunk_reader, &x, fname.c_str()); + check_error(state, err); + } + +-- +2.37.3 diff --git a/games-action/btanks/patches/debian/gcc-4.6.patch b/games-action/btanks/patches/debian/gcc-4.6.patch new file mode 100644 index 000000000..d371abd53 --- /dev/null +++ b/games-action/btanks/patches/debian/gcc-4.6.patch @@ -0,0 +1,26 @@ +From: Ansgar Burchardt +Bug-Debian: http://bugs.debian.org/624916 +Subject: Fix FTBFS with gcc-4.6 + +--- btanks-0.9.8083.orig/engine/sl08/sl08.py ++++ btanks-0.9.8083/engine/sl08/sl08.py +@@ -152,8 +152,8 @@ class Generator(object): + typedef base_signalXXX %s signal_type; + typedef return_type (object_type::*func_t) %s; + +- inline slotXXX () : object(NULL), func(NULL) {} +- inline slotXXX(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slotXXX () : object(0), func(0) {} ++ inline slotXXX(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } + inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } +@@ -187,7 +187,7 @@ class Generator(object): + typedef base_signalXXX %s signal_type; + typedef void (object_type::*func_t) %s ; + +- inline slotXXX () : object(NULL), func(NULL) {} ++ inline slotXXX () : object(0), func(0) {} + inline slotXXX (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } + inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } diff --git a/games-action/btanks/patches/debian/gcc-4.7.patch b/games-action/btanks/patches/debian/gcc-4.7.patch new file mode 100644 index 000000000..8f9a2e6c8 --- /dev/null +++ b/games-action/btanks/patches/debian/gcc-4.7.patch @@ -0,0 +1,231 @@ +From: Vincent Legout , Matthias Klose +Bug-Debian: http://bugs.debian.org/667123 +Subject: Fix FTBFS with gcc-4.7 + +Index: btanks-0.9.8083/engine/sl08/sl08.h +=================================================================== +--- btanks-0.9.8083.orig/engine/sl08/sl08.h 2012-05-30 06:48:55.924037180 +0200 ++++ btanks-0.9.8083/engine/sl08/sl08.h 2012-05-30 06:58:12.832049763 +0200 +@@ -92,11 +92,11 @@ + typedef base_signal0 signal_type; + typedef return_type (object_type::*func_t) (); + +- inline slot0 () : object(NULL), func(NULL) {} +- inline slot0(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slot0 () : object(0), func(0) {} ++ inline slot0(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() () const { + return (object->*func) () ; +@@ -114,10 +114,10 @@ + typedef base_signal0 signal_type; + typedef void (object_type::*func_t) () ; + +- inline slot0 () : object(NULL), func(NULL) {} ++ inline slot0 () : object(0), func(0) {} + inline slot0 (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() () const { + (object->*func) (); +@@ -267,11 +267,11 @@ + typedef base_signal1 signal_type; + typedef return_type (object_type::*func_t) (arg1_type a1); + +- inline slot1 () : object(NULL), func(NULL) {} +- inline slot1(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slot1 () : object(0), func(0) {} ++ inline slot1(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() (arg1_type a1) const { + return (object->*func) (a1) ; +@@ -289,10 +289,10 @@ + typedef base_signal1 signal_type; + typedef void (object_type::*func_t) (arg1_type a1) ; + +- inline slot1 () : object(NULL), func(NULL) {} ++ inline slot1 () : object(0), func(0) {} + inline slot1 (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() (arg1_type a1) const { + (object->*func) (a1); +@@ -442,11 +442,11 @@ + typedef base_signal2 signal_type; + typedef return_type (object_type::*func_t) (arg1_type a1, arg2_type a2); + +- inline slot2 () : object(NULL), func(NULL) {} +- inline slot2(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slot2 () : object(0), func(0) {} ++ inline slot2(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() (arg1_type a1, arg2_type a2) const { + return (object->*func) (a1, a2) ; +@@ -464,10 +464,10 @@ + typedef base_signal2 signal_type; + typedef void (object_type::*func_t) (arg1_type a1, arg2_type a2) ; + +- inline slot2 () : object(NULL), func(NULL) {} ++ inline slot2 () : object(0), func(0) {} + inline slot2 (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() (arg1_type a1, arg2_type a2) const { + (object->*func) (a1, a2); +@@ -617,11 +617,11 @@ + typedef base_signal3 signal_type; + typedef return_type (object_type::*func_t) (arg1_type a1, arg2_type a2, arg3_type a3); + +- inline slot3 () : object(NULL), func(NULL) {} +- inline slot3(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slot3 () : object(0), func(0) {} ++ inline slot3(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() (arg1_type a1, arg2_type a2, arg3_type a3) const { + return (object->*func) (a1, a2, a3) ; +@@ -639,10 +639,10 @@ + typedef base_signal3 signal_type; + typedef void (object_type::*func_t) (arg1_type a1, arg2_type a2, arg3_type a3) ; + +- inline slot3 () : object(NULL), func(NULL) {} ++ inline slot3 () : object(0), func(0) {} + inline slot3 (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() (arg1_type a1, arg2_type a2, arg3_type a3) const { + (object->*func) (a1, a2, a3); +@@ -792,11 +792,11 @@ + typedef base_signal4 signal_type; + typedef return_type (object_type::*func_t) (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4); + +- inline slot4 () : object(NULL), func(NULL) {} +- inline slot4(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slot4 () : object(0), func(0) {} ++ inline slot4(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) const { + return (object->*func) (a1, a2, a3, a4) ; +@@ -814,10 +814,10 @@ + typedef base_signal4 signal_type; + typedef void (object_type::*func_t) (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) ; + +- inline slot4 () : object(NULL), func(NULL) {} ++ inline slot4 () : object(0), func(0) {} + inline slot4 (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) const { + (object->*func) (a1, a2, a3, a4); +@@ -967,11 +967,11 @@ + typedef base_signal5 signal_type; + typedef return_type (object_type::*func_t) (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5); + +- inline slot5 () : object(NULL), func(NULL) {} +- inline slot5(object_type *object, func_t func, signal_type * signal = NULL) : object(object), func(func) {} ++ inline slot5 () : object(0), func(0) {} ++ inline slot5(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5) const { + return (object->*func) (a1, a2, a3, a4, a5) ; +@@ -989,10 +989,10 @@ + typedef base_signal5 signal_type; + typedef void (object_type::*func_t) (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5) ; + +- inline slot5 () : object(NULL), func(NULL) {} ++ inline slot5 () : object(0), func(0) {} + inline slot5 (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() (arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5) const { + (object->*func) (a1, a2, a3, a4, a5); +Index: btanks-0.9.8083/engine/sl08/sl08.py +=================================================================== +--- btanks-0.9.8083.orig/engine/sl08/sl08.py 2012-05-30 06:48:55.916037177 +0200 ++++ btanks-0.9.8083/engine/sl08/sl08.py 2012-05-30 06:49:25.000000000 +0200 +@@ -156,7 +156,7 @@ + inline slotXXX(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {} + + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); } + + inline return_type operator() %s const { + return (object->*func) %s ; +@@ -190,7 +190,7 @@ + inline slotXXX () : object(0), func(0) {} + inline slotXXX (object_type *object, func_t func) : object(object), func(func) {} + inline void assign(object_type *o, func_t f) { object = o; func = f; } +- inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); } ++ inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); } + + inline void operator() %s const { + (object->*func) %s; +Index: btanks-0.9.8083/math/range_list.h +=================================================================== +--- btanks-0.9.8083.orig/math/range_list.h 2008-10-24 16:15:55.000000000 +0200 ++++ btanks-0.9.8083/math/range_list.h 2012-05-30 06:53:15.232047856 +0200 +@@ -53,14 +53,14 @@ + return; + } + +- typename parent_type::iterator i = lower_bound(value); ++ typename parent_type::iterator i = this->lower_bound(value); + if (i != parent_type::end()) { + if (i->first == value) + return; + + if (value + 1 == i->first) { + T e = i->second; +- erase(i); ++ this->erase(i); + i = parent_type::insert(typename parent_type::value_type(value, e)).first; //expand beginning + i = pack_left(i); + } +Index: btanks-0.9.8083/mrt/base_file.h +=================================================================== +--- btanks-0.9.8083.orig/mrt/base_file.h 2009-04-04 22:28:59.000000000 +0200 ++++ btanks-0.9.8083/mrt/base_file.h 2012-05-30 06:58:45.064050493 +0200 +@@ -20,6 +20,7 @@ + */ + + #include ++#include + #include "export_mrt.h" + + namespace mrt { diff --git a/games-action/btanks/patches/debian/python3.patch b/games-action/btanks/patches/debian/python3.patch new file mode 100644 index 000000000..3e6eeefd6 --- /dev/null +++ b/games-action/btanks/patches/debian/python3.patch @@ -0,0 +1,98 @@ +Description: Convert sl08.py to Python 3 +Author: Moritz Muehlenhoff +Bug-Debian: https://bugs.debian.org/936245 + +--- btanks-0.9.8083.orig/engine/sl08/sl08.py ++++ btanks-0.9.8083/engine/sl08/sl08.py +@@ -26,7 +26,7 @@ class Generator(object): + + def prototype(self, proto): + r = '(' +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + if proto: + r = r + "arg%d_type " %(i + 1) + r = r + "a%d" %(i + 1) +@@ -41,14 +41,14 @@ class Generator(object): + r = ' 0: + r = r + ", " + r = r + "typename arg%d_type" %(i + 1) + r = r + ">" + return r + elif cname == 'signal': +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + if not void or i > 0: + r = r + ", " + r = r + "typename arg%d_type" %(i + 1) +@@ -61,7 +61,7 @@ class Generator(object): + r = r + "class validator_type = default_validator >" + return r + elif cname == 'slot': +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + if not void or i > 0: + r = r + ", " + r = r + "typename arg%d_type" %(i + 1) +@@ -70,7 +70,7 @@ class Generator(object): + r = r + "class object_type>" + return r + elif cname == 'base-slot': +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + if not void or i > 0: + r = r + ", " + r = r + "typename arg%d_type" %(i + 1) +@@ -86,22 +86,22 @@ class Generator(object): + r = '" + return r + elif cname == 'signal': +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + r = r + ", arg%d_type" %(i + 1) + r = r + ", validator_type>" + return r + elif cname == 'slot': +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + r = r + ", arg%d_type" %(i + 1) + r = r + ", object_type>" + return r + elif cname == 'base-slot': +- for i in xrange(0, self.__n): ++ for i in range(0, self.__n): + r = r + ", arg%d_type" %(i + 1) + r = r + ">" + return r +@@ -329,11 +329,11 @@ class Generator(object): + + + text = '' +-for i in xrange(0, 6): ++for i in range(0, 6): + g = Generator(i) + text = text + "\n" + g.generate(); + +-print """#ifndef BTANKS_SL08_SLOTSANDSIGNALS_H__ ++print("""#ifndef BTANKS_SL08_SLOTSANDSIGNALS_H__ + #define BTANKS_SL08_SLOTSANDSIGNALS_H__ + + /* sl08 - small slot/signals library +@@ -387,5 +387,5 @@ namespace sl08 { + } + + #endif +-""" %(text); ++""" %(text)); + diff --git a/games-action/btanks/patches/debian/scons.patch b/games-action/btanks/patches/debian/scons.patch new file mode 100644 index 000000000..6de2b04cc --- /dev/null +++ b/games-action/btanks/patches/debian/scons.patch @@ -0,0 +1,112 @@ +Author: Reiner Herrmann +Description: Fix build with recent scons version +Bug-Debian: https://bugs.debian.org/947555 + +--- a/SConstruct ++++ b/SConstruct +@@ -16,7 +16,7 @@ + env['BUILDERS']['StaticLibrary'] = picLibBuilder + env['BUILDERS']['Library'] = picLibBuilder + +-opts = Options(['options.cache']) ++opts = Variables(['options.cache']) + #opts.Add('CC', 'C compiler') + #opts.Add('CXX', 'C++ compiler') + opts.Add('CCFLAGS', 'General options that are passed to the C compiler') +@@ -33,9 +33,9 @@ + opts.Add('lib_dir', 'resources directory (default: prefix/lib)', '') + opts.Add('plugins_dir', 'plugins directory (default: prefix/lib/btanks)', '') + opts.Add('resources_dir', 'resources directory (default: prefix/share/btanks)', '') +- opts.Add(BoolOption('gcc_visibility', 'gcc visibility', 'true')) ++ opts.Add(BoolVariable('gcc_visibility', 'gcc visibility', 'true')) + +-opts.Add(EnumOption('mode', 'build mode', 'release', allowed_values=('debug','release'))) ++opts.Add(EnumVariable('mode', 'build mode', 'release', allowed_values=('debug','release'))) + + opts.Update(env) + opts.Save('options.cache', env.Clone()) +@@ -47,15 +47,15 @@ + Export('debug') + + import SCons.Util +-if os.environ.has_key('CC'): ++if 'CC' in os.environ: + env['CC'] = os.environ['CC'] +-if os.environ.has_key('CFLAGS'): ++if 'CFLAGS' in os.environ: + env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) +-if os.environ.has_key('CXX'): ++if 'CXX' in os.environ: + env['CXX'] = os.environ['CXX'] +-if os.environ.has_key('CXXFLAGS'): ++if 'CXXFLAGS' in os.environ: + env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) +-if os.environ.has_key('LDFLAGS'): ++if 'LDFLAGS' in os.environ: + env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) + + if (sys.platform != "win32" and env['gcc_visibility']): +@@ -174,7 +174,7 @@ + lib_dir = '.' + plugins_dir = '' + try : +- version_file = file('.svnversion', 'r') ++ version_file = open('.svnversion', 'r') + try : + version = version_file.readline().strip() + prefix = env['prefix'] +@@ -202,7 +202,7 @@ + + except: + info = sys.exc_info() +- print "%s %s %s" %(info[0], info[1], info[2]) ++ print("%s %s %s" %(info[0], info[1], info[2])) + except : + svnversion = os.popen('svnversion -n .', 'r') + version = svnversion.readline().strip() +@@ -243,29 +243,29 @@ + Export('plugins_dir') + + version = '0.9.%s' %version +-print "version: %s" %version ++print("version: %s" %version) + + bt_sublibs = ['mrt', 'sdlx', 'objects', 'clunk'] + env.Append(CPPPATH=['#']) + + if (os.path.exists('private')): + dir = 'private' +- BuildDir('#/build/' + buildmode + '/' + dir, dir, 0) ++ VariantDir('#/build/' + buildmode + '/' + dir, dir, 0) + SConscript('#/build/' + buildmode + '/' + dir + '/SConscript') + + for dir in bt_sublibs: +- BuildDir('#/build/' + buildmode + '/' + dir, dir, 0) ++ VariantDir('#/build/' + buildmode + '/' + dir, dir, 0) + SConscript('#/build/' + buildmode + '/' + dir + '/SConscript') + + for dir in bt_sublibs: + env.Append(LIBPATH=['#/build/' + buildmode + '/' + dir]) + +-env.BuildDir('#/build/' + buildmode + '/editor', 'editor', 0) ++env.VariantDir('#/build/' + buildmode + '/editor', 'editor', 0) + SConscript('#/build/' + buildmode + '/editor/SConscript') + + env.Append(LIBPATH=['#/build/' + buildmode + '/engine']) + +-env.BuildDir('#/build/' + buildmode + '/engine', 'engine', 0) ++env.VariantDir('#/build/' + buildmode + '/engine', 'engine', 0) + SConscript('#/build/' + buildmode + '/engine/' + 'SConscript') + + if len(install_targets) > 0: +--- a/mrt/SConscript ++++ b/mrt/SConscript +@@ -20,7 +20,7 @@ + 'net_exception.cpp', 'dict_serializator.cpp', + ], LIBS=libs) + +-if sys.platform != 'win32' and env.has_key('prefix') and len(env['prefix']) > 0: ++if sys.platform != 'win32' and 'prefix' in env and len(env['prefix']) > 0: + Import('install_targets') + Import('lib_dir') + install_targets.append(Install(lib_dir, mrt))