pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

serious-engine-tfe-git: Import serious-engine (git snapshot) as serious-engine-tfe-git



Module Name:	pkgsrc-wip
Committed By:	Yorick Hardy <yorickhardy%gmail.com@localhost>
Pushed By:	yhardy
Date:		Sun Sep 27 11:30:18 2020 +0200
Changeset:	3999bd9ff7735dba14855993bfc2df5880d186d0

Modified Files:
	Makefile
Added Files:
	serious-engine-tfe-git/DESCR
	serious-engine-tfe-git/Makefile
	serious-engine-tfe-git/Makefile.common
	serious-engine-tfe-git/PLIST
	serious-engine-tfe-git/distinfo
	serious-engine-tfe-git/patches/patch-CMakeLists.txt
	serious-engine-tfe-git/patches/patch-Ecc_StdH.h
	serious-engine-tfe-git/patches/patch-Engine_Base_Unix_UnixDynamicLoader.cpp
	serious-engine-tfe-git/patches/patch-Engine_Engine.cpp

Log Message:
serious-engine-tfe-git: Import serious-engine (git snapshot) as serious-engine-tfe-git

The serious engine provides (by a configure time option) the engine
for Serious Sam 1 or for Serious Sam 2.

Description:

An open source version of a game engine developed by Croteam for
the classic Serious Sam games.  This package provides the engine
for "Serious Sam 1" also known as "The First Encounter".

The game data files are not included. The game data and
share/ssam-tfe/SE1_10.gro should be stored in

 ~/.local/share/Serious Engine/serioussamfe

adjusted as necessary if $XDG_DATA_HOME is set.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3999bd9ff7735dba14855993bfc2df5880d186d0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |   1 +
 serious-engine-tfe-git/DESCR                       |  10 ++
 serious-engine-tfe-git/Makefile                    |   8 ++
 serious-engine-tfe-git/Makefile.common             |  29 ++++
 serious-engine-tfe-git/PLIST                       |   6 +
 serious-engine-tfe-git/distinfo                    |   6 +
 .../patches/patch-CMakeLists.txt                   | 159 +++++++++++++++++++++
 serious-engine-tfe-git/patches/patch-Ecc_StdH.h    |  34 +++++
 .../patch-Engine_Base_Unix_UnixDynamicLoader.cpp   |  32 +++++
 .../patches/patch-Engine_Engine.cpp                |  20 +++
 10 files changed, 305 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 335c754196..50d100cdcf 100644
--- a/Makefile
+++ b/Makefile
@@ -4474,6 +4474,7 @@ SUBDIR+=	sendmailX
 SUBDIR+=	sent
 SUBDIR+=	seqtk
 SUBDIR+=	serendipity
+SUBDIR+=	serious-engine-tfe-git
 SUBDIR+=	service
 SUBDIR+=	seturgent
 SUBDIR+=	sfeed-git
diff --git a/serious-engine-tfe-git/DESCR b/serious-engine-tfe-git/DESCR
new file mode 100644
index 0000000000..64b822689b
--- /dev/null
+++ b/serious-engine-tfe-git/DESCR
@@ -0,0 +1,10 @@
+An open source version of a game engine developed by Croteam for
+the classic Serious Sam games.  This package provides the engine
+for "Serious Sam 1" also known as "The First Encounter".
+
+The game data files are not included. The game data and
+share/ssam-tfe/SE1_10.gro should be stored in
+
+ ~/.local/share/Serious Engine/serioussamfe
+
+adjusted as necessary if $XDG_DATA_HOME is set.
diff --git a/serious-engine-tfe-git/Makefile b/serious-engine-tfe-git/Makefile
new file mode 100644
index 0000000000..41c6c51fe3
--- /dev/null
+++ b/serious-engine-tfe-git/Makefile
@@ -0,0 +1,8 @@
+# $NetBSD$
+
+PKGNAME=	serious-engine-tfe-0.0
+
+CMAKE_ARGS+=	-DTFE:BOOL=TRUE
+LDFLAGS+=	${COMPILER_RPATH_FLAG}${PREFIX}/lib/ssam-tfe
+
+.include "../../wip/serious-engine-tfe-git/Makefile.common"
diff --git a/serious-engine-tfe-git/Makefile.common b/serious-engine-tfe-git/Makefile.common
new file mode 100644
index 0000000000..6dba3227c2
--- /dev/null
+++ b/serious-engine-tfe-git/Makefile.common
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+# used by wip/serious-engine-tfe-git/Makefile
+# used by wip/serious-engine-tse-git/Makefile
+
+DISTNAME=	serious-engine-0.0
+CATEGORIES=	games
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+#HOMEPAGE=	https://github.com/rcgordon/Serious-Engine
+HOMEPAGE=	https://github.com/ptitSeb/Serious-Engine
+COMMENT=	Open source version of a game engine for the Serious Sam games
+LICENSE=	gnu-gpl-v2
+
+GIT_REPOSITORIES=	serious
+GIT_REPO.serious=	git://github.com/ptitSeb/Serious-Engine
+WRKSRC=			${WRKDIR}/serious/Sources
+
+USE_LANGUAGES=	c c++
+USE_CMAKE=	yes
+USE_TOOLS+=	pkg-config
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE:STRING=Release
+CMAKE_ARGS+=	-DCMAKE_INCLUDE_CURRENT_DIR:BOOL=TRUE
+
+.include "../../audio/libvorbis/buildlink3.mk"
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../multimedia/libogg/buildlink3.mk"
+.include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/serious-engine-tfe-git/PLIST b/serious-engine-tfe-git/PLIST
new file mode 100644
index 0000000000..7841a08839
--- /dev/null
+++ b/serious-engine-tfe-git/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD$
+bin/ssam-tfe
+lib/ssam-tfe/libEntities.so
+lib/ssam-tfe/libGame.so
+lib/ssam-tfe/libShaders.so
+share/ssam-tfe/SE1_10.gro
diff --git a/serious-engine-tfe-git/distinfo b/serious-engine-tfe-git/distinfo
new file mode 100644
index 0000000000..ad46135854
--- /dev/null
+++ b/serious-engine-tfe-git/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+SHA1 (patch-CMakeLists.txt) = 8118cf60d01846bf0772e9e7a89a7f5e5b8035a5
+SHA1 (patch-Ecc_StdH.h) = e8c1bc298362db1781b5d15aeebcc10201ab8600
+SHA1 (patch-Engine_Base_Unix_UnixDynamicLoader.cpp) = 2e139fae083e0dc5f6f5af355e8bd907cabc2d94
+SHA1 (patch-Engine_Engine.cpp) = 482b4af4d14aeade6c49703dc3578b730969280c
diff --git a/serious-engine-tfe-git/patches/patch-CMakeLists.txt b/serious-engine-tfe-git/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..7358fc5fdd
--- /dev/null
+++ b/serious-engine-tfe-git/patches/patch-CMakeLists.txt
@@ -0,0 +1,159 @@
+$NetBSD$
+
+1) Use the system ogg/vorbis libraries.
+2) Also support NetBSD and OpenBSD.
+3) Name the executables according to "the first encounter" or "the second encounter"
+4) Install the files in more reasonable places.
+
+--- CMakeLists.txt.orig	2020-09-04 12:08:26.000000000 +0000
++++ CMakeLists.txt
+@@ -60,6 +60,31 @@ if(USE_SYSTEM_ZLIB)
+     endif()
+ endif()
+ 
++find_package(PkgConfig REQUIRED)
++
++if(PKG_CONFIG_FOUND)
++    pkg_check_modules(OGG REQUIRED ogg)
++    if(OGG_FOUND)
++     include_directories(${OGG_INCLUDE_DIRS})
++    else()
++     message(FATAL_ERROR "Error! libogg not found")
++    endif()
++    pkg_check_modules(VORBIS REQUIRED vorbis)
++    if(VORBIS_FOUND)
++     include_directories(${VORBIS_INCLUDE_DIRS})
++    else()
++     message(FATAL_ERROR "Error! libvorbis not found")
++    endif()
++    pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
++    if(VORBISFILE_FOUND)
++     include_directories(${VORBISFILE_INCLUDE_DIRS})
++    else()
++     message(FATAL_ERROR "Error! libvorbisfile not found")
++    endif()
++else()
++    message(FATAL_ERROR "Error! pkg-config not found")
++endif()
++
+ # RAKE! Where to install the binaries.
+ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" OR CMAKE_INSTALL_PREFIX STREQUAL "") # Only works for linux since I don't
+                                                                                    # know what default is for windows/macos/freebsd.
+@@ -75,6 +100,12 @@ endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+     SET(FREEBSD TRUE)
+ endif()
++if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
++    SET(NETBSD TRUE)
++endif()
++if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
++    SET(OPENBSD TRUE)
++endif()
+ if(APPLE)
+     SET(MACOSX TRUE)
+ endif()
+@@ -180,7 +211,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_CO
+     		add_definitions(-D_FILE_OFFSET_BITS=64)
+     		add_definitions(-D_LARGEFILE_SOURCE=1)
+     		add_definitions(-DPRAGMA_ONCE=1)
+-	elseif(FREEBSD)
++	elseif(FREEBSD OR NETBSD OR OPENBSD)
+     		set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE)
+     		add_definitions(-DPLATFORM_UNIX=1)
+     		add_definitions(-DPLATFORM_FREEBSD=1)
+@@ -190,7 +221,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_CO
+     		include_directories("/usr/local/include")
+ 	endif()
+ 	
+-        if(MACOSX OR LINUX OR FREEBSD)
++        if(MACOSX OR LINUX OR FREEBSD OR NETBSD OR OPENBSD)
+ 		add_compile_options(-pthread)
+                 add_compile_options(-fsigned-char)
+ 	endif()
+@@ -272,8 +303,10 @@ option(TFE "Compile a The First Encounte
+ if (TFE)
+  add_definitions(-DFIRST_ENCOUNTER=1)
+  set(MP "")
++ set(ENCOUNTER "tfe")
+ else()
+  set(MP "MP")
++ set(ENCOUNTER "tse")
+ endif()
+ 
+ 
+@@ -286,7 +319,7 @@ endif()
+ 
+ include_directories(
+     .
+-    ${CMAKE_SOURCE_DIR}/External/libogg/include
++#    ${CMAKE_SOURCE_DIR}/External/libogg/include
+ )
+ if(USE_TREMOR)
+ if(PANDORA)
+@@ -294,8 +327,8 @@ if(PANDORA)
+ else()
+     # !!!Do something here!
+ endif()
+-else()
+-    include_directories(External/libvorbis/include)
++#else()
++#    include_directories(External/libvorbis/include)
+ endif()
+ 
+ # We build ECC, then use it to generate C++ code for the game entities...
+@@ -1001,6 +1034,9 @@ if(LINUX)
+     target_link_libraries(ssam "m")
+     target_link_libraries(ssam "dl")
+     target_link_libraries(ssam "pthread")
++    target_link_libraries(ssam ${OGG_LIBRARIES})
++    target_link_libraries(ssam ${VORBIS_LIBRARIES})
++    target_link_libraries(ssam ${VORBISFILE_LIBRARIES})
+     target_link_libraries(ssam ${SDL2_LIBRARY})
+     target_link_libraries(ssam ${ZLIB_LIBRARIES})
+     if(PANDORA)
+@@ -1016,10 +1052,13 @@ if(LINUX)
+     endif()
+ endif()
+ 
+-if(FREEBSD)
++if(FREEBSD OR NETBSD OR OPENBSD)
+     set_target_properties(ssam PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN")
+     target_link_libraries(ssam "m")
+     target_link_libraries(ssam "pthread")
++    target_link_libraries(ssam ${OGG_LIBRARIES})
++    target_link_libraries(ssam ${VORBIS_LIBRARIES})
++    target_link_libraries(ssam ${VORBISFILE_LIBRARIES})
+     target_link_libraries(ssam ${SDL2_LIBRARY})
+     target_link_libraries(ssam ${ZLIB_LIBRARIES})
+     if(BUILD_DEDICATED_SERVER)
+@@ -1031,9 +1070,7 @@ if(FREEBSD)
+     endif()
+ endif()
+ 
+-if(TFE)
+- set_target_properties(ssam PROPERTIES OUTPUT_NAME "ssam-tfe")
+-endif()
++set_target_properties(ssam PROPERTIES OUTPUT_NAME "ssam-${ENCOUNTER}")
+ 
+ # RAKE! Install Section.
+ if(DEBUG) # RAKE! Will this work with TFE?
+@@ -1048,8 +1085,8 @@ if(DEBUG) # RAKE! Will this work with TF
+     endif()
+ else()
+     install(TARGETS ssam ${SHADERSLIB} ${GAMEMPLIB} ${ENTITIESMPLIB}
+-            RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/Bin"
+-            LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/Bin"
++            RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
++            LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/ssam-${ENCOUNTER}"
+             PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+     if(BUILD_DEDICATED_SERVER)
+         install(TARGETS SeriousSamDedicated
+@@ -1062,7 +1099,7 @@ endif()
+ # and SE1_10.gro needs to be installed to Games root dir.
+ if(NOT LOCAL_INSTALL)
+     install(FILES ${CMAKE_SOURCE_DIR}/../SE1_10.gro
+-            DESTINATION ${CMAKE_INSTALL_PREFIX}
++            DESTINATION "${CMAKE_INSTALL_PREFIX}/share/ssam-${ENCOUNTER}"
+             PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ endif()
+ 
diff --git a/serious-engine-tfe-git/patches/patch-Ecc_StdH.h b/serious-engine-tfe-git/patches/patch-Ecc_StdH.h
new file mode 100644
index 0000000000..04973f0664
--- /dev/null
+++ b/serious-engine-tfe-git/patches/patch-Ecc_StdH.h
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Use the appropriate C++ header files.
+
+--- Ecc/StdH.h.orig	2020-08-26 21:54:20.806586674 +0000
++++ Ecc/StdH.h
+@@ -14,19 +14,19 @@ with this program; if not, write to the 
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
+ 
+ #include <ctype.h>
+-#include <assert.h>
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <stdarg.h>
+-#include <math.h>
++#include <cassert>
++#include <cstdio>
++#include <cstdlib>
++#include <cstring>
++#include <cstdarg>
++#include <cmath>
+ 
+ #ifdef PLATFORM_WIN32
+-#include <malloc.h>
++#include <cmalloc>
+ #endif
+ 
+ #ifdef PLATFORM_UNIX
+-#include <errno.h>
++#include <cerrno>
+ #include <sys/param.h>
+ #include <unistd.h>
+ #define _fullpath(x, y, z) realpath(y, x)
diff --git a/serious-engine-tfe-git/patches/patch-Engine_Base_Unix_UnixDynamicLoader.cpp b/serious-engine-tfe-git/patches/patch-Engine_Base_Unix_UnixDynamicLoader.cpp
new file mode 100644
index 0000000000..1c081365c5
--- /dev/null
+++ b/serious-engine-tfe-git/patches/patch-Engine_Base_Unix_UnixDynamicLoader.cpp
@@ -0,0 +1,32 @@
+$NetBSD$
+
+Don't override the search paths for libraries, the rpath is correct.
+
+--- Engine/Base/Unix/UnixDynamicLoader.cpp.orig	2020-09-26 18:29:18.000000000 +0000
++++ Engine/Base/Unix/UnixDynamicLoader.cpp
+@@ -78,7 +78,8 @@ CTFileName CDynamicLoader::ConvertLibNam
+     #endif
+     CTFileName fnm = CTString(libname);
+     CTString libstr((strncmp("lib", fnm.FileName(), 3) == 0) ? "" : "lib");
+-    return(fnm.FileDir() + libstr + fnm.FileName() + DLLEXTSTR);
++    // use the rpath to find libraries, not the path name
++    return(libstr + fnm.FileName() + DLLEXTSTR);
+ }
+ 
+ 
+@@ -91,6 +92,7 @@ CUnixDynamicLoader::CUnixDynamicLoader(c
+     } else {
+         CTFileName fnm = ConvertLibNameToPlatform(libname);
+ 
++#if 0
+         // Always try to dlopen from inside the game dirs before trying
+         //  system libraries...
+         if (fnm.FileDir() == "") {
+@@ -103,6 +105,7 @@ CUnixDynamicLoader::CUnixDynamicLoader(c
+                 return;
+             }
+         }
++#endif
+ 
+         DoOpen(fnm);
+     }
diff --git a/serious-engine-tfe-git/patches/patch-Engine_Engine.cpp b/serious-engine-tfe-git/patches/patch-Engine_Engine.cpp
new file mode 100644
index 0000000000..70b2113cd6
--- /dev/null
+++ b/serious-engine-tfe-git/patches/patch-Engine_Engine.cpp
@@ -0,0 +1,20 @@
+$NetBSD$
+
+By default, the game looks for data at $(dirname executable)/../.
+A more reasonable choice is to look for rthe data in the user
+directory (or a pkgsrc directory such as share/ssam-tfe/data),
+this seems to be easiest choice.
+
+--- Engine/Engine.cpp.orig	2020-09-04 12:08:26.000000000 +0000
++++ Engine/Engine.cpp
+@@ -564,6 +564,10 @@ ENGINE_API void SE_InitEngine(const char
+   }
+   _pConsole->Initialize(_fnmUserDir+_strLogFile+".log", 90, 512);
+ 
++  // Don't search for data in the executable path,
++  // that is what the user data directory is for.
++  _fnmApplicationPath = _fnmUserDir;
++
+   _pAnimStock        = new CStock_CAnimData;
+   _pTextureStock     = new CStock_CTextureData;
+   _pSoundStock       = new CStock_CSoundData;


Home | Main Index | Thread Index | Old Index