ivan: 054 -> 055

This commit is contained in:
Free Potion 2018-12-21 23:02:12 +03:00
parent 814319f1ae
commit 2b0699b2c4
No known key found for this signature in database
GPG Key ID: 58ADCBD3FB64C1BB
2 changed files with 3 additions and 39 deletions

View File

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