Index: head/games/spacejunk/Makefile =================================================================== --- head/games/spacejunk/Makefile (revision 473560) +++ head/games/spacejunk/Makefile (revision 473561) @@ -1,52 +1,55 @@ # Created by: Dmitry Marakasov # $FreeBSD$ PORTNAME= spacejunk PORTVERSION= 1.0.5 PORTREVISION= 3 CATEGORIES= games MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} MAINTAINER= amdmi3@FreeBSD.org COMMENT= Video game about traveling in 2D planetary systems LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING +BROKEN_aarch64= Fails to compile: error: _compile_time_assert__ declared as an array with a negative size +BROKEN_sparc64= Doesn't compile on sparc64 + +USES= localbase GNU_CONFIGURE= yes USE_SDL= sdl mixer image -CPPFLAGS+= -I${LOCALBASE}/include -LIBS+= -L${LOCALBASE}/lib +CXXFLAGS+= -Wno-c++11-narrowing +CXXFLAGS+= -O0 # XXX: segfaults with optimization, need to investigate SUB_FILES= spacejunk PLIST_FILES= bin/${PORTNAME} libexec/${PORTNAME} PORTDOCS= * PORTDATA= * DESKTOP_ENTRIES="Spacejunk" \ "Collect garbage by navigating through the gravitational fields of planets and stars" \ "${DATADIR}/data/art/spacejunk_icon.png" \ "spacejunk" \ "Game;ArcadeGame;" \ false OPTIONS_DEFINE= DOCS -BROKEN_aarch64= Fails to compile: error: _compile_time_assert__ declared as an array with a negative size -BROKEN_sparc64= Doesn't compile on sparc64 - post-patch: @${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|' ${WRKSRC}/src/gem-uta.c \ ${WRKSRC}/libinfo/gem-uta.c @${REINPLACE_CMD} -e 's|data/|${DATADIR}/&|' ${WRKSRC}/src/*.c* do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/spacejunk ${STAGEDIR}${PREFIX}/libexec/ - cd ${WRKSRC} && ${COPYTREE_SHARE} 'data config.txt' ${STAGEDIR}${DATADIR}/ + @cd ${WRKSRC} && ${COPYTREE_SHARE} 'data config.txt' ${STAGEDIR}${DATADIR}/ ${INSTALL_SCRIPT} ${WRKDIR}/spacejunk ${STAGEDIR}${PREFIX}/bin/ - cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/ + +do-install-DOCS-on: + @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/ ${RMDIR} ${STAGEDIR}${DOCSDIR}/web/templates ${STAGEDIR}${DOCSDIR}/web/toolbars .include Index: head/games/spacejunk/files/patch-src-SFont.c =================================================================== --- head/games/spacejunk/files/patch-src-SFont.c (revision 473560) +++ head/games/spacejunk/files/patch-src-SFont.c (revision 473561) @@ -1,12 +1,12 @@ Clang compatibility ---- src/SFont.c.orig 2013-06-14 01:28:33.767289275 +0400 -+++ src/SFont.c 2013-06-14 01:39:06.709113401 +0400 -@@ -72,7 +72,7 @@ +--- src/SFont.c.orig 2009-06-17 17:47:07 UTC ++++ src/SFont.c +@@ -72,7 +72,7 @@ static Uint32 GetPixel(SDL_Surface *Surf return -1; } -Uint32 searchFirstPixel(SDL_Surface* s,int* X,int* Y,int* MinY){ +void searchFirstPixel(SDL_Surface* s,int* X,int* Y,int* MinY){ Uint32 bgpixel = GetPixel(s, 0, s->h-1); int x=0; Index: head/games/spacejunk/files/patch-src-physicbody.cpp =================================================================== --- head/games/spacejunk/files/patch-src-physicbody.cpp (revision 473560) +++ head/games/spacejunk/files/patch-src-physicbody.cpp (revision 473561) @@ -1,111 +1,111 @@ Clang compatibility ---- src/physicbody.cpp.orig 2013-06-14 01:22:11.442112529 +0400 -+++ src/physicbody.cpp 2013-06-14 01:38:02.468909545 +0400 +--- src/physicbody.cpp.orig 2009-06-17 17:47:07 UTC ++++ src/physicbody.cpp @@ -20,9 +20,21 @@ #include "physicbody.h" #include #include +#include using namespace std; +template +class DynArray { +private: + std::vector data; + +public: + DynArray(size_t len) : data(len) { } + + operator const T*() const { return data.data(); } + operator T*() { return data.data(); } +}; const double PhysicEngine::G=6.6726e-17; -@@ -165,7 +180,6 @@ +@@ -165,7 +177,6 @@ inline Vector2d PhysicEngine::calculateA return acc; } - void PhysicEngine::_vstep (int delta) { #define DELTA_LIMIT 3 #define ERROR_LIMIT 0.001 -@@ -179,11 +193,11 @@ +@@ -179,11 +190,11 @@ void PhysicEngine::_vstep (int delta) { real tempdelta=delta; real time=0; int n=bodies.size(); - Vector2d accels[n]; + DynArray accels(n); calculateForces(0,accels); loadcount++; - Vector2d temp_pos[n]; - Vector2d temp_vel[n]; + DynArray temp_pos(n); + DynArray temp_vel(n); do { for (vector::iterator j=bodies.begin();j!=bodies.end();j++) { if (!*j) continue; -@@ -306,12 +320,12 @@ +@@ -306,12 +317,12 @@ void PhysicEngine::_step(int delta,bool real PhysicEngine::vstepRK5 (real delta,Vector2d initaccels[]) { real maxdist=0; int n=bodies.size(); - Vector2d accels[n]; - Vector2d mipos[n]; - Vector2d k1pos[n]; - Vector2d k1vel[n]; - Vector2d k2pos[n]; - Vector2d k2vel[n]; + DynArray accels(n); + DynArray mipos(n); + DynArray k1pos(n); + DynArray k1vel(n); + DynArray k2pos(n); + DynArray k2vel(n); for (vector::iterator j=bodies.begin();j!=bodies.end();j++) { if (!*j || ((*j)->flags & PhysicBody::FIXED)) continue; mipos[(*j)->id]=(*j)->pos; -@@ -321,8 +335,8 @@ +@@ -321,8 +332,8 @@ real PhysicEngine::vstepRK5 (real delta, (*j)->pos=mipos[(*j)->id]+k1pos[(*j)->id]*0.2; } calculateForces(delta*0.2,accels); - Vector2d k3pos[n]; - Vector2d k3vel[n]; + DynArray k3pos(n); + DynArray k3vel(n); for (vector::iterator j=bodies.begin();j!=bodies.end();j++) { if (!*j || ((*j)->flags & PhysicBody::FIXED)) continue; k2vel[(*j)->id]=accels[(*j)->id]*delta; -@@ -330,8 +344,8 @@ +@@ -330,8 +341,8 @@ real PhysicEngine::vstepRK5 (real delta, (*j)->pos=mipos[(*j)->id]+k1pos[(*j)->id]*(3.0/40.0)+k2pos[(*j)->id]*(9.0/40.0); } calculateForces(delta*0.3,accels); - Vector2d k4pos[n]; - Vector2d k4vel[n]; + DynArray k4pos(n); + DynArray k4vel(n); for (vector::iterator j=bodies.begin();j!=bodies.end();j++) { if (!*j || ((*j)->flags & PhysicBody::FIXED)) continue; k3vel[(*j)->id]=accels[(*j)->id]*delta; -@@ -339,8 +353,8 @@ +@@ -339,8 +350,8 @@ real PhysicEngine::vstepRK5 (real delta, (*j)->pos=mipos[(*j)->id]+k1pos[(*j)->id]*0.3+k2pos[(*j)->id]*(-0.9)+k3pos[(*j)->id]*1.2; } calculateForces(delta*0.6,accels); - Vector2d k5pos[n]; - Vector2d k5vel[n]; + DynArray k5pos(n); + DynArray k5vel(n); for (vector::iterator j=bodies.begin();j!=bodies.end();j++) { if (!*j || ((*j)->flags & PhysicBody::FIXED)) continue; k4vel[(*j)->id]=accels[(*j)->id]*delta; -@@ -348,8 +362,8 @@ +@@ -348,8 +359,8 @@ real PhysicEngine::vstepRK5 (real delta, (*j)->pos=mipos[(*j)->id]+k1pos[(*j)->id]*(-11.0/54.0)+k2pos[(*j)->id]*2.5+k3pos[(*j)->id]*(-70.0/27.0)+k4pos[(*j)->id]*(35.0/27.0); } calculateForces(delta,accels); - Vector2d k6pos[n]; - Vector2d k6vel[n]; + DynArray k6pos(n); + DynArray k6vel(n); for (vector::iterator j=bodies.begin();j!=bodies.end();j++) { if (!*j || ((*j)->flags & PhysicBody::FIXED)) continue; k5vel[(*j)->id]=accels[(*j)->id]*delta; Index: head/games/spacejunk/files/patch-src-scorelist.cpp =================================================================== --- head/games/spacejunk/files/patch-src-scorelist.cpp (revision 473560) +++ head/games/spacejunk/files/patch-src-scorelist.cpp (revision 473561) @@ -1,11 +1,11 @@ ---- src/scorelist.cpp.orig 2013-09-14 02:20:35.651231123 +0400 -+++ src/scorelist.cpp 2013-09-14 02:22:39.837225946 +0400 -@@ -98,7 +98,7 @@ +--- src/scorelist.cpp.orig 2010-05-07 18:21:19 UTC ++++ src/scorelist.cpp +@@ -98,7 +98,7 @@ string ScoreList::getPoints() const { ostream & operator << (ostream & o,const ScoreList & s) { STDStreamPrinter sp(o); OStreamUTF8Encoder sc(&sp); - for (multimap::const_iterator i=s.scores.begin();i!=s.scores.end();i++) + for (ScoreList::Map::const_iterator i=s.scores.begin();i!=s.scores.end();i++) sc<<'"'<second)<<"\" "<first<<'\n'; return o; };