diff options
author | danfe <danfe@FreeBSD.org> | 2014-01-15 19:38:05 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2014-01-15 19:38:05 +0800 |
commit | 6f8e5cb37bca987ef994f91de583f85d84099849 (patch) | |
tree | 2507fbbf60dc855d6578c8131086d6b68d7ef610 /games/battletanks | |
parent | be55d75c398bf86742cff0a6f9824bdabc80f167 (diff) | |
download | freebsd-ports-gnome-6f8e5cb37bca987ef994f91de583f85d84099849.tar.gz freebsd-ports-gnome-6f8e5cb37bca987ef994f91de583f85d84099849.tar.zst freebsd-ports-gnome-6f8e5cb37bca987ef994f91de583f85d84099849.zip |
- Unbreak the build with Clang and remove disgusting USE_GCC knob
- Rename a patch now that it fixes more than just GCC v4.6 issue
- Tighten DESKTOP_ENTRIES (do not set Comment and StartupNotify)
- Fix a few annoying SCons warnings (due to aging SConstruct file)
- Python is only used for the build, so plain USE_PYTHON is wrong
- Stagify, mention dedicated server mode availability in pkg-descr
Diffstat (limited to 'games/battletanks')
-rw-r--r-- | games/battletanks/Makefile | 24 | ||||
-rw-r--r-- | games/battletanks/files/patch-SConstruct | 72 | ||||
-rw-r--r-- | games/battletanks/files/patch-engine-sl08-sl08.py (renamed from games/battletanks/files/patch-gcc-4.6) | 18 | ||||
-rw-r--r-- | games/battletanks/files/patch-math-range_list.h | 19 | ||||
-rw-r--r-- | games/battletanks/pkg-descr | 1 | ||||
-rw-r--r-- | games/battletanks/pkg-plist | 1 |
6 files changed, 115 insertions, 20 deletions
diff --git a/games/battletanks/Makefile b/games/battletanks/Makefile index f9f8428a5435..4121734bed98 100644 --- a/games/battletanks/Makefile +++ b/games/battletanks/Makefile @@ -18,27 +18,23 @@ LIB_DEPENDS= libsigc-2.0.so:${PORTSDIR}/devel/libsigc++20 \ USES= openal:al pkgconfig USE_BZIP2= yes -USE_GCC= yes USE_LDCONFIG= yes USE_LUA= 5.0+ USE_SDL= image sdl USE_SCONS= yes -USE_PYTHON= yes -SCONS_ARGS= prefix=${PREFIX} resources_dir=${DATADIR} +USE_PYTHON_BUILD= yes +SCONS_ARGS= prefix=${PREFIX} resources_dir=${DATADIR} \ + --install-sandbox=${STAGEDIR} SCONS_BUILDENV= CC="${CC}" CXX="${CXX}" \ CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -fpermissive" \ LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS}" \ CPPPATH="${LOCALBASE}/include" LIBPATH="${LOCALBASE}/lib" -MAN6= ${PORTNAME}.6 - PORTDOCS= LICENSE LICENSE.EXCEPTION README-en.txt README-linux.txt \ donate.url homepage.url project_page.url video.txt -DESKTOP_ENTRIES="Battle Tanks" "${COMMENT}" "" "${PORTNAME}" \ - "Game;ArcadeGame;" false +DESKTOP_ENTRIES="Battle Tanks" "" "" "${PORTNAME}" "Game;ArcadeGame;" "" -NO_STAGE= yes pre-build: # Regenerate `sl08.h' after we patch `sl08.py' (as patching the header itself # would have resulted in a larger diff and gratuitous difference with Debian) @@ -48,11 +44,11 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/build/release/clunk/libclunk.so \ ${WRKSRC}/build/release/engine/libbtanks_engine.so \ ${WRKSRC}/build/release/mrt/libmrt.so \ - ${WRKSRC}/build/release/sdlx/libsdlx.so ${PREFIX}/lib - ${INSTALL_MAN} ${FILESDIR}/${MAN6} ${MANPREFIX}/man/man6 -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR} -.endif + ${WRKSRC}/build/release/sdlx/libsdlx.so \ + ${STAGEDIR}${PREFIX}/lib + ${INSTALL_MAN} ${FILESDIR}/${PORTNAME}.6 \ + ${STAGEDIR}${MANPREFIX}/man/man6 + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} .include <bsd.port.mk> diff --git a/games/battletanks/files/patch-SConstruct b/games/battletanks/files/patch-SConstruct index ba0ba750eead..4e45e4667e14 100644 --- a/games/battletanks/files/patch-SConstruct +++ b/games/battletanks/files/patch-SConstruct @@ -1,6 +1,31 @@ --- SConstruct.orig 2009-12-10 15:58:55.000000000 +0100 +++ SConstruct 2010-01-16 17:07:22.000000000 +0100 -@@ -57,6 +57,8 @@ +@@ -16,7 +16,7 @@ picLibBuilder = Builder( + 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') +@@ -30,12 +30,13 @@ opts.Add('CPPPATH', 'extra cpp path') + + if sys.platform != "win32": + opts.Add('prefix', 'prefix for **nix packaging', '') ++ opts.Add('DESTDIR', 'staging dir (also for packaging)', '') + 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()) +@@ -57,6 +58,8 @@ if os.environ.has_key('CXXFLAGS'): env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) if os.environ.has_key('LDFLAGS'): env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) @@ -9,7 +34,7 @@ if (sys.platform != "win32" and env['gcc_visibility']): env.Append(CCFLAGS=['-fvisibility=hidden', '-DGCC_HASCLASSVISIBILITY']) -@@ -98,9 +100,6 @@ +@@ -98,9 +101,6 @@ else: if debug: env.Append(CCFLAGS=['-ggdb', '-D_FORTIFY_SOURCE=2']) env.Append(CPPFLAGS=['-ggdb', '-D_FORTIFY_SOURCE=2']) @@ -19,3 +44,46 @@ env.Append(CPPFLAGS=['-Wall', '-Wno-deprecated', '-pedantic', '-Wno-long-long', '-pipe', '-pthread']) env.Append(CCFLAGS=['-Wall', '-Wno-deprecated', '-pedantic', '-Wno-long-long', '-pipe', '-pthread']) +@@ -221,7 +221,7 @@ except : + if len(env['resources_dir']): + resources_dir = env['resources_dir'] + else: +- resources_dir = prefix + "/share/btanks" ++ resources_dir = prefix + "/share/btankS" + + if len(env['lib_dir']): + lib_dir = env['lib_dir'] +@@ -253,24 +253,28 @@ 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: +- install_targets.append(env.Command(resources_dir + '/resources.dat', '#/data', 'zip -q -0 -r $TARGET * -x \*.svn\* -x \*.wav', chdir='data')) ++ install_targets.append( ++ env.Command(env['DESTDIR'] + resources_dir + '/resources.dat', ++ '#/data', ++ 'zip -q -0 -r $TARGET * -x \*.svn\* -x \*.wav', ++ chdir='data')) + env.Alias('install', install_targets) diff --git a/games/battletanks/files/patch-gcc-4.6 b/games/battletanks/files/patch-engine-sl08-sl08.py index fec0be39443a..0f45f67c1eea 100644 --- a/games/battletanks/files/patch-gcc-4.6 +++ b/games/battletanks/files/patch-engine-sl08-sl08.py @@ -2,9 +2,11 @@ From: Ansgar Burchardt <ansgar@debian.org> Bug-Debian: http://bugs.debian.org/624916 Subject: Fix FTBFS with gcc-4.6 +Update: Add missing this->'s to appease Clang + --- engine/sl08/sl08.py.orig +++ engine/sl08/sl08.py -@@ -152,8 +152,8 @@ class Generator(object): +@@ -152,11 +152,11 @@ class Generator(object): typedef base_signalXXX %s signal_type; typedef return_type (object_type::*func_t) %s; @@ -14,8 +16,12 @@ Subject: Fix FTBFS with gcc-4.6 + 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): +- 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 ; +@@ -187,10 +187,10 @@ class Generator(object): typedef base_signalXXX %s signal_type; typedef void (object_type::*func_t) %s ; @@ -23,4 +29,8 @@ Subject: Fix FTBFS with gcc-4.6 + 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; 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; diff --git a/games/battletanks/files/patch-math-range_list.h b/games/battletanks/files/patch-math-range_list.h new file mode 100644 index 000000000000..24ac8fc74952 --- /dev/null +++ b/games/battletanks/files/patch-math-range_list.h @@ -0,0 +1,19 @@ +--- math/range_list.h.orig 2008-10-24 22:15:55.000000000 +0800 ++++ math/range_list.h 2014-01-15 15:44:11.000000000 +0800 +@@ -53,14 +53,14 @@ public: + 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); + } diff --git a/games/battletanks/pkg-descr b/games/battletanks/pkg-descr index d6a4ff3b1098..5a1633a88402 100644 --- a/games/battletanks/pkg-descr +++ b/games/battletanks/pkg-descr @@ -16,5 +16,6 @@ you in Battle Tanks. Some of the game highlights: destroyed, weather effects are simulated * Lots of war objects: troops, vehicles, helicopters, etc. * Keyboard and gamepad are supported + * Dedicated server mode (headless) WWW: http://btanks.sourceforge.net/ diff --git a/games/battletanks/pkg-plist b/games/battletanks/pkg-plist index 321add072ac2..cc51c1086d1f 100644 --- a/games/battletanks/pkg-plist +++ b/games/battletanks/pkg-plist @@ -1,5 +1,6 @@ bin/btanks bin/bted +man/man6/btanks.6.gz lib/btanks/libbt_objects.so lib/libbtanks_engine.so lib/libclunk.so |