diff options
author | wiz <wiz@pkgsrc.org> | 2016-09-02 16:46:04 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2016-09-02 16:46:04 +0000 |
commit | ffb52e6062b000d042c1655348daf0d93e5275a3 (patch) | |
tree | 46ab6ce010bf640b5c7985da9df1ef8d6b3c3d49 /games | |
parent | aaf8e3ff961b487261c2f96d6793278081081cf9 (diff) | |
download | pkgsrc-ffb52e6062b000d042c1655348daf0d93e5275a3.tar.gz |
Import arx-libertatis-1.1.2 as games/arx-libertatis.
Packaged for wip by Yorick Hardy and Jonathan Schleifer.
Arx Libertatis is a cross-platform, open source port of Arx Fatalis,
a 2002 first-person role-playing game developed by Arkane Studios.
This is the game engine - the data files are not included.
Diffstat (limited to 'games')
-rw-r--r-- | games/arx-libertatis/DESCR | 4 | ||||
-rw-r--r-- | games/arx-libertatis/Makefile | 34 | ||||
-rw-r--r-- | games/arx-libertatis/PLIST | 10 | ||||
-rw-r--r-- | games/arx-libertatis/distinfo | 13 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-CMakeLists.txt | 75 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-cmake_CompileCheck.cmake | 16 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-cmake_VersionString.cmake | 56 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-src_graphics_opengl_OpenGLRenderer.cpp | 15 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-src_io_fs_FilesystemPOSIX.cpp | 15 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-src_platform_Thread.cpp | 18 | ||||
-rw-r--r-- | games/arx-libertatis/patches/patch-src_script_Script.cpp | 30 |
11 files changed, 286 insertions, 0 deletions
diff --git a/games/arx-libertatis/DESCR b/games/arx-libertatis/DESCR new file mode 100644 index 00000000000..f0718241afc --- /dev/null +++ b/games/arx-libertatis/DESCR @@ -0,0 +1,4 @@ +Arx Libertatis is a cross-platform, open source port of Arx Fatalis, +a 2002 first-person role-playing game developed by Arkane Studios. + +This is the game engine - the data files are not included. diff --git a/games/arx-libertatis/Makefile b/games/arx-libertatis/Makefile new file mode 100644 index 00000000000..27f5793c88c --- /dev/null +++ b/games/arx-libertatis/Makefile @@ -0,0 +1,34 @@ +# $NetBSD: Makefile,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +DISTNAME= arx-libertatis-1.1.2 +CATEGORIES= games +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=project/arx/arx-libertatis-1.1.2/} +EXTRACT_SUFX= .tar.xz + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://arx-libertatis.org/ +COMMENT= Cross-platform, open source port of the Arx Fatalis RPG +LICENSE= gnu-gpl-v3 + +USE_CMAKE= yes +USE_LANGUAGES= c c++ + +CMAKE_ARGS+= -D CMAKE_INSTALL_MANDIR:STRING:=${PKGMANDIR} +CMAKE_ARGS+= -D USE_QT4:BOOL=OFF +CMAKE_ARGS+= -D USE_QT5:BOOL=OFF + +.include "../../mk/bsd.prefs.mk" + +PLIST_VARS+= NotDarwin + +.if ${OPSYS} != "Darwin" +PLIST.NotDarwin= yes +.endif + +.include "../../audio/openal-soft/buildlink3.mk" +.include "../../devel/boost-headers/buildlink3.mk" +.include "../../devel/SDL/buildlink3.mk" +.include "../../graphics/freetype2/buildlink3.mk" +.include "../../graphics/glew/buildlink3.mk" +.include "../../sysutils/desktop-file-utils/desktopdb.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/games/arx-libertatis/PLIST b/games/arx-libertatis/PLIST new file mode 100644 index 00000000000..6035bad6ea8 --- /dev/null +++ b/games/arx-libertatis/PLIST @@ -0,0 +1,10 @@ +@comment $NetBSD: PLIST,v 1.1 2016/09/02 16:46:04 wiz Exp $ +bin/arx +bin/arx-install-data +bin/arxsavetool +bin/arxunpak +man/man1/arxsavetool.1 +man/man1/arxunpak.1 +man/man6/arx.6 +${PLIST.NotDarwin}share/applications/arx-libertatis.desktop +${PLIST.NotDarwin}share/pixmaps/arx-libertatis.png diff --git a/games/arx-libertatis/distinfo b/games/arx-libertatis/distinfo new file mode 100644 index 00000000000..303de4ef55d --- /dev/null +++ b/games/arx-libertatis/distinfo @@ -0,0 +1,13 @@ +$NetBSD: distinfo,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +SHA1 (arx-libertatis-1.1.2.tar.xz) = 3b14a55553c564fd33caafb3a5bdb2d328e1fde8 +RMD160 (arx-libertatis-1.1.2.tar.xz) = 94145d36664d8d747c0abc3ced9c9055fd642690 +SHA512 (arx-libertatis-1.1.2.tar.xz) = d4cb8187e7f63934408e38a51a44b7da03c8628820d43139507ff97ebd463b9cd7baf6cc4e85a3d4191d6e5f56850d77d07cfffc33d8f5a51378dfb41f719fb8 +Size (arx-libertatis-1.1.2.tar.xz) = 970608 bytes +SHA1 (patch-CMakeLists.txt) = 37a9c12a831ed6127a9c0a2e28bec2c3d7b6075d +SHA1 (patch-cmake_CompileCheck.cmake) = b954b0115666741ffbd5686e997d24bae72a3196 +SHA1 (patch-cmake_VersionString.cmake) = afff2ae36425f3ffe0e1679d28e48ff4b6fc3d6f +SHA1 (patch-src_graphics_opengl_OpenGLRenderer.cpp) = 410769fea6b911dcb283b1da85bebd2861de8d94 +SHA1 (patch-src_io_fs_FilesystemPOSIX.cpp) = 96f1938038c667997350f51a2bb201de0c9843e3 +SHA1 (patch-src_platform_Thread.cpp) = 38e31c77c9e6e795cb37842da82b5ed6681f6aea +SHA1 (patch-src_script_Script.cpp) = 29a923b5254077e2dc2cd73f69afb89025ef7012 diff --git a/games/arx-libertatis/patches/patch-CMakeLists.txt b/games/arx-libertatis/patches/patch-CMakeLists.txt new file mode 100644 index 00000000000..039953b030c --- /dev/null +++ b/games/arx-libertatis/patches/patch-CMakeLists.txt @@ -0,0 +1,75 @@ +$NetBSD: patch-CMakeLists.txt,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Fix use of CMAKE_MODULE_PATH (see also patch-cmake_VersionString.cmake) + +Resolve "Attempt at a recursive or nested TRY_COMPILE in directory" +(see also patch-cmake_CompileCheck.cmake) + +and + +commit 60e43c3cbf3fb0aa10cc3092b2512ccebb60b80d +Author: Daniel Scharrer <daniel@constexpr.org> +Date: Tue Feb 23 07:04:11 2016 +0100 + + CMake: Bump policy version to 3.4 + + Amongst other things, this makes the build system more rubust against + stray variables coming from included CMake scripts provided by the + system by disabling variable expansion for quoted strings in if(). + + Fixes build with CMake 3.5 (tested with 3.5.0-rc3). + + +--- CMakeLists.txt.orig 2013-10-17 17:25:04.000000000 +0000 ++++ CMakeLists.txt +@@ -13,6 +13,11 @@ else() + cmake_minimum_required(VERSION 2.8) + endif() + ++if(CMAKE_VERSION VERSION_GREATER 3.4) ++ cmake_policy(VERSION 3.4) ++else() ++ cmake_policy(VERSION ${CMAKE_VERSION}) ++endif() + + # Define configuration options + +@@ -174,10 +179,12 @@ mark_as_advanced( + # Helper scrips + + include(CheckCXXSourceCompiles) ++include(CheckIncludeFiles) + include(CheckSymbolExists) + include(CheckTypeSize) + +-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # For custom cmake modules ++set(CMAKE_CUSTOM_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # For custom cmake modules ++list(APPEND CMAKE_MODULE_PATH ${CMAKE_CUSTOM_MODULE_PATH}) # For custom cmake modules + include(BuildSystem) + include(BuildType) + include(CompileCheck) +@@ -406,15 +413,15 @@ if(NOT MSVC) + endif() + + # Not a symbol, so we can't use check_symbol_exists +- check_compile(ARX_HAVE_BUILTIN_TRAP +- "${CMAKE_MODULE_PATH}/check_compiler_builtin_trap.cpp" +- "__builtin_trap" "compiler feature" +- ) +- +- check_compile(ARX_HAVE_ATTRIBUTE_FORMAT_PRINTF +- "${CMAKE_MODULE_PATH}/check_compiler_attribute_format_printf.cpp" +- "__attribute__((format(printf, i, j)))" "compiler feature" +- ) ++ #check_compile(ARX_HAVE_BUILTIN_TRAP ++ # "${CMAKE_MODULE_PATH}/check_compiler_builtin_trap.cpp" ++ # "__builtin_trap" "compiler feature" ++ #) ++ ++ #check_compile(ARX_HAVE_ATTRIBUTE_FORMAT_PRINTF ++ # "${CMAKE_MODULE_PATH}/check_compiler_attribute_format_printf.cpp" ++ # "__attribute__((format(printf, i, j)))" "compiler feature" ++ #) + + check_symbol_exists(nanosleep "time.h" ARX_HAVE_NANOSLEEP) + diff --git a/games/arx-libertatis/patches/patch-cmake_CompileCheck.cmake b/games/arx-libertatis/patches/patch-cmake_CompileCheck.cmake new file mode 100644 index 00000000000..1190174d915 --- /dev/null +++ b/games/arx-libertatis/patches/patch-cmake_CompileCheck.cmake @@ -0,0 +1,16 @@ +$NetBSD: patch-cmake_CompileCheck.cmake,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Resolve "Attempt at a recursive or nested TRY_COMPILE in directory" +(see also patch-CMakeLists.txt) + +--- cmake/CompileCheck.cmake.orig 2013-07-15 20:31:38.000000000 +0200 ++++ cmake/CompileCheck.cmake 2013-07-15 20:32:36.000000000 +0200 +@@ -52,7 +52,7 @@ + + # Check if we can compile and link a simple file with the new flags + try_compile( +- check_compiler_flag ${CMAKE_BINARY_DIR} ${FILE} ++ check_compiler_flag ${CMAKE_BINARY_DIR}/CMakeTmp ${FILE} + CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" + "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" + "-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}" diff --git a/games/arx-libertatis/patches/patch-cmake_VersionString.cmake b/games/arx-libertatis/patches/patch-cmake_VersionString.cmake new file mode 100644 index 00000000000..0cc1cb19622 --- /dev/null +++ b/games/arx-libertatis/patches/patch-cmake_VersionString.cmake @@ -0,0 +1,56 @@ +$NetBSD: patch-cmake_VersionString.cmake,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Fix use of CMAKE_MODULE_PATH (see also patch-CMakeLists.txt) + +and + +commit afca1491d7114066c016149b421bae4c797663a2 +Author: Daniel Scharrer <daniel@constexpr.org> +Date: Tue Feb 23 07:08:48 2016 +0100 + + VersionString.cmake: Guard against defined variables + + Previously this would fail under CMake older than 3.1 if "file" or + "variable" were variables. + + For CMake 3.1+ this was fixed in commit 60e43c. + +--- cmake/VersionString.cmake.orig 2013-10-17 17:25:04.000000000 +0000 ++++ cmake/VersionString.cmake +@@ -26,19 +26,22 @@ + # The version file is regenerated whenever VERSION_FILE or the current commit changes. + function(version_file SRC DST VERSION_SOURCES GIT_DIR) + +- set(mode "variable") ++ set(MODE_VARIABLE 0) ++ set(MODE_FILE 1) ++ ++ set(mode ${MODE_VARIABLE}) + + set(args) +- set(dependencies "${CMAKE_MODULE_PATH}/VersionScript.cmake") ++ set(dependencies "${CMAKE_CUSTOM_MODULE_PATH}/VersionScript.cmake") + + foreach(arg IN LISTS VERSION_SOURCES) + +- if(mode STREQUAL "variable") +- set(mode "file") ++ if(mode EQUAL MODE_VARIABLE) ++ set(mode ${MODE_FILE}) + else() + get_filename_component(arg "${arg}" ABSOLUTE) + list(APPEND dependencies ${arg}) +- set(mode "variable") ++ set(mode ${MODE_VARIABLE}) + endif() + + list(APPEND args ${arg}) +@@ -72,7 +75,7 @@ function(version_file SRC DST VERSION_SO + "-DVERSION_SOURCES=${args}" + "-DGIT_DIR=${abs_git_dir}" + ${defines} +- -P "${CMAKE_MODULE_PATH}/VersionScript.cmake" ++ -P "${CMAKE_CUSTOM_MODULE_PATH}/VersionScript.cmake" + MAIN_DEPENDENCY + "${abs_src}" + DEPENDS diff --git a/games/arx-libertatis/patches/patch-src_graphics_opengl_OpenGLRenderer.cpp b/games/arx-libertatis/patches/patch-src_graphics_opengl_OpenGLRenderer.cpp new file mode 100644 index 00000000000..e582fa2d603 --- /dev/null +++ b/games/arx-libertatis/patches/patch-src_graphics_opengl_OpenGLRenderer.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_graphics_opengl_OpenGLRenderer.cpp,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Turn off VBO if not available. This may help with performance issues. + +--- ./src/graphics/opengl/OpenGLRenderer.cpp.orig 2012-06-08 21:12:01.000000000 +0200 ++++ ./src/graphics/opengl/OpenGLRenderer.cpp 2012-06-08 21:13:12.000000000 +0200 +@@ -148,6 +148,8 @@ + useVBOs = useVertexArrays; + if(useVBOs && !GLEW_ARB_map_buffer_range) { + LogWarning << "Missing OpenGL extension ARB_map_buffer_range, VBO performance will suffer."; ++ LogWarning << "Turning VBO off."; ++ useVBOs = false; + } + + glEnable(GL_POLYGON_OFFSET_FILL); diff --git a/games/arx-libertatis/patches/patch-src_io_fs_FilesystemPOSIX.cpp b/games/arx-libertatis/patches/patch-src_io_fs_FilesystemPOSIX.cpp new file mode 100644 index 00000000000..8bfbf0986f6 --- /dev/null +++ b/games/arx-libertatis/patches/patch-src_io_fs_FilesystemPOSIX.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_io_fs_FilesystemPOSIX.cpp,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Wrong errno.h include + +--- src/io/fs/FilesystemPOSIX.cpp.orig 2013-07-15 20:56:44.000000000 +0200 ++++ src/io/fs/FilesystemPOSIX.cpp 2013-07-15 20:57:15.000000000 +0200 +@@ -27,7 +27,7 @@ + #include <cstdlib> + + #include <sys/stat.h> +-#include <sys/errno.h> ++#include <errno.h> + #include <dirent.h> + #include <unistd.h> + diff --git a/games/arx-libertatis/patches/patch-src_platform_Thread.cpp b/games/arx-libertatis/patches/patch-src_platform_Thread.cpp new file mode 100644 index 00000000000..cea36b18235 --- /dev/null +++ b/games/arx-libertatis/patches/patch-src_platform_Thread.cpp @@ -0,0 +1,18 @@ +$NetBSD: patch-src_platform_Thread.cpp,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Fix pthread_setname_np on NetBSD + +--- src/platform/Thread.cpp.orig 2012-08-16 18:07:06.000000000 +0200 ++++ src/platform/Thread.cpp 2012-08-16 18:19:04.000000000 +0200 +@@ -96,7 +96,11 @@ + // Set the thread name. + #if defined(ARX_HAVE_PTHREAD_SETNAME_NP) && ARX_PLATFORM != ARX_PLATFORM_MACOSX + // Linux ++# ifdef __NetBSD__ ++ pthread_setname_np(thread.thread, "%s", (void*)thread.threadName.c_str()); ++# else + pthread_setname_np(thread.thread, thread.threadName.c_str()); ++# endif + #elif defined(ARX_HAVE_PTHREAD_SETNAME_NP) && ARX_PLATFORM == ARX_PLATFORM_MACOSX + // Mac OS X + pthread_setname_np(thread.threadName.c_str()); diff --git a/games/arx-libertatis/patches/patch-src_script_Script.cpp b/games/arx-libertatis/patches/patch-src_script_Script.cpp new file mode 100644 index 00000000000..4cdca6e23f2 --- /dev/null +++ b/games/arx-libertatis/patches/patch-src_script_Script.cpp @@ -0,0 +1,30 @@ +$NetBSD: patch-src_script_Script.cpp,v 1.1 2016/09/02 16:46:04 wiz Exp $ + +Something goes wrong with tolower and characters with value 0xA7, +so only apply to characters in the range A-Z. + +--- src/script/Script.cpp.orig 2013-07-15 19:56:03.000000000 +0200 ++++ src/script/Script.cpp 2013-07-15 19:57:38.000000000 +0200 +@@ -103,6 +103,13 @@ + SCR_TIMER * scr_timer = NULL; + long ActiveTimers = 0; + ++static int ScriptToLower(int c) { ++ if(c >= 'A' && c <= 'Z') { ++ return tolower(c); ++ } ++ return c; ++} ++ + long FindScriptPos(const EERIE_SCRIPT * es, const string & str) { + + // TODO(script-parser) remove, respect quoted strings +@@ -2150,7 +2157,7 @@ + script.data = file->readAlloc(); + script.size = file->size(); + +- std::transform(script.data, script.data + script.size, script.data, ::tolower); ++ std::transform(script.data, script.data + script.size, script.data, ::ScriptToLower); + + script.allowevents = 0; + |