Merge pull request #52642 from freepotion/ivan-054-to-055

ivan: 054 -> 055
This commit is contained in:
Jörg Thalheim 2018-12-22 07:04:08 +01:00 committed by GitHub
commit c485a491db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 39 deletions

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec {
name = "ivan-${version}";
version = "054";
version = "055";
src = fetchFromGitHub {
owner = "Attnam";
repo = "ivan";
rev = "v${version}";
sha256 = "0ayhp9qvxsi5dsgjvy43i3lpdis883g1xn2b8l5xkwxcqfnvsfmq";
sha256 = "10qrwzwfzqs7f663x1cbbhisz60axcl51glxq33zaxl0jwnmma2p";
};
nativeBuildInputs = [ cmake pkgconfig ];
@ -18,11 +18,8 @@ stdenv.mkDerivation rec {
hardeningDisable = ["all"];
# To store bone and high score files in ~/.ivan of the current user
patches = [./new.patch];
# Enable wizard mode
cmakeFlags = ["-DCMAKE_CXX_FLAGS=-DWIZARD" "-DFORCE_HOME_AS_STATE_DIR=ON"];
cmakeFlags = ["-DCMAKE_CXX_FLAGS=-DWIZARD"];
# Help CMake find SDL_mixer.h
NIX_CFLAGS_COMPILE = "-I${SDL2_mixer}/include/SDL2";

View File

@ -1,33 +0,0 @@
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();