Skip to content

Commit

Permalink
games/stuntrally: update 2.6.2 → 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Oct 2, 2023
1 parent d797c1f commit 79994bd
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 54 deletions.
58 changes: 26 additions & 32 deletions games/stuntrally/Makefile
@@ -1,65 +1,59 @@
PORTNAME= stuntrally
PORTVERSION= 2.6.2
PORTREVISION= 5
PORTVERSION= 2.7
CATEGORIES= games

MAINTAINER= amdmi3@FreeBSD.org
COMMENT= 3D racing game based on VDrift and OGRE with track editor
WWW= https://stuntrally.tuxfamily.org/
WWW= https://stuntrally.tuxfamily.org/ \
https://github.com/stuntrally/stuntrally/

LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/License.txt

BROKEN= fails to compile: member access into incomplete type Ogre::

LIB_DEPENDS= libboost_thread.so:devel/boost-libs

LIB_DEPENDS= libboost_thread.so:devel/boost-libs \
libOgreMain.so:graphics/ogre3d \
libBulletDynamics.so:devel/bullet \
libMyGUIEngine.so:x11-toolkits/mygui \
libogg.so:audio/libogg \
libvorbisfile.so:audio/libvorbis \
libenet.so:net/enet \
libtinyxml.so:textproc/tinyxml \
libtinyxml2.so:textproc/tinyxml2
BUILD_DEPENDS= ${LOCALBASE}/include/MYGUI/MyGUI_OgreTexture.h:x11-toolkits/mygui-ogre

USES= compiler:c++14-lang cmake pkgconfig sdl
USE_SDL= sdl2
USE_GITHUB= yes
GH_TUPLE= stuntrally:tracks:${PORTVERSION}:tracks/data/tracks

USES= compiler:c++14-lang cmake dos2unix pkgconfig
DOS2UNIX_FILES= source/ogre/BaseApp_Create.cpp
CMAKE_ARGS= -DSHARE_INSTALL="${DATADIR_REL}" \
-DBULLET_ROOT="${LOCALBASE}"
CMAKE_ON= SR_FORCE_SYSTEM_DEPENDENCIES

LDFLAGS_i386= -Wl,-znotext

PORTDOCS= Readme.txt
PORTDOCS= *
PORTDATA= *

OPTIONS_DEFINE= GAME EDITOR MASTER_SERVER DOCS
OPTIONS_DEFAULT=GAME EDITOR
OPTIONS_DEFINE= GAME EDITOR TRANSLATOR MASTER_SERVER DOCS
OPTIONS_DEFAULT=GAME EDITOR TRANSLATOR
OPTIONS_SUB= yes

GAME_DESC= Build the game binary
GAME_CMAKE_BOOL= BUILD_GAME
GAME_LIB_DEPENDS= libOgreMain.so:graphics/ogre3d19 \
libBulletDynamics.so:devel/bullet \
libMyGUIEngine.so:x11-toolkits/mygui \
libogg.so:audio/libogg \
libvorbisfile.so:audio/libvorbis \
libenet.so:net/enet
GAME_BUILD_DEPENDS= ${LOCALBASE}/include/MYGUI/MyGUI_OgreTexture.h:x11-toolkits/mygui-ogre
GAME_USE= SDL=sdl2
GAME_USES= openal sdl
GAME_USES= openal

EDITOR_DESC= Build the track editor
EDITOR_CMAKE_BOOL= BUILD_EDITOR
EDITOR_LIB_DEPENDS= libOgreMain.so:graphics/ogre3d19 \
libBulletDynamics.so:devel/bullet \
libMyGUIEngine.so:x11-toolkits/mygui \
libogg.so:audio/libogg \
libvorbisfile.so:audio/libvorbis
EDITOR_USE= SDL=sdl2
EDITOR_USES= sdl
EDITOR_BUILD_DEPENDS= ${LOCALBASE}/include/MYGUI/MyGUI_OgreTexture.h:x11-toolkits/mygui-ogre
EDITOR_USES= openal

TRANSLATOR_DESC= Build translation tool
TRANSLATOR_CMAKE_BOOL= BUILD_TRANSL_TOOL

MASTER_SERVER_CMAKE_BOOL= BUILD_MASTER_SERVER
MASTER_SERVER_DESC= Build the master server
MASTER_SERVER_LIB_DEPENDS= libenet.so:net/enet

post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/Readme.txt ${STAGEDIR}${DOCSDIR}/
${INSTALL_DATA} ${WRKSRC}/Readme.md ${STAGEDIR}${DOCSDIR}/

.include <bsd.port.mk>
10 changes: 5 additions & 5 deletions games/stuntrally/distinfo
@@ -1,5 +1,5 @@
TIMESTAMP = 1648667237
SHA256 (stuntrally-stuntrally-2.6.2_GH0.tar.gz) = a63550d5d13d20dca678c2cd8e30332cd41ca5380d14720c15549e6b0387bd55
SIZE (stuntrally-stuntrally-2.6.2_GH0.tar.gz) = 651633552
SHA256 (stuntrally-tracks-2.6.2_GH0.tar.gz) = 4fd587cf6cfe72e78530bb051bd423f9d0d0e38ca258e8254a4fdd6e60db5bcc
SIZE (stuntrally-tracks-2.6.2_GH0.tar.gz) = 357438076
TIMESTAMP = 1668431328
SHA256 (stuntrally-stuntrally-2.7_GH0.tar.gz) = 462711306ec33e2dad1a729d7dbf0da2a8bfec2c36d582cc4c192c2e6f2de12c
SIZE (stuntrally-stuntrally-2.7_GH0.tar.gz) = 770702361
SHA256 (stuntrally-tracks-2.7_GH0.tar.gz) = fe7ba531fbdb3c5ba9b25f0748c2aac465c6aad33e957f722e2316a3129bd472
SIZE (stuntrally-tracks-2.7_GH0.tar.gz) = 445486760
15 changes: 0 additions & 15 deletions games/stuntrally/files/patch-CMakeLists.txt

This file was deleted.

24 changes: 24 additions & 0 deletions games/stuntrally/files/patch-cmake_DependenciesConfig.cmake
@@ -0,0 +1,24 @@
--- cmake/DependenciesConfig.cmake.orig 2022-11-11 19:35:22 UTC
+++ cmake/DependenciesConfig.cmake
@@ -79,13 +79,14 @@ add_external_lib(
FIND_PACKAGE
)

-add_external_lib(
- tinyxml
- tinyxml/2.6.2
- REQUIRED
- PKG_CONFIG "tinyxml >= 2.6"
- FIND_PACKAGE
-)
+find_path(TINYXML_INCLUDE_DIR tinyxml.h)
+find_library(TINYXML_LIBRARY tinyxml)
+
+add_library(tinyxml::tinyxml INTERFACE IMPORTED GLOBAL)
+target_include_directories(tinyxml::tinyxml INTERFACE ${TINYXML_INCLUDE_DIR})
+target_link_libraries(tinyxml::tinyxml INTERFACE ${TINYXML_LIBRARY})
+
+message(STATUS "Added inteface tinyxml ${TINYXML_INCLUDE_DIR} ${TINYXML_LIBRARY}")

add_external_lib(
tinyxml2
11 changes: 11 additions & 0 deletions games/stuntrally/files/patch-source_editor_BaseApp__Create.cpp
@@ -0,0 +1,11 @@
--- source/editor/BaseApp_Create.cpp.orig 2022-11-11 19:35:22 UTC
+++ source/editor/BaseApp_Create.cpp
@@ -240,7 +240,7 @@ bool BaseApp::setup()
#endif
}
#ifdef _DEBUG
- Ogre::LogManager::getSingleton().setMinLogLevel(LML_TRIVIAL); // all
+ //Ogre::LogManager::getSingleton().setMinLogLevel(LML_TRIVIAL); // all
#endif

#ifdef _DEBUG
32 changes: 32 additions & 0 deletions games/stuntrally/files/patch-source_ogre_BaseApp__Create.cpp
@@ -0,0 +1,32 @@
--- source/ogre/BaseApp_Create.cpp.orig 2022-11-11 19:35:22 UTC
+++ source/ogre/BaseApp_Create.cpp
@@ -177,12 +177,16 @@ BaseApp::~BaseApp()
mPlatform->shutdown(); delete mPlatform; mPlatform = 0; }

// save inputs
- mInputCtrl->save(PATHMANAGER::UserConfigDir() + "/input.xml");
- delete mInputCtrl;
+ if (mInputCtrl) {
+ mInputCtrl->save(PATHMANAGER::UserConfigDir() + "/input.xml");
+ delete mInputCtrl;
+ }
for (int i=0; i<4; ++i)
{
- mInputCtrlPlayer[i]->save(PATHMANAGER::UserConfigDir() + "/input_p" + toStr(i) + ".xml");
- delete mInputCtrlPlayer[i];
+ if (mInputCtrlPlayer[i]) {
+ mInputCtrlPlayer[i]->save(PATHMANAGER::UserConfigDir() + "/input_p" + toStr(i) + ".xml");
+ delete mInputCtrlPlayer[i];
+ }
}

delete mInputWrapper;
@@ -326,7 +330,7 @@ bool BaseApp::setup()
#endif

#ifdef _DEBUG
- LogManager::getSingleton().setMinLogLevel(LML_TRIVIAL); // all
+ //LogManager::getSingleton().setMinLogLevel(LML_TRIVIAL); // all
#endif

setupResources();
17 changes: 17 additions & 0 deletions games/stuntrally/files/patch-source_ogre_common_Terrain.cpp
@@ -0,0 +1,17 @@
--- source/ogre/common/Terrain.cpp.orig 2022-11-11 19:35:22 UTC
+++ source/ogre/common/Terrain.cpp
@@ -202,8 +202,12 @@ if (bTer)
// sync load since we want everything in place when we start
mTerrainGroup->loadAllTerrains(true);

- auto tsm = mTerrainGroup->getTerrainSlots();
- terrain = tsm[0]->instance;
+ TerrainGroup::TerrainIterator ti = mTerrainGroup->getTerrainIterator();
+ while (ti.hasMoreElements())
+ {
+ terrain = ti.getNext()->instance;
+ terrain->setVisibilityFlags(RV_Terrain);
+ }

mTerrainGroup->freeTemporaryResources();
}
@@ -0,0 +1,11 @@
--- source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp.orig 2022-11-11 19:35:22 UTC
+++ source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp
@@ -7,7 +7,7 @@
#include <OgreLogManager.h>

//#if 0 // for Ogre 1.9 only
-#if OGRE_VERSION >= MYGUI_DEFINE_VERSION(1, 12, 0)
+#if 1
namespace Ogre
{
template <typename T> class MapIterator;
5 changes: 3 additions & 2 deletions games/stuntrally/pkg-plist
@@ -1,7 +1,8 @@
%%EDITOR%%bin/sr-editor
%%TRANSLATOR%%bin/sr-translator
%%MASTER_SERVER%%bin/sr-masterserver
%%GAME%%bin/stuntrally
%%EDITOR%%share/applications/sr-editor.desktop
%%GAME%%share/applications/stuntrally.desktop
%%EDITOR%%share/icons/hicolor/64x64/apps/sr-editor.png
%%GAME%%share/icons/hicolor/256x256/apps/stuntrally.png
%%EDITOR%%share/icons/hicolor/512x512/apps/sr-editor.png
%%GAME%%share/icons/hicolor/512x512/apps/stuntrally.png

0 comments on commit 79994bd

Please sign in to comment.