diff options
Diffstat (limited to 'games/spring')
40 files changed, 530 insertions, 610 deletions
diff --git a/games/spring/Makefile b/games/spring/Makefile index d43471fa6ee5..0bdda9641a01 100644 --- a/games/spring/Makefile +++ b/games/spring/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= spring -PORTVERSION= 94.1 -PORTREVISION= 7 +PORTVERSION= 98.0 CATEGORIES= games MASTER_SITES= SF/springrts/springrts/${PORTNAME}-${PORTVERSION} \ http://springrts.com/dl/ @@ -18,34 +17,36 @@ LIB_DEPENDS= libfreetype.so:${PORTSDIR}/print/freetype2 \ libboost_thread.so:${PORTSDIR}/devel/boost-libs \ libIL.so:${PORTSDIR}/graphics/devil \ libogg.so:${PORTSDIR}/audio/libogg \ - libvorbis.so:${PORTSDIR}/audio/libvorbis \ - libexecinfo.so:${PORTSDIR}/devel/libexecinfo + libvorbis.so:${PORTSDIR}/audio/libvorbis BUILD_DEPENDS= 7z:${PORTSDIR}/archivers/p7zip -BROKEN= Fails to build -DEPRECATED= Broken for more than 6 months -EXPIRATION_DATE= 2015-05-30 -# XXX: it should be possible to build it on i386, investigate -# (currently link fails on undefined reference to __sync_fetch_and_add_8) -ONLY_FOR_ARCHS= amd64 -ONLY_FOR_ARCHS_REASON= relies on x86 floating-point math and amd64 atomic ops - -USE_SDL= sdl +USE_SDL= sdl2 USE_GL= gl glu glew USE_XORG= x11 xcursor USE_LDCONFIG= yes DOS2UNIX_GLOB= *.h *.hpp *.cpp -USES= cmake compiler:c++11-lib dos2unix openal:al +USES= execinfo cmake compiler:c++11-lib dos2unix openal:al tar:lzma +USES+= desktop-file-utils shared-mime-info CMAKE_ARGS= -DDATADIR:STRING="share/${PORTNAME}" \ -DAI_TYPES:STRING="NATIVE" \ -DDOCDIR:STRING="share/doc/${PORTNAME}" \ -DCREATE_MAN_PAGES:BOOL=false \ - -DUNITSYNC_PYTHON_WRAPPER:BOOL=false \ - -DCUSTOM_CFLAGS:BOOL=true + -DUSE_TCMALLOC:BOOL=false \ + -DUSE_LIBSQUISH:BOOL=false \ + -DUNITSYNC_PYTHON_WRAPPER:BOOL=false WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION} +.if exists(/usr/lib/libexecinfo.so) +LEI_PREFIX= /usr +.else +LEI_PREFIX= ${LOCALBASE} +.endif + +# Do not exctract bundled copies of header files for 3rd-party packages: +EXTRACT_AFTER_ARGS=--no-same-owner --no-same-permissions --exclude ${WRKSRC:T}/include + PORTDOCS= * PORTDATA= * @@ -65,9 +66,14 @@ MANPAGES_BUILD_DEPENDS= 7z:${PORTSDIR}/archivers/p7zip \ bash:${PORTSDIR}/shells/bash MANPAGES_DOCS_ON= -DUSERDOCS_PLAIN:BOOL=true MANPAGES_DOCS_OFF= -DUSERDOCS_PLAIN:BOOL=false +CXXFLAGS+= -Wno-deprecated # Too much noise PR_DOWNLOADER_LIB_DEPENDS=libcurl.so:${PORTSDIR}/ftp/curl +# The check-target fails right now: https://springrts.com/mantis/view.php?id=4736 +check test xregression-test: build + ${MAKE} -C ${WRKSRC} check + .include <bsd.port.options.mk> .if defined(WITH_SYNC_DEBUG) @@ -90,7 +96,7 @@ post-patch: ${WRKSRC}/rts/System/Sync/FPUCheck.cpp @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/rts/build/cmake/*.cmake - @${REINPLACE_CMD} -e 's|execinfo|${LOCALBASE}/lib/libexecinfo.so|' \ + @${REINPLACE_CMD} -e 's|execinfo|${LEI_PREFIX}/lib/libexecinfo.so|' \ ${WRKSRC}/rts/CMakeLists.txt \ ${WRKSRC}/rts/builds/dedicated/CMakeLists.txt @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \ diff --git a/games/spring/distinfo b/games/spring/distinfo index 7441eff9bada..ef0c748ac089 100644 --- a/games/spring/distinfo +++ b/games/spring/distinfo @@ -1,2 +1,2 @@ -SHA256 (spring_94.1_src.tar.gz) = 26da7271baa8b3dd57022541d98e6a4841084d749788b698c4f8a914cf9e7004 -SIZE (spring_94.1_src.tar.gz) = 11793404 +SHA256 (spring_98.0_src.tar.lzma) = 9137a8a35b42dd622c107c3b26525dc40d8b6e0dca0ce4a87c9fef005328823b +SIZE (spring_98.0_src.tar.lzma) = 9114659 diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-AIClasses.hpp b/games/spring/files/patch-AI-Skirmish-KAIK-AIClasses.hpp deleted file mode 100644 index 33bb0f2e3eb7..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-AIClasses.hpp +++ /dev/null @@ -1,11 +0,0 @@ ---- AI/Skirmish/KAIK/AIClasses.hpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/AIClasses.hpp 2013-11-11 03:13:58.779774182 +0400 -@@ -111,7 +111,7 @@ - #define math GetMathHandler() - #define pather GetPathFinder() - #define ut GetUnitTable() --#define tm GetThreatMap() -+#define thm GetThreatMap() - #define uh GetUnitHandler() - #define dm GetDefenseMatrix() - #define ah GetAttackHandler() diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-AttackHandler.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-AttackHandler.cpp deleted file mode 100644 index 66951df51f6e..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-AttackHandler.cpp +++ /dev/null @@ -1,28 +0,0 @@ ---- AI/Skirmish/KAIK/AttackHandler.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/AttackHandler.cpp 2013-11-11 03:16:31.073773664 +0400 -@@ -829,9 +829,9 @@ - - ai->pather->micropather->SetMapData( - ai->pather->MoveArrays[group_in->GetWorstMoveType()], -- ai->tm->GetThreatArray(), -- ai->tm->GetThreatMapWidth(), -- ai->tm->GetThreatMapHeight() -+ ai->thm->GetThreatArray(), -+ ai->thm->GetThreatMapWidth(), -+ ai->thm->GetThreatMapHeight() - ); - - -@@ -930,9 +930,9 @@ - // in each group (movement map PATHTOUSE is hack) - ai->pather->micropather->SetMapData( - ai->pather->MoveArrays[PATHTOUSE], -- ai->tm->GetThreatArray(), -- ai->tm->GetThreatMapWidth(), -- ai->tm->GetThreatMapHeight() -+ ai->thm->GetThreatArray(), -+ ai->thm->GetThreatMapWidth(), -+ ai->thm->GetThreatMapHeight() - ); - - // calculate and draw k-means for the base perimeters every 10 seconds diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-BuildUp.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-BuildUp.cpp deleted file mode 100644 index a0fd6e0bca3e..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-BuildUp.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- AI/Skirmish/KAIK/BuildUp.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/BuildUp.cpp 2013-11-11 03:15:30.794774021 +0400 -@@ -32,7 +32,7 @@ - void CBuildUp::Update(int frame) { - if (frame % 15 == 0) { - // update current threat map -- ai->tm->Update(); -+ ai->thm->Update(); - ai->uh->UpdateUpgradeTasks(frame); - - GetEconState(&econState); diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-DGunController.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-DGunController.cpp deleted file mode 100644 index bd490eab928e..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-DGunController.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- AI/Skirmish/KAIK/DGunController.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/DGunController.cpp 2013-11-11 03:17:24.007772549 +0400 -@@ -166,7 +166,7 @@ - if (canDGun) { - IssueOrder(dgunPos, CMD_DGUN, 0); - } else { -- bool bDanger = ai->tm->ThreatAtThisPoint(commanderPos/*curTargetPos*/) > ai->tm->GetAverageThreat(); -+ bool bDanger = ai->thm->ThreatAtThisPoint(commanderPos/*curTargetPos*/) > ai->thm->GetAverageThreat(); - - if (bDanger) { - state.Reset(currentFrame, true); diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-DefenseMatrix.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-DefenseMatrix.cpp deleted file mode 100644 index 799da11a53f7..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-DefenseMatrix.cpp +++ /dev/null @@ -1,38 +0,0 @@ ---- AI/Skirmish/KAIK/DefenseMatrix.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/DefenseMatrix.cpp 2013-11-11 03:16:52.800773805 +0400 -@@ -84,7 +84,7 @@ - int y = (int) (builderpos.z / f3multiplier); - float fastSumMap = sumMap[y * ai->pather->PathMapXSize + x]; - float3 spotpos = float3(x * f3multiplier, 0, y * f3multiplier); -- float myscore = fastSumMap / (builderpos.distance2D(spotpos) + averagemapsize / 8) * ((ai->pather->HeightMap[y * ai->pather->PathMapXSize + x] + 200) / (ai->pather->AverageHeight + 10)) / (ai->tm->ThreatAtThisPoint(spotpos) + 0.01); -+ float myscore = fastSumMap / (builderpos.distance2D(spotpos) + averagemapsize / 8) * ((ai->pather->HeightMap[y * ai->pather->PathMapXSize + x] + 200) / (ai->pather->AverageHeight + 10)) / (ai->thm->ThreatAtThisPoint(spotpos) + 0.01); - bestscore_fast = myscore; - bestspotx_fast = x; - bestspoty_fast = y; -@@ -131,7 +131,7 @@ - - float3 bestPosibleSpotpos = float3(bestX * f3multiplier, 0, bestY * f3multiplier); - // this must be guessed, set it to the best possible (slow) -- float bestThreatAtThisPoint = 0.01 + ai->tm->GetAverageThreat() - 1; -+ float bestThreatAtThisPoint = 0.01 + ai->thm->GetAverageThreat() - 1; - float bestDistance = builderpos.distance2D(bestPosibleSpotpos); - float bestHeight = ai->pather->HeightMap[cachePoint->y * ai->pather->PathMapXSize + cachePoint->x] + 200; - float bestPosibleMyScore = bestScoreInThisBox / (bestDistance + averagemapsize / 4) * (bestHeight + 200) / bestThreatAtThisPoint; -@@ -145,7 +145,7 @@ - for (int sy = y * CACHEFACTOR; sy < ai->pather->PathMapYSize && sy < (y * CACHEFACTOR + CACHEFACTOR); sy++) { - float fastSumMap = sumMap[sy * ai->pather->PathMapXSize + sx]; - float3 spotpos = float3(sx * f3multiplier, 0, sy * f3multiplier); -- float myscore = fastSumMap / (builderpos.distance2D(spotpos) + averagemapsize / 4) * (ai->pather->HeightMap[sy * ai->pather->PathMapXSize + sx]+200) / (ai->tm->ThreatAtThisPoint(spotpos) + 0.01); -+ float myscore = fastSumMap / (builderpos.distance2D(spotpos) + averagemapsize / 4) * (ai->pather->HeightMap[sy * ai->pather->PathMapXSize + sx]+200) / (ai->thm->ThreatAtThisPoint(spotpos) + 0.01); - // THIS COULD BE REALLY SLOW! - if (myscore > bestscore_fast && BuildMaskArray[sy * ai->pather->PathMapXSize + sx] == 0 && ai->cb->CanBuildAt(def, spotpos)) { - bestscore_fast = myscore; -@@ -199,7 +199,7 @@ - } - - spotFinder->InvalidateSumMap(x, y, Range + 1); -- // ai->debug->MakeBWTGA(Chokepointmap, ai->tm->GetThreatMapWidth(), ai->tm->GetThreatMapHeight(), "DebugPathMatrix", 1); -+ // ai->debug->MakeBWTGA(Chokepointmap, ai->thm->GetThreatMapWidth(), ai->thm->GetThreatMapHeight(), "DebugPathMatrix", 1); - } - - diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-KAIK.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-KAIK.cpp deleted file mode 100644 index 6c20520e1ced..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-KAIK.cpp +++ /dev/null @@ -1,51 +0,0 @@ ---- AI/Skirmish/KAIK/KAIK.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/KAIK.cpp 2013-11-11 03:15:53.601773605 +0400 -@@ -194,13 +194,13 @@ - void CKAIK::EnemyDestroyed(int enemyUnitID, int attackerUnitID) { - if (ai->Initialized()) { - ai->dgunConHandler->NotifyEnemyDestroyed(enemyUnitID, attackerUnitID); -- ai->tm->EnemyDestroyed(enemyUnitID, attackerUnitID); -+ ai->thm->EnemyDestroyed(enemyUnitID, attackerUnitID); - } - } - - void CKAIK::EnemyDamaged(int enemyUnitID, int attackerUnitID, float damage, float3 dir) { - if (ai->Initialized()) { -- ai->tm->EnemyDamaged(enemyUnitID, attackerUnitID); -+ ai->thm->EnemyDamaged(enemyUnitID, attackerUnitID); - - damage = damage; - dir = dir; -@@ -209,12 +209,12 @@ - - void CKAIK::EnemyCreated(int enemyUnitID) { - if (ai->Initialized()) { -- ai->tm->EnemyCreated(enemyUnitID); -+ ai->thm->EnemyCreated(enemyUnitID); - } - } - void CKAIK::EnemyFinished(int enemyUnitID) { - if (ai->Initialized()) { -- ai->tm->EnemyFinished(enemyUnitID); -+ ai->thm->EnemyFinished(enemyUnitID); - } - } - -@@ -229,7 +229,7 @@ - } - - if ((msg = strstr(msg, "ThreatMap::DBG")) != NULL) { -- ai->tm->ToggleVisOverlay(); -+ ai->thm->ToggleVisOverlay(); - } - } - } -@@ -298,7 +298,7 @@ - ai->dgunConHandler->Update(frame); - - if ((frame - ai->InitFrame()) == 1) { -- // ai->tm->Init(); -+ // ai->thm->Init(); - ai->dm->Init(); - } - diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-Logger.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-Logger.cpp deleted file mode 100644 index 3353c31f52ef..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-Logger.cpp +++ /dev/null @@ -1,12 +0,0 @@ ---- AI/Skirmish/KAIK/Logger.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/Logger.cpp 2013-11-11 03:18:04.431773779 +0400 -@@ -14,8 +14,7 @@ - - time_t now1; - time(&now1); --//FIXME:compile hack for macosx --#undef tm -+ - struct tm* now2 = localtime(&now1); - - std::stringstream ss; diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-Logger.h b/games/spring/files/patch-AI-Skirmish-KAIK-Logger.h deleted file mode 100644 index 243ad4b98a9b..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-Logger.h +++ /dev/null @@ -1,14 +0,0 @@ ---- AI/Skirmish/KAIK/Logger.h.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/Logger.h 2013-11-11 04:04:46.414772522 +0400 -@@ -2,10 +2,8 @@ - #define KAIK_LOGGER_HDR - - #include <string> --//FIXME:compile hack for macosx --#undef tm - #include <fstream> --#define tm GetThreatMap() -+#define thm GetThreatMap() - - namespace springLegacyAI { - class IAICallback; diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-MetalMap.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-MetalMap.cpp deleted file mode 100644 index 431847ac4891..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-MetalMap.cpp +++ /dev/null @@ -1,20 +0,0 @@ ---- AI/Skirmish/KAIK/MetalMap.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/MetalMap.cpp 2013-11-11 03:17:46.615772673 +0400 -@@ -57,7 +57,7 @@ - - if (spotCoords.x >= 0.0f) { - float distance = spotCoords.distance2D(ai->cb->GetUnitPos(builderid)) + 150; -- float myThreat = ai->tm->ThreatAtThisPoint(spotCoords); -+ float myThreat = ai->thm->ThreatAtThisPoint(spotCoords); - float spotScore = VectoredSpots[i].y / distance / (myThreat + 10); - - // along with threatmap try to search for enemy armed units around cause -@@ -92,7 +92,7 @@ - // by presence of ARMED enemy units or buildings - bool b1 = (TempScore < spotScore); - bool b2 = (numEnemies == 0); -- bool b3 = (myThreat <= (ai->tm->GetAverageThreat() * 1.5)); -+ bool b3 = (myThreat <= (ai->thm->GetAverageThreat() * 1.5)); - bool b4 = (ai->uh->TaskPlanExist(spotCoords, extractor)); - - if (b1 && b2 && b3 && !b4 && !bOccupied) { diff --git a/games/spring/files/patch-AI-Skirmish-KAIK-Unit.cpp b/games/spring/files/patch-AI-Skirmish-KAIK-Unit.cpp deleted file mode 100644 index aeeb5de687e3..000000000000 --- a/games/spring/files/patch-AI-Skirmish-KAIK-Unit.cpp +++ /dev/null @@ -1,48 +0,0 @@ ---- AI/Skirmish/KAIK/Unit.cpp.orig 2013-03-26 03:58:45.000000000 +0400 -+++ AI/Skirmish/KAIK/Unit.cpp 2013-11-11 03:16:19.873774077 +0400 -@@ -256,7 +256,7 @@ - const FeatureDef* fDef = ai->cb->GetFeatureDef(featureIDs[i]); - const float3& fPos = ai->cb->GetFeaturePos(featureIDs[i]); - const float fDist = fPos.distance2D(ai->cb->GetUnitPos(uid)); -- const float fThreat = ai->tm->ThreatAtThisPoint(fPos); -+ const float fThreat = ai->thm->ThreatAtThisPoint(fPos); - - if (fDef == 0) - continue; -@@ -266,11 +266,11 @@ - continue; - } - -- if (fDef->metal > bestScore && fThreat <= ai->tm->GetAverageThreat()) { -+ if (fDef->metal > bestScore && fThreat <= ai->thm->GetAverageThreat()) { - bestScore = fDef->metal; - bestFeatureID = featureIDs[i]; - } -- else if (bestScore == fDef->metal && fThreat <= ai->tm->GetAverageThreat()) { -+ else if (bestScore == fDef->metal && fThreat <= ai->thm->GetAverageThreat()) { - if (fDist < bestDist) { - bestFeatureID = featureIDs[i]; - bestDist = fDist; -@@ -282,7 +282,7 @@ - const FeatureDef* fDef = ai->cb->GetFeatureDef(featureIDs[i]); - const float3& fPos = ai->cb->GetFeaturePos(featureIDs[i]); - const float fDist = fPos.distance2D(ai->cb->GetUnitPos(uid)); -- const float fThreat = ai->tm->ThreatAtThisPoint(fPos); -+ const float fThreat = ai->thm->ThreatAtThisPoint(fPos); - - if (fDef == 0) - continue; -@@ -291,11 +291,11 @@ - continue; - } - -- if (fDef->energy > bestScore && fThreat < ai->tm->GetAverageThreat()) { -+ if (fDef->energy > bestScore && fThreat < ai->thm->GetAverageThreat()) { - bestScore = fDef->energy; - bestFeatureID = featureIDs[i]; - } -- else if (bestScore == fDef->energy && fThreat < ai->tm->GetAverageThreat()) { -+ else if (bestScore == fDef->energy && fThreat < ai->thm->GetAverageThreat()) { - if (fDist < bestDist) { - bestFeatureID = featureIDs[i]; - bestDist = fDist; diff --git a/games/spring/files/patch-CMakeLists.txt b/games/spring/files/patch-CMakeLists.txt deleted file mode 100644 index db19184ab4e0..000000000000 --- a/games/spring/files/patch-CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ ---- CMakeLists.txt.orig 2013-03-26 03:58:35.000000000 +0400 -+++ CMakeLists.txt 2013-11-09 07:51:04.829392176 +0400 -@@ -364,7 +364,6 @@ - elseif (MSVC) - # nothing to be done here - else (MSVC) -- Message(FATAL_ERROR "unknown compiler") - endif ($ENV{CXX} MATCHES "icpc") - - add_definitions(-DSTREFLOP_SSE) # would break AI compiling, but is undefined in ./AI/CMakeLists.txt diff --git a/games/spring/files/patch-math b/games/spring/files/patch-math new file mode 100644 index 000000000000..6589dd62bcaf --- /dev/null +++ b/games/spring/files/patch-math @@ -0,0 +1,186 @@ ++++ rts/aGui/GuiElement.h 2015-04-08 15:06:26 -0400 +@@ -4,4 +4,5 @@ + #define GUIELEMENT_H + ++#include <cmath> + #include <list> + #include <SDL_events.h> ++++ rts/Sim/Weapons/LaserCannon.cpp 2015-04-07 20:49:52 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "LaserCannon.h" + #include "WeaponDef.h" ++++ rts/Sim/Weapons/FlameThrower.cpp 2015-04-07 20:50:46 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "FlameThrower.h" + #include "WeaponDef.h" ++++ rts/Sim/Weapons/MissileLauncher.cpp 2015-04-07 20:53:21 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "MissileLauncher.h" + #include "WeaponDef.h" ++++ rts/Sim/Weapons/EmgCannon.cpp 2015-04-07 20:57:50 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "EmgCannon.h" + #include "WeaponDef.h" ++++ rts/Sim/Units/Groups/GroupHandler.cpp 2015-04-08 16:24:53 -0400 +@@ -2,4 +2,6 @@ + + #include <boost/cstdint.hpp> ++ ++#include <cmath> + #include <SDL_keycode.h> + ++++ rts/Sim/Weapons/TorpedoLauncher.cpp 2015-04-08 16:26:07 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "TorpedoLauncher.h" + #include "WeaponDef.h" ++++ rts/Game/Camera.cpp 2015-04-08 16:27:30 -0400 +@@ -1,4 +1,5 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> + #include <string.h> + ++++ rts/Game/InMapDraw.cpp 2015-04-08 16:44:34 -0400 +@@ -1,6 +1,7 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + +-#include "SDL_mouse.h" +-#include "SDL_keyboard.h" ++#include <cmath> ++#include <SDL_mouse.h> ++#include <SDL_keyboard.h> + + #include "InMapDraw.h" ++++ rts/Game/PreGame.cpp 2015-04-08 16:45:50 -0400 +@@ -1,4 +1,5 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> + #include <map> + #include <SDL_keycode.h> ++++ rts/Game/UI/MiniMap.cpp 2015-04-08 16:47:16 -0400 +@@ -1,4 +1,5 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> + #include <SDL_keycode.h> + #include <SDL_mouse.h> ++++ rts/Rendering/GL/myGL.cpp 2015-04-08 16:51:02 -0400 +@@ -1,4 +1,5 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> + #include <vector> + #include <string> ++++ rts/System/Input/Joystick.cpp 2015-04-08 16:54:28 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "InputHandler.h" + #include "Joystick.h" ++++ rts/System/SpringApp.cpp 2015-04-08 16:59:02 -0400 +@@ -1,4 +1,6 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <cmath> ++ + #include "System/Input/InputHandler.h" + ++++ rts/Sim/Projectiles/WeaponProjectiles/LargeBeamLaserProjectile.cpp 2015-04-07 20:42:45 -0400 +@@ -10,4 +10,5 @@ + #include "System/myMath.h" + #include <cstring> //memset ++#include <cmath> // floor + + CR_BIND_DERIVED(CLargeBeamLaserProjectile, CWeaponProjectile, (ProjectileParams())) +--- rts/System/Sync/SyncedFloat3.h 2014-10-07 20:09:51 UTC ++++ rts/System/Sync/SyncedFloat3.h 2015-04-24 08:44:31 -0400 +@@ -13,4 +13,6 @@ + #include "System/FastMath.h" //SSE (I)SQRT + ++#include <math.h> ++ + /** + * @brief SyncedFloat3 class +@@ -614,7 +616,7 @@ + + void AssertNaNs() const { +- assert(!math::isnan(x) && !math::isinf(x)); +- assert(!math::isnan(y) && !math::isinf(y)); +- assert(!math::isnan(z) && !math::isinf(z)); ++ assert(!isnanf(x) && !__isinff(x)); ++ assert(!isnanf(y) && !__isinff(y)); ++ assert(!isnanf(z) && !__isinff(z)); + } + ++++ rts/Sim/Path/IPathController.cpp 2015-04-08 18:59:04 -0400 +@@ -1,3 +1,5 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ ++#include <math.h> ++ + #include "IPathController.hpp" + #include "Sim/Units/Unit.h" +@@ -27,8 +29,8 @@ + + const float rawSpeedDiff = (targetSpeed * targetSpeedSign) - (currentSpeed * currentSpeedSign); +- const float absSpeedDiff = math::fabs(rawSpeedDiff); ++ const float absSpeedDiff = fabsf(rawSpeedDiff); + // need to clamp, game-supplied values can be much larger than |speedDiff| +- const float modAccRate = std::min(absSpeedDiff, maxAccRate); +- const float modDecRate = std::min(absSpeedDiff, maxDecRate); ++ const float modAccRate = fminf(absSpeedDiff, maxAccRate); ++ const float modDecRate = fminf(absSpeedDiff, maxDecRate); + + const float deltaSpeed = mix(modAccRate, -modDecRate, (rawSpeedDiff < 0.0f)); +@@ -66,6 +68,6 @@ + + static float TurnAccelerationSign(float turnBrakeDist, short curDeltaHeading, short newDeltaHeading) { +- const bool b0 = (turnBrakeDist >= std::abs(curDeltaHeading)); +- const bool b1 = (std::abs(newDeltaHeading) <= std::abs(curDeltaHeading)); ++ const bool b0 = (turnBrakeDist >= abs(curDeltaHeading)); ++ const bool b1 = (abs(newDeltaHeading) <= abs(curDeltaHeading)); + const bool b2 = (Sign(curDeltaHeading) != Sign(newDeltaHeading)); + +@@ -86,5 +88,5 @@ + const short curDeltaHeading = newHeading - short(oldHeading + (*curTurnSpeed) * (maxTurnAccel / maxTurnSpeed)); + +- const float minTurnAccel = std::min(float(std::abs(curDeltaHeading)), maxTurnAccel); ++ const float minTurnAccel = fminf(float(abs(curDeltaHeading)), maxTurnAccel); + const float rawTurnAccel = Clamp(Sign(curDeltaHeading) * maxTurnAccel, -minTurnAccel, minTurnAccel); + const float newTurnSpeed = Clamp((*curTurnSpeed) + rawTurnAccel * (1 - owner->IsInAir()), -maxTurnSpeed, maxTurnSpeed); ++++ rts/Sim/Projectiles/Unsynced/BitmapMuzzleFlame.cpp 2015-04-08 20:20:52 -0400 +@@ -1,4 +1,5 @@ + /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ + ++#include <math.h> + + #include "BitmapMuzzleFlame.h" +@@ -61,5 +62,5 @@ + const float ilength = length * (igrowth + 1.0f); + +- const float3 udir = (std::fabs(dir.dot(UpVector)) >= 0.99f)? FwdVector: UpVector; ++ const float3 udir = (fabsf(dir.dot(UpVector)) >= 0.99f)? FwdVector: UpVector; + const float3 xdir = (dir.cross(udir)).SafeANormalize(); + const float3 ydir = (dir.cross(xdir)).SafeANormalize(); diff --git a/games/spring/files/patch-remove-unused-vars b/games/spring/files/patch-remove-unused-vars new file mode 100644 index 000000000000..5a08e042751b --- /dev/null +++ b/games/spring/files/patch-remove-unused-vars @@ -0,0 +1,156 @@ +From + +https://github.com/spring/KAIK/commit/42fec4393483d9c0dd049ca84bd230988c2fbdb6 + +--- AI/Skirmish/KAIK/CommandTracker.h ++++ AI/Skirmish/KAIK/CommandTracker.h +@@ -15,7 +15,7 @@ class CCommandTracker { + ai(aic), + maxCmdsPerFrame(0), + peakCmdFrame(0), +- avgCmdSize(0.0f), ++ //avgCmdSize(0.0f), + totalCmdSize(0), + totalNumCmds(0) { + } +@@ -31,7 +31,7 @@ class CCommandTracker { + int maxCmdsPerFrame; + int peakCmdFrame; + +- float avgCmdSize; ++ //float avgCmdSize; + int totalCmdSize; + int totalNumCmds; + }; +--- AI/Skirmish/KAIK/KAIK.cpp ++++ AI/Skirmish/KAIK/KAIK.cpp +@@ -107,7 +107,6 @@ void CKAIK::UnitFinished(int unitID) { + + void CKAIK::UnitDestroyed(int unitID, int attackerUnitID) { + if (ai->Initialized()) { +- attackerUnitID = attackerUnitID; + ai->econTracker->UnitDestroyed(unitID); + + if (ai->GetUnit(unitID)->groupID != -1) { +@@ -151,10 +150,6 @@ void CKAIK::UnitDamaged(int unitID, int attackerID, float damage, float3 dir) { + if (ai->GetUnit(unitID)->isDead) { + return; + } +- +- attackerID = attackerID; +- dir = dir; +- + ai->econTracker->UnitDamaged(unitID, damage); + } + } +@@ -169,25 +164,25 @@ void CKAIK::UnitMoveFailed(int unitID) { + + void CKAIK::EnemyEnterLOS(int enemyUnitID) { + if (ai->Initialized()) { +- enemyUnitID = enemyUnitID; ++ //TODO + } + } + + void CKAIK::EnemyLeaveLOS(int enemyUnitID) { + if (ai->Initialized()) { +- enemyUnitID = enemyUnitID; ++ //TODO + } + } + + void CKAIK::EnemyEnterRadar(int enemyUnitID) { + if (ai->Initialized()) { +- enemyUnitID = enemyUnitID; ++ //TODO + } + } + + void CKAIK::EnemyLeaveRadar(int enemyUnitID) { + if (ai->Initialized()) { +- enemyUnitID = enemyUnitID; ++ //TODO + } + } + +@@ -201,9 +196,6 @@ void CKAIK::EnemyDestroyed(int enemyUnitID, int attackerUnitID) { + void CKAIK::EnemyDamaged(int enemyUnitID, int attackerUnitID, float damage, float3 dir) { + if (ai->Initialized()) { + ai->thm->EnemyDamaged(enemyUnitID, attackerUnitID); +- +- damage = damage; +- dir = dir; + } + } + +@@ -222,7 +214,6 @@ void CKAIK::EnemyFinished(int enemyUnitID) { + + void CKAIK::RecvChatMessage(const char* msg, int player) { + if (ai->Initialized()) { +- player = player; + + if ((msg = strstr(msg, "KAIK::")) == NULL) { + return; +--- AI/Skirmish/KAIK/MetalMap.cpp ++++ AI/Skirmish/KAIK/MetalMap.cpp +@@ -219,8 +219,6 @@ void CMetalMap::GetMetalPoints() { + } + } + +- // comment out for debug +- TotalMetal = TotalMetal; + } + + // set that spot's metal making ability (divide by cells to values are small) +--- AI/Skirmish/KAIK/MetalMap.h ++++ AI/Skirmish/KAIK/MetalMap.h +@@ -36,7 +36,7 @@ class CMetalMap { + int TempMetal; + int coordx; + int coordy; +- int Minradius; ++ //int Minradius; + int MinMetalForSpot; + int XtractorRadius; // in metal map units + int DoubleRadius; // in metal map units +--- AI/Skirmish/KAIK/MicroPather.cpp ++++ AI/Skirmish/KAIK/MicroPather.cpp +@@ -60,7 +60,7 @@ using namespace NSMicroPather; + class OpenQueueBH { + public: + +- OpenQueueBH(AIClasses* ai, PathNode** heapArray): ai(ai), size(0) { ++ OpenQueueBH(AIClasses* ai, PathNode** heapArray): size(0) { + this->heapArray = heapArray; + } + +@@ -174,7 +174,6 @@ class OpenQueueBH { + + private: + PathNode** heapArray; +- AIClasses* ai; + int size; + }; + +--- AI/Skirmish/KAIK/Unit.cpp ++++ AI/Skirmish/KAIK/Unit.cpp +@@ -93,8 +93,7 @@ bool CUNIT::CanAttack(int otherUnit) const { + return false; + } + +-bool CUNIT::CanAttackMe(int otherUnit) const { +- otherUnit = otherUnit; ++bool CUNIT::CanAttackMe(int /*otherUnit*/) const { + // TODO: the function above, in reverse + return true; + } +--- AI/Skirmish/KAIK/UnitHandler.cpp ++++ AI/Skirmish/KAIK/UnitHandler.cpp +@@ -117,7 +117,6 @@ void CUnitHandler::IdleUnitUpdate(int frame) { + } + + void CUnitHandler::UnitMoveFailed(int unitID) { +- unitID = unitID; + } + + // called when unit nanoframe first created diff --git a/games/spring/files/patch-rts-CMakeLists.txt b/games/spring/files/patch-rts-CMakeLists.txt deleted file mode 100644 index 1ba9519d4ea9..000000000000 --- a/games/spring/files/patch-rts-CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ ---- rts/CMakeLists.txt.orig 2013-11-09 00:09:15.910054493 +0400 -+++ rts/CMakeLists.txt 2013-11-09 00:18:23.355754880 +0400 -@@ -63,7 +63,7 @@ - ENDIF (PREFER_STATIC_LIBS) - - # Needed for dynamically loading shared libraries (on some OS) -- LIST(APPEND engineCommonLibraries dl) -+ LIST(APPEND engineCommonLibraries ${CMAKE_DL_LIBS} execinfo) - ENDIF (UNIX AND NOT MINGW) - - FIND_PACKAGE_STATIC(ZLIB REQUIRED) diff --git a/games/spring/files/patch-rts-Rendering-Shaders-ShaderStates.h b/games/spring/files/patch-rts-Rendering-Shaders-ShaderStates.h deleted file mode 100644 index f5650c787ce6..000000000000 --- a/games/spring/files/patch-rts-Rendering-Shaders-ShaderStates.h +++ /dev/null @@ -1,11 +0,0 @@ ---- rts/Rendering/Shaders/ShaderStates.h.orig 2013-12-06 06:06:48.795486079 +0400 -+++ rts/Rendering/Shaders/ShaderStates.h 2013-12-06 06:30:20.577430223 +0400 -@@ -227,7 +227,7 @@ - { - std::map<std::string, std::string>::const_iterator it = flags.find(flag); - if (it != flags.end()) { -- std::istringstream buf(*it); -+ std::istringstream buf(it->second); - T temp; - buf >> temp; - return temp; diff --git a/games/spring/files/patch-rts-Sim-Misc-DefinitionTag.h b/games/spring/files/patch-rts-Sim-Misc-DefinitionTag.h deleted file mode 100644 index 15328f6d59cc..000000000000 --- a/games/spring/files/patch-rts-Sim-Misc-DefinitionTag.h +++ /dev/null @@ -1,18 +0,0 @@ ---- rts/Sim/Misc/DefinitionTag.h.orig 2013-12-06 22:23:53.818446384 +0400 -+++ rts/Sim/Misc/DefinitionTag.h 2013-12-06 22:42:16.128369497 +0400 -@@ -15,7 +15,6 @@ - #include <typeinfo> - #include "Lua/LuaParser.h" - #include "System/float3.h" --#include "System/Util.h" - - //example usage: DUMMYTAG(Defs, DefClass, table, customParams) - struct table {}; -@@ -43,6 +42,7 @@ - } - }; - -+#include "System/Util.h" - - /** - * @brief Untyped definition tag meta data. diff --git a/games/spring/files/patch-rts-System-Platform-CpuID b/games/spring/files/patch-rts-System-Platform-CpuID new file mode 100644 index 000000000000..435bb706d66f --- /dev/null +++ b/games/spring/files/patch-rts-System-Platform-CpuID @@ -0,0 +1,11 @@ +Obtained from: http://www.viva64.com/en/b/0293/ + +--- rts/System/Platform/CpuID.cpp 2014-10-07 16:09:51 -0400 ++++ rts/System/Platform/CpuID.cpp 2015-04-07 20:23:18 -0400 +@@ -142,5 +142,5 @@ + ExecCPUID(&eax, &ebx, &ecx, &edx); + +- if ((ebx && 0xFFFF) == 0) ++ if ((ebx & 0xFFFF) == 0) + return; + diff --git a/games/spring/files/patch-rts-System-Platform-Linux-CrashHandler b/games/spring/files/patch-rts-System-Platform-Linux-CrashHandler new file mode 100644 index 000000000000..3d20dae85a07 --- /dev/null +++ b/games/spring/files/patch-rts-System-Platform-Linux-CrashHandler @@ -0,0 +1,8 @@ ++++ rts/System/Platform/Linux/CrashHandler.cpp 2015-04-08 20:09:33 -0400 +@@ -344,5 +344,5 @@ + boost::this_thread::sleep(boost::posix_time::seconds(10)); + #if defined(__GNUC__) +- std::_Exit(-1); ++ _Exit(-1); + #else + std::quick_exit(-1); diff --git a/games/spring/files/patch-rts-System-Platform-Linux-CrashHandler.cpp b/games/spring/files/patch-rts-System-Platform-Linux-CrashHandler.cpp deleted file mode 100644 index a39a1368bb1c..000000000000 --- a/games/spring/files/patch-rts-System-Platform-Linux-CrashHandler.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- rts/System/Platform/Linux/CrashHandler.cpp.orig 2013-03-26 03:58:36.000000000 +0400 -+++ rts/System/Platform/Linux/CrashHandler.cpp 2013-11-09 00:15:32.446878961 +0400 -@@ -323,7 +323,7 @@ - - static void ForcedExitAfterTenSecs() { - boost::this_thread::sleep(boost::posix_time::seconds(10)); -- std::_Exit(-1); -+ exit(-1); - } - - diff --git a/games/spring/files/patch-rts-System-Platform-Misc b/games/spring/files/patch-rts-System-Platform-Misc new file mode 100644 index 000000000000..b2d216f011b9 --- /dev/null +++ b/games/spring/files/patch-rts-System-Platform-Misc @@ -0,0 +1,9 @@ ++++ rts/System/Platform/Misc.cpp 2015-04-08 20:05:21 -0400 +@@ -226,5 +226,6 @@ + mib[2] = KERN_PROC_PATHNAME; + mib[3] = -1; +- char buf[PATH_MAX]; ++ long maxpath = pathconf("/", _PC_PATH_MAX); ++ char buf[maxpath]; + size_t cb = sizeof(buf); + int err = sysctl(mib, 4, buf, &cb, NULL, 0); diff --git a/games/spring/files/patch-rts-System-Platform-Misc.cpp b/games/spring/files/patch-rts-System-Platform-Misc.cpp deleted file mode 100644 index 15fd10eaf191..000000000000 --- a/games/spring/files/patch-rts-System-Platform-Misc.cpp +++ /dev/null @@ -1,29 +0,0 @@ ---- rts/System/Platform/Misc.cpp.orig 2012-02-12 22:27:27.502768102 +0400 -+++ rts/System/Platform/Misc.cpp 2012-02-13 01:50:43.365521912 +0400 -@@ -2,7 +2,7 @@ - - #include "Misc.h" - --#ifdef linux -+#if defined(linux) || defined(__FreeBSD__) - #include <unistd.h> - #include <dlfcn.h> // for dladdr(), dlopen() - -@@ -187,7 +187,7 @@ - procExeFilePath = GetRealPath(path); - } - #else -- #error implement this -+ return "%%PREFIX%%/bin/spring"; - #endif - - if (procExeFilePath.empty()) { -@@ -208,7 +208,7 @@ - // this will only be used if moduleFilePath stays empty - const char* error = NULL; - --#if defined(linux) || defined(__APPLE__) -+#if defined(linux) || defined(__APPLE__) || defined(__FreeBSD__) - #ifdef __APPLE__ - #define SHARED_LIBRARY_EXTENSION "dylib" - #else diff --git a/games/spring/files/patch-rts-System-Platform-Threading.cpp b/games/spring/files/patch-rts-System-Platform-Threading.cpp deleted file mode 100644 index f09508b7f012..000000000000 --- a/games/spring/files/patch-rts-System-Platform-Threading.cpp +++ /dev/null @@ -1,47 +0,0 @@ ---- rts/System/Platform/Threading.cpp.orig 2013-03-26 03:58:36.000000000 +0400 -+++ rts/System/Platform/Threading.cpp 2013-11-09 00:13:03.263078447 +0400 -@@ -39,7 +39,7 @@ - static boost::thread::id simThreadID; - static boost::thread::id batchThreadID; - #endif --#if defined(__APPLE__) -+#if defined(__APPLE__) || defined(__FreeBSD__) - #elif defined(WIN32) - static DWORD cpusSystem = 0; - #else -@@ -52,7 +52,7 @@ - if (inited) - return; - -- #if defined(__APPLE__) -+ #if defined(__APPLE__) || defined(__FreeBSD__) - // no-op - - #elif defined(WIN32) -@@ -76,7 +76,7 @@ - return ~0; - } - -- #if defined(__APPLE__) -+ #if defined(__APPLE__) || defined(__FreeBSD__) - // no-op - - #elif defined(WIN32) -@@ -151,7 +151,7 @@ - boost::uint32_t GetAvailableCoresMask() - { - boost::uint32_t systemCores = 0; -- #if defined(__APPLE__) -+ #if defined(__APPLE__) || defined(__FreeBSD__) - // no-op - systemCores = ~0; - -@@ -269,7 +269,7 @@ - - void SetThreadScheduler() - { -- #if defined(__APPLE__) -+ #if defined(__APPLE__) || defined(__FreeBSD__) - // no-op - - #elif defined(WIN32) diff --git a/games/spring/files/patch-rts-System-Rectangle.h b/games/spring/files/patch-rts-System-Rectangle.h deleted file mode 100644 index b8f4e69f7bd4..000000000000 --- a/games/spring/files/patch-rts-System-Rectangle.h +++ /dev/null @@ -1,11 +0,0 @@ ---- ./rts/System/Rectangle.h.orig 2013-03-26 03:58:36.000000000 +0400 -+++ ./rts/System/Rectangle.h 2013-11-11 00:22:51.737774094 +0400 -@@ -45,7 +45,7 @@ - y1 < rect.y2 && y2 > rect.y1; - } - -- bool operator< (const SRectangle& other) { -+ bool operator< (const SRectangle& other) const { - if (x1 == other.x1) { - return (z1 < other.z1); - } else { diff --git a/games/spring/files/patch-rts-System-creg-creg.h b/games/spring/files/patch-rts-System-creg-creg.h deleted file mode 100644 index ad6c9716edd5..000000000000 --- a/games/spring/files/patch-rts-System-creg-creg.h +++ /dev/null @@ -1,15 +0,0 @@ ---- rts/System/creg/creg.h.orig 2013-12-06 06:06:48.806486080 +0400 -+++ rts/System/creg/creg.h 2013-12-06 07:18:09.477443592 +0400 -@@ -442,10 +442,10 @@ - // Stupid GCC likes this template<> crap very much - #define CR_BIND_TEMPLATE(TCls, ctor_args) \ - template<> creg::IMemberRegistrator* TCls::memberRegistrator=0; \ -- template<> creg::Class* TCls::GetClass() const { return binder.class_; } \ - template<> void TCls::_ConstructInstance(void* d) { new(d) MyType ctor_args; } \ - template<> void TCls::_DestructInstance(void* d) { ((MyType*)d)->~MyType(); } \ -- template<> creg::ClassBinder TCls::binder(#TCls, 0, 0, &TCls::memberRegistrator, sizeof(TCls), alignof(TCls), TCls::hasVTable, TCls::_ConstructInstance, TCls::_DestructInstance); -+ template<> creg::ClassBinder TCls::binder(#TCls, 0, 0, &TCls::memberRegistrator, sizeof(TCls), alignof(TCls), TCls::hasVTable, TCls::_ConstructInstance, TCls::_DestructInstance); \ -+ template<> creg::Class* TCls::GetClass() const { return binder.class_; } - - /** @def CR_BIND_DERIVED_INTERFACE - * Bind an abstract derived class diff --git a/games/spring/files/patch-rts-build-cmake-FindAsciiDoc.cmake b/games/spring/files/patch-rts-build-cmake-FindAsciiDoc.cmake deleted file mode 100644 index 389fc2a4f1aa..000000000000 --- a/games/spring/files/patch-rts-build-cmake-FindAsciiDoc.cmake +++ /dev/null @@ -1,10 +0,0 @@ ---- rts/build/cmake/FindAsciiDoc.cmake.orig 2013-11-09 03:59:29.984998154 +0400 -+++ rts/build/cmake/FindAsciiDoc.cmake 2013-11-09 04:04:52.833206309 +0400 -@@ -41,6 +41,7 @@ - PATH_SUFFIXES - xml/docbook/stylesheet/nwalsh/manpages - sgml/docbook/xsl-stylesheets/manpages -+ xsl/docbook/manpages - DOC "DocBook XSL Style-Sheet" - ) - diff --git a/games/spring/files/patch-rts-build-cmake-Util b/games/spring/files/patch-rts-build-cmake-Util new file mode 100644 index 000000000000..af8a7b312d45 --- /dev/null +++ b/games/spring/files/patch-rts-build-cmake-Util @@ -0,0 +1,28 @@ +Obtained via: https://springrts.com/mantis/view.php?id=4679 + +From 9e0db5f602407de4e7875ca85761b41782c1bb9c Mon Sep 17 00:00:00 2001 +From: Johan Rehnberg <cleanrock@gmail.com> +Date: Wed, 31 Dec 2014 11:35:19 +0100 +Subject: [PATCH] fix GetListOfSubModules to support GLOB returning both "//" + and "/" + +I needed this when building on archlinux with cmake 3.1.0 where GLOB returns "/" + +... + +--- rts/build/cmake/Util.cmake ++++ rts/build/cmake/Util.cmake +@@ -166,10 +166,11 @@ EndFunction (MakeGlobal) + # Find all CMakeLists.txt files in sub-directories + Macro (GetListOfSubModules list_var) + File(GLOB ${list_var} RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" FOLLOW_SYMLINKS "${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt") +- + # Strip away the "/CMakeLists.txt" parts, so we end up with just a list of dirs, + # for example: AAI;RAI;KAIK +- String(REPLACE "//CMakeLists.txt" "" ${list_var} "${${list_var}}") ++ # GLOB can prefix with "//" or "/" (perhaps changed in cmake 3.1.0), this double replace will support both "//" and "/" ++ String(REPLACE "/CMakeLists.txt" "" ${list_var} "${${list_var}}") ++ String(REPLACE "/" "" ${list_var} "${${list_var}}") + EndMacro (GetListOfSubModules list_var) + + diff --git a/games/spring/files/patch-rts-builds-dedicated-CMakeLists.txt b/games/spring/files/patch-rts-builds-dedicated-CMakeLists.txt deleted file mode 100644 index 1788b3cf2754..000000000000 --- a/games/spring/files/patch-rts-builds-dedicated-CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ ---- ./rts/builds/dedicated/CMakeLists.txt.orig 2013-03-26 03:58:36.000000000 +0400 -+++ ./rts/builds/dedicated/CMakeLists.txt 2013-11-09 00:39:09.704093624 +0400 -@@ -24,7 +24,7 @@ - LIST(APPEND engineDedicatedLibraries headlessStubs) - IF (UNIX) - # Needed for dynamically loading shared libraries (on some OS) -- LIST(APPEND engineDedicatedLibraries dl) -+ LIST(APPEND engineDedicatedLibraries ${CMAKE_DL_LIBS} execinfo) - ENDIF (UNIX) - - IF (MINGW OR APPLE) diff --git a/games/spring/files/patch-rts-lib-assimp-code-STEPFile.h b/games/spring/files/patch-rts-lib-assimp-code-STEPFile.h deleted file mode 100644 index a051d822cac4..000000000000 --- a/games/spring/files/patch-rts-lib-assimp-code-STEPFile.h +++ /dev/null @@ -1,18 +0,0 @@ ---- rts/lib/assimp/code/STEPFile.h.orig 2013-03-26 03:58:36.000000000 +0400 -+++ rts/lib/assimp/code/STEPFile.h 2013-11-11 04:15:43.177772957 +0400 -@@ -195,13 +195,13 @@ - // conversion support. - template <typename T> - const T& ResolveSelect(const DB& db) const { -- return Couple<T>(db).MustGetObject(To<EXPRESS::ENTITY>())->To<T>(); -+ return Couple<T>(db).MustGetObject(To<EXPRESS::ENTITY>())->template To<T>(); - } - - template <typename T> - const T* ResolveSelectPtr(const DB& db) const { - const EXPRESS::ENTITY* e = ToPtr<EXPRESS::ENTITY>(); -- return e?Couple<T>(db).MustGetObject(*e)->ToPtr<T>():(const T*)0; -+ return e?Couple<T>(db).MustGetObject(*e)->template ToPtr<T>():(const T*)0; - } - - public: diff --git a/games/spring/files/patch-rts-lib-gml-gmlcls.h b/games/spring/files/patch-rts-lib-gml-gmlcls.h deleted file mode 100644 index d4ba7fc30884..000000000000 --- a/games/spring/files/patch-rts-lib-gml-gmlcls.h +++ /dev/null @@ -1,33 +0,0 @@ ---- rts/lib/gml/gmlcls.h.orig 2013-12-07 00:06:39.928020847 +0400 -+++ rts/lib/gml/gmlcls.h 2013-12-07 00:09:21.477010398 +0400 -@@ -43,7 +43,7 @@ - extern bool ThreadRegistered(); - - // memory barriers for different platforms --#if defined(__APPLE__) || defined(__FreeBSD__) -+#if defined(__APPLE__) - # include <libkern/OSAtomic.h> - # define GML_MEMBAR OSMemoryBarrier() - #elif defined(__GNUC__) -@@ -95,7 +95,7 @@ - # define GML_TYPENAME - #endif - --#ifndef _WIN32 //defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) -+#if defined(__linux__) || defined(__APPLE__) - # define GML_USE_SPEEDY_TLS 1 - # include "System/Platform/errorhandler.h" - # include "speedy-tls.h" -@@ -234,11 +234,7 @@ - } - virtual ~gmlBaseMutexLock() { - if (GML::Enabled()) { --#if (BOOST_VERSION >= 103500) -- ((T*)lockdata)->boost::unique_lock<U>::~unique_lock(); --#else -- ((T*)lockdata)->boost::scoped_lock<U>::~scoped_lock(); --#endif -+ ((T*)lockdata)->~T(); - } - } - }; diff --git a/games/spring/files/patch-rts-lib-gml-speedy-tls.cpp b/games/spring/files/patch-rts-lib-gml-speedy-tls.cpp deleted file mode 100644 index aee5a9213c1a..000000000000 --- a/games/spring/files/patch-rts-lib-gml-speedy-tls.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- rts/lib/gml/speedy-tls.cpp.orig 2010-09-06 16:16:18.000000000 +0400 -+++ rts/lib/gml/speedy-tls.cpp 2010-09-15 23:37:21.000000000 +0400 -@@ -3,7 +3,7 @@ - //Contains macros that can be used to very quickly (one instruction) access thread-local memory. - - #ifdef USE_GML --#ifndef _WIN32 -+#if defined(__linux__) || defined(__APPLE__) - - #include "speedy-tls.h" - #include <stdlib.h> diff --git a/games/spring/files/patch-rts-lib-headlessStubs-CMakeLists.txt b/games/spring/files/patch-rts-lib-headlessStubs-CMakeLists.txt deleted file mode 100644 index 9f342c93559b..000000000000 --- a/games/spring/files/patch-rts-lib-headlessStubs-CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ ---- rts/lib/headlessStubs/CMakeLists.txt.orig 2013-03-26 03:58:36.000000000 +0400 -+++ rts/lib/headlessStubs/CMakeLists.txt 2013-12-07 07:05:38.984034014 +0400 -@@ -15,8 +15,8 @@ - ELSE (MINGW) - # Use a direct copy of the GL and SDL headers, - # as these may not be available on headless systems. -- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) -- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL) -+ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include) -+ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include/SDL) - ENDIF (MINGW) - - ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources}) diff --git a/games/spring/files/patch-rts-lib-headlessStubs-glstub b/games/spring/files/patch-rts-lib-headlessStubs-glstub new file mode 100644 index 000000000000..80d2bcfc7310 --- /dev/null +++ b/games/spring/files/patch-rts-lib-headlessStubs-glstub @@ -0,0 +1,13 @@ +Submitted upstream: + + https://springrts.com/mantis/view.php?id=4731 + +--- rts/lib/headlessStubs/glstub.c 2014-10-07 16:09:52 -0400 ++++ rts/lib/headlessStubs/glstub.c 2015-04-08 14:03:33 -0400 +@@ -131,5 +131,5 @@ + GLAPI void APIENTRY glGetShaderiv(GLuint shader, GLenum pname, GLint *params) {} + GLAPI void APIENTRY glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {} +-GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length) {} ++GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) {} + + GLAPI void APIENTRY glUniform1fARB(GLint location, GLfloat v0) {} diff --git a/games/spring/files/patch-rts-lib-minizip-CMakeLists.txt b/games/spring/files/patch-rts-lib-minizip-CMakeLists.txt deleted file mode 100644 index 052ecb63c54d..000000000000 --- a/games/spring/files/patch-rts-lib-minizip-CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ ---- rts/lib/minizip/CMakeLists.txt.orig 2013-03-26 03:58:36.000000000 +0400 -+++ rts/lib/minizip/CMakeLists.txt 2013-11-09 04:02:41.051969166 +0400 -@@ -1,7 +1,6 @@ - # Spring supplied CMake build file - - Set(MINIZIP_FIND_QUIETLY TRUE) --FIND_PACKAGE_STATIC(MiniZip) - - If (MINIZIP_FOUND) - # Use the system supplied MiniZip library diff --git a/games/spring/files/patch-tools-pr-downloader-src-lib-pugixml-pugixml.hpp b/games/spring/files/patch-tools-pr-downloader-src-lib-pugixml-pugixml.hpp deleted file mode 100644 index 29b2df62d3ed..000000000000 --- a/games/spring/files/patch-tools-pr-downloader-src-lib-pugixml-pugixml.hpp +++ /dev/null @@ -1,38 +0,0 @@ ---- tools/pr-downloader/src/lib/pugixml/pugixml.hpp.orig 2013-12-06 06:19:54.039431635 +0400 -+++ tools/pr-downloader/src/lib/pugixml/pugixml.hpp 2013-12-06 06:24:02.124415606 +0400 -@@ -17,32 +17,9 @@ - #include "pugiconfig.hpp" - - #ifndef PUGIXML_NO_STL --namespace std --{ -- struct bidirectional_iterator_tag; -- --#ifdef __SUNPRO_CC -- // Sun C++ compiler has a bug which forces template argument names in forward declarations to be the same as in actual definitions -- template <class _T> class allocator; -- template <class _charT> struct char_traits; -- template <class _charT, class _Traits> class basic_istream; -- template <class _charT, class _Traits> class basic_ostream; -- template <class _charT, class _Traits, class _Allocator> class basic_string; --#else -- // Borland C++ compiler has a bug which forces template argument names in forward declarations to be the same as in actual definitions -- template <class _Ty> class allocator; -- template <class _Ty> struct char_traits; -- template <class _Elem, class _Traits> class basic_istream; -- template <class _Elem, class _Traits> class basic_ostream; -- template <class _Elem, class _Traits, class _Ax> class basic_string; --#endif -- -- // Digital Mars compiler has a bug which requires a forward declaration for explicit instantiation (otherwise type selection is messed up later, producing link errors) -- // Also note that we have to declare char_traits as a class here, since it's defined that way --#ifdef __DMC__ -- template <> class char_traits<char>; --#endif --} -+# include <istream> -+# include <ostream> -+# include <string> - #endif - - // Macro for deprecated features diff --git a/games/spring/files/patch-tools-pr-downloader-src-lib-xmlrpc++-src-base64.h b/games/spring/files/patch-tools-pr-downloader-src-lib-xmlrpc++-src-base64.h deleted file mode 100644 index 4b669b62384d..000000000000 --- a/games/spring/files/patch-tools-pr-downloader-src-lib-xmlrpc++-src-base64.h +++ /dev/null @@ -1,11 +0,0 @@ ---- tools/pr-downloader/src/lib/xmlrpc++/src/base64.h.orig 2013-03-26 03:58:49.000000000 +0400 -+++ tools/pr-downloader/src/lib/xmlrpc++/src/base64.h 2013-11-09 14:42:21.013340982 +0400 -@@ -13,6 +13,8 @@ - # include <iterator> - #endif - -+#include <ios> -+ - static - int _base64Chars[]= {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', - 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', diff --git a/games/spring/files/patch-tools__unitsync__test__CMakeLists.txt b/games/spring/files/patch-tools__unitsync__test__CMakeLists.txt deleted file mode 100644 index 0555dae44f00..000000000000 --- a/games/spring/files/patch-tools__unitsync__test__CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -From f55278791ac68eafc72b376a8c68b7002d82647c Mon Sep 17 00:00:00 2001 -From: abma <spring@abma.de> -Date: Wed, 4 Jun 2014 14:49:56 +0200 -Subject: [PATCH] fix #4415 - ---- - tools/unitsync/test/CMakeLists.txt | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/tools/unitsync/test/CMakeLists.txt b/tools/unitsync/test/CMakeLists.txt -index 9203560..5961130 100644 ---- tools/unitsync/test/CMakeLists.txt -+++ tools/unitsync/test/CMakeLists.txt -@@ -10,10 +10,6 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") - - REMOVE_DEFINITIONS(-DUNITSYNC) - --# To allow linking to MODULE_LIBRARY targets --CMAKE_POLICY(SET CMP0001 OLD) --SET(CMAKE_BACKWARDS_COMPATIBILITY "2.2") -- - ADD_EXECUTABLE(lua2php EXCLUDE_FROM_ALL lua2php.cpp) - TARGET_LINK_LIBRARIES(lua2php unitsync ${CMAKE_DL_LIBS}) - ADD_DEPENDENCIES(lua2php unitsync) diff --git a/games/spring/files/patch-use-system-sdl b/games/spring/files/patch-use-system-sdl new file mode 100644 index 000000000000..85a8c57c8eca --- /dev/null +++ b/games/spring/files/patch-use-system-sdl @@ -0,0 +1,93 @@ +--- rts/builds/dedicated/CMakeLists.txt 2014-10-07 16:09:51 -0400 ++++ rts/builds/dedicated/CMakeLists.txt 2015-04-08 15:27:03 -0400 +@@ -43,19 +43,6 @@ + ENDIF (UNIX AND NOT MINGW) + +-IF (MINGW OR APPLE) +- # Windows: +- # We still need these header files, +- # even if we are not going to link with SDL. +- # We have them available anyway (mingwlibs). +- # OS X: +- # Cocoa requires the SDL libary, whenever the SDL headers are used, +- # due to some #define magic, which is practically impossible to workaround. +- FIND_PACKAGE(SDL2 REQUIRED) +- INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) +-ELSE (MINGW OR APPLE) +- # Use a direct copy of the GL and SDL headers, +- # as these may not be available on headless systems. +- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL2) +-ENDIF (MINGW OR APPLE) ++FIND_PACKAGE(SDL2 REQUIRED) ++INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) + + +--- rts/builds/headless/CMakeLists.txt 2014-10-07 16:09:51 -0400 ++++ rts/builds/headless/CMakeLists.txt 2015-04-08 16:31:25 -0400 +@@ -14,22 +14,7 @@ + + include_directories(${OPENAL_INCLUDE_DIR}) +-IF (MINGW OR APPLE) +- # Windows: +- # We still need these header files, +- # even if we are not going to link with gl, glu and SDL. +- # We have them available anyway (mingwlibs). +- # OS X: +- # Cocoa requires the SDL libary, whenever the SDL headers are used, +- # due to some #define magic, which is practically impossible to workaround. +- FIND_PACKAGE(OpenGL REQUIRED) +- FIND_PACKAGE(SDL2 REQUIRED) +- INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) +-ELSE (MINGW OR APPLE) +- # Use a direct copy of the GL and SDL headers, +- # as these may not be available on headless systems. +- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL2) +-ENDIF (MINGW OR APPLE) + ++FIND_PACKAGE(SDL2 REQUIRED) ++INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) + + # headlessstubs are our stubs that replace libGL, libGLU, libGLEW, libSDL (yes really!) +--- rts/lib/headlessStubs/CMakeLists.txt 2014-10-07 16:09:52 -0400 ++++ rts/lib/headlessStubs/CMakeLists.txt 2015-04-08 14:40:20 -0400 +@@ -7,16 +7,6 @@ + ) + +-IF (WIN32) +- # We still need these header files, +- # even if we are not going to link with SDL. +- # We have them available anyway (mingwlibs). +- FIND_PACKAGE(SDL2 REQUIRED) +- INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) +-ELSE (WIN32) +- # Use a direct copy of the GL and SDL headers, +- # as these may not be available on headless systems. +- INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include) +- INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include/SDL2) +-ENDIF (WIN32) ++FIND_PACKAGE(SDL2 REQUIRED) ++INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) + + ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources}) +--- tools/unitsync/CMakeLists.txt 2014-10-07 16:09:52 -0400 ++++ tools/unitsync/CMakeLists.txt 2015-04-08 16:10:11 -0400 +@@ -22,16 +22,6 @@ + ENDIF (WIN32) + +-IF (MINGW) +- # We still need these header files, +- # even if we are not going to link with SDL. +- # We have them available anyway (mingwlibs). +- FIND_PACKAGE(SDL2 REQUIRED) +- INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) +-ELSE (MINGW) +- # Use a direct copy of the GL and SDL headers, +- # as these may not be available on headless systems. +- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL2) +-ENDIF (MINGW) +- ++FIND_PACKAGE(SDL2 REQUIRED) ++INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR}) + + ADD_DEFINITIONS(-DUNITSYNC) diff --git a/games/spring/pkg-plist b/games/spring/pkg-plist index 2b623d7f0f1b..6cdbae6f78ac 100644 --- a/games/spring/pkg-plist +++ b/games/spring/pkg-plist @@ -2,14 +2,10 @@ bin/spring bin/spring-dedicated bin/spring-headless -bin/spring-multithreaded -%%PR_DOWNLOADER%%lib/libpr-downloader_shared.so -%%PR_DOWNLOADER%%lib/libpr-downloader_static.a -lib/libspringserver.so lib/libunitsync.so %%MANPAGES%%man/man6/spring-dedicated.6.gz %%MANPAGES%%man/man6/spring-headless.6.gz -%%MANPAGES%%man/man6/spring-multithreaded.6.gz +%%MANPAGES%%man/man6/spring-legacy.6.gz %%MANPAGES%%man/man6/spring.6.gz share/applications/spring.desktop share/mime/packages/spring.xml |