summaryrefslogtreecommitdiff
path: root/games-util/dfhack/files/dfhack-0.42.04_alpha2/05-compile-time-configurable-0.patch
diff options
context:
space:
mode:
Diffstat (limited to 'games-util/dfhack/files/dfhack-0.42.04_alpha2/05-compile-time-configurable-0.patch')
-rw-r--r--games-util/dfhack/files/dfhack-0.42.04_alpha2/05-compile-time-configurable-0.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/games-util/dfhack/files/dfhack-0.42.04_alpha2/05-compile-time-configurable-0.patch b/games-util/dfhack/files/dfhack-0.42.04_alpha2/05-compile-time-configurable-0.patch
new file mode 100644
index 00000000..d43137ff
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.42.04_alpha2/05-compile-time-configurable-0.patch
@@ -0,0 +1,38 @@
+compile-time configurable paths
+
+From: eroen <eroen@occam.eroen.eu>
+
+hack/
+./
+---
+ library/Core.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 39ec9b3..ecf8dde 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -375,7 +375,11 @@ static command_result runRubyScript(color_ostream &out, PluginManager *plug_mgr,
+ rbcmd += "'" + args[i] + "', ";
+ rbcmd += "]\n";
+
++#ifdef DFHACK_DATA_DESTINATION
++ rbcmd += "catch(:script_finished) { load '" DFHACK_DATA_DESTINATION "/scripts/" + name + ".rb' }";
++#else
+ rbcmd += "catch(:script_finished) { load './hack/scripts/" + name + ".rb' }";
++#endif
+
+ return plug_mgr->ruby->eval_ruby(out, rbcmd.c_str());
+ }
+@@ -1388,7 +1392,11 @@ void Core::fatal (std::string output)
+ std::string Core::getHackPath()
+ {
+ #ifdef LINUX_BUILD
++ #ifdef DFHACK_DATA_DESTINATION
++ return DFHACK_DATA_DESTINATION "/";
++ #else
+ return p->getPath() + "/hack/";
++ #endif
+ #else
+ return p->getPath() + "\\hack\\";
+ #endif