1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 16:11:58 +00:00
nixpkgs/pkgs/games/ivan/new.patch
2018-10-06 16:59:26 +02:00

34 lines
1 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13e143e..a6f9176 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,10 +13,14 @@ set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
add_definitions(-DIVAN_VERSION="${PROJECT_VERSION}" -DUSE_SDL)
option(BUILD_MAC_APP "Build standalone application for MacOS" OFF)
+option(FORCE_HOME_AS_STATE_DIR "Statedir will be /.ivan/ in current user's homedir" OFF)
if(UNIX)
add_definitions(-DUNIX)
include(GNUInstallDirs)
+ if(FORCE_HOME_AS_STATE_DIR)
+ add_definitions(-DFORCE_HOME_AS_STATE_DIR)
+ endif(FORCE_HOME_AS_STATE_DIR)
if(BUILD_MAC_APP)
install(DIRECTORY Graphics Script Music Sound DESTINATION "ivan")
diff --git a/Main/Source/game.cpp b/Main/Source/game.cpp
index 323a185..012feb3 100644
--- a/Main/Source/game.cpp
+++ b/Main/Source/game.cpp
@@ -5191,6 +5191,9 @@ festring game::GetDataDir()
festring game::GetStateDir()
{
+#ifdef FORCE_HOME_AS_STATE_DIR
+ return GetHomeDir()+"/.ivan/";
+#endif
#ifdef UNIX
#ifdef MAC_APP
return GetHomeDir();