Import Stratagus 2.4.2 as wip/stratagus

This commit is contained in:
Charlotte Koch 2019-07-06 13:24:09 -07:00
parent e55b214acb
commit c716ceac1c
9 changed files with 186 additions and 0 deletions

4
stratagus/DESCR Normal file
View File

@ -0,0 +1,4 @@
Stratagus is a free cross-platform real-time strategy gaming engine. It
includes support for playing over the internet/LAN, or playing a computer
opponent. The engine is configurable and can be used to create games with a
wide-range of features specific to your needs. Stratagus is written in C++.

33
stratagus/Makefile Normal file
View File

@ -0,0 +1,33 @@
# $NetBSD$
DISTNAME= stratagus-2.4.2
CATEGORIES= games
GITHUB_PROJECT= stratagus
GITHUB_TAG= v${PKGVERSION_NOREV}
MASTER_SITES= ${MASTER_SITE_GITHUB:=Wargus/}
MAINTAINER= cfkoch@edgebsd.org
HOMEPAGE= https://github.com/Wargus/stratagus
COMMENT= Real-time strategy gaming engine
LICENSE= gnu-gpl-v2
EXTRACT_USING= gtar
USE_CMAKE= yes
USE_LANGUAGES= c c++
BUILD_DEPENDS+= tolua++-1.0.93:../../wip/tolua++
CMAKE_ARGS+= -DWANT_METASERVER=OFF
CMAKE_ARGS+= -DWITH_RENDERER=NativeSDL
.include "../../archivers/bzip2/buildlink3.mk"
.include "../../audio/fluidsynth/buildlink3.mk"
.include "../../audio/libmikmod/buildlink3.mk"
.include "../../audio/libvorbis/buildlink3.mk"
.include "../../devel/SDL/buildlink3.mk"
.include "../../graphics/mng/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../lang/lua51/buildlink3.mk"
.include "../../multimedia/libtheora/buildlink3.mk"
.include "../../wip/tolua++/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

3
stratagus/PLIST Normal file
View File

@ -0,0 +1,3 @@
@comment $NetBSD$
bin/png2stratagus
games/stratagus

11
stratagus/distinfo Normal file
View File

@ -0,0 +1,11 @@
$NetBSD$
SHA1 (stratagus-2.4.2.tar.gz) = 83170db200f0f7fe293a48ac90e9645f6605e6cc
RMD160 (stratagus-2.4.2.tar.gz) = a83ab6a87e98fa10cdb2f4d938a7010042ba6fb7
SHA512 (stratagus-2.4.2.tar.gz) = 4539295f7575883ae6fe7f1ae48aedefcf08ce55bffeb6f1e9275ed0138c499f8b838904002f873065d8d441932f5df4f223d34144669c461b523ce7a28b0bc9
Size (stratagus-2.4.2.tar.gz) = 1114717 bytes
SHA1 (patch-CMakeLists.txt) = 8cac871f9fa73f0fc11aa81a8699f435f2081dc7
SHA1 (patch-src_ui_interface.cpp) = 46451e5e21d826793849db852f15d0ab849f65c0
SHA1 (patch-src_video_graphic.cpp) = 73ce87e430c9752a02558c08366f5c86c49e69ba
SHA1 (patch-src_video_sdl.cpp) = c6b77dca09b0bbeee38eb11fdbaa511e512ac56b
SHA1 (patch-src_video_video.cpp) = aa9952143dd25bc877c0fb6bbc8f9b4b64aab48a

View File

@ -0,0 +1,51 @@
# $NetBSD$
Make the building and installation of the metaserver optional.
--- CMakeLists.txt.orig 2018-09-29 11:47:42.000000000 -0700
+++ CMakeLists.txt 2019-07-06 12:03:25.664440117 -0700
@@ -627,7 +627,7 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.a")
endif()
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
+set (CMAKE_MODULE_PATH "/usr/pkgsrc/wip/stratagus/work/.buildlink/cmake-Modules" "/usr/pkgsrc/wip/stratagus/work/.buildlink/cmake-Modules" ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
find_package(Lua51 REQUIRED)
find_package(PNG REQUIRED)
@@ -698,6 +698,8 @@
option(ENABLE_USEGAMEDIR "Place all files created by Stratagus(logs, savegames) in game directory(old behavior), otherwise place everything in user directory(new behavior)" OFF)
option(ENABLE_MULTIBUILD "Compile Stratagus on all CPU cores simltaneously in MSVC" ON)
+option(WANT_METASERVER "Build and install the metaserver" ON)
+
if(NOT WITH_RENDERER)
if(OPENGL_FOUND)
set(WITH_RENDERER "OpenGL")
@@ -1121,7 +1123,7 @@
source_group(metaserver FILES ${metaserver_SRCS} ${metaserver_HDRS})
-if(SQLITE_FOUND)
+if(SQLITE_FOUND AND WANT_METASERVER)
add_executable(metaserver ${metaserver_SRCS} ${metaserver_HDRS})
target_link_libraries(metaserver ${SDL_LIBRARY} ${SQLITE_LIBRARIES})
@@ -1207,7 +1209,7 @@
if(ENABLE_UPX AND SELF_PACKER_FOR_EXECUTABLE)
self_packer(stratagus)
self_packer(png2stratagus)
- if(SQLITE_FOUND)
+ if(SQLITE_FOUND AND WANT_METASERVER)
self_packer(metaserver)
endif()
endif()
@@ -1244,7 +1246,7 @@
install(TARGETS stratagus DESTINATION ${GAMEDIR})
install(TARGETS png2stratagus DESTINATION ${BINDIR})
-if(SQLITE_FOUND)
+if(SQLITE_FOUND AND WANT_METASERVER)
install(TARGETS metaserver DESTINATION ${BINDIR} RENAME stratagus-metaserver)
endif()

View File

@ -0,0 +1,20 @@
# $NetBSD$
Don't assume that we've enabled OpenGL support.
--- ./src/ui/interface.cpp.orig 2019-07-06 12:41:25.523375960 -0700
+++ ./src/ui/interface.cpp 2019-07-06 12:42:09.515534108 -0700
@@ -733,11 +733,13 @@
case SDLK_SLASH:
case SDLK_BACKSLASH:
if (KeyModifiers & ModifierAlt) {
+#if defined(USE_OPENGL) || defined(USE_GLES)
if (GLShaderPipelineSupported) {
char shadername[1024] = { '\0' };
LoadShaders(key == SDLK_SLASH ? 1 : -1, shadername);
SetMessage("%s", shadername);
}
+#endif
}
break;

View File

@ -0,0 +1,23 @@
# $NetBSD$
Don't assume that we've enabled OpenGL support.
--- ./src/video/graphic.cpp.orig 2019-07-06 12:48:14.597944334 -0700
+++ ./src/video/graphic.cpp 2019-07-06 13:01:30.326334963 -0700
@@ -1648,7 +1648,8 @@
}
}
-bool CGraphic::DeleteColorCyclingTextures() {
+#if defined(USE_OPENGL) || defined(USE_GLES)
+bool DeleteColorCyclingTextures() {
if (!ColorCyclingTextures) return false;
for (int i = 0; i < NumColorCycles; i++) {
glDeleteTextures(NumTextures, ColorCyclingTextures[i]);
@@ -1658,5 +1659,6 @@
ColorCyclingTextures = NULL;
return true;
}
+#endif
//@}

View File

@ -0,0 +1,21 @@
# $NetBSD$
Don't assume that we've enabled OpenGL support.
--- ./src/video/sdl.cpp.orig 2019-07-06 13:08:50.493609592 -0700
+++ ./src/video/sdl.cpp 2019-07-06 13:09:05.285127661 -0700
@@ -639,12 +639,14 @@
if (TheScreen == NULL) {
fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
Video.Width, Video.Height, Video.Depth, SDL_GetError());
+#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
fprintf(stderr, "Re-trying video without OpenGL\n");
UseOpenGL = false;
InitVideoSdl();
return;
}
+#endif
if (Video.FullScreen) {
fprintf(stderr, "Re-trying video without fullscreen mode\n");
Video.FullScreen = false;

View File

@ -0,0 +1,20 @@
# $NetBSD$
Don't assume that we've enabled OpenGL support.
--- ./src/video/video.cpp.orig 2019-07-06 13:04:36.686202361 -0700
+++ ./src/video/video.cpp 2019-07-06 13:04:46.356626653 -0700
@@ -394,11 +394,13 @@
void SetColorCycleAll(bool value)
{
+#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
// FIXME: In OpenGL-mode, we can only cycle the tileset graphic
return;
}
CColorCycling::GetInstance().ColorCycleAll = value;
+#endif
}
/**