summaryrefslogtreecommitdiff
path: root/games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch
diff options
context:
space:
mode:
Diffstat (limited to 'games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch')
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch b/games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch
new file mode 100644
index 00000000..c48c6dfc
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch
@@ -0,0 +1,75 @@
+From 3f99b0e97c68d8126355a587b57eb3618c4157cb Mon Sep 17 00:00:00 2001
+From: eroen <eroen@occam.eroen.eu>
+Date: Tue, 7 Mar 2017 22:43:57 +0100
+Subject: [PATCH 2/5] respect DFHACK_LUA_DESTINATION
+
+---
+ CMakeLists.txt | 3 ++-
+ depends/lua/CMakeLists.txt | 5 ++++-
+ depends/lua/include/{luaconf.h => luaconf.h.in} | 2 +-
+ 3 files changed, 7 insertions(+), 3 deletions(-)
+ rename depends/lua/include/{luaconf.h => luaconf.h.in} (99%)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 01a84b92..fc5438f8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -162,7 +162,7 @@ SET(DFHACK_PLUGIN_DESTINATION hack/plugins)
+ # dfhack header files go here:
+ SET(DFHACK_INCLUDES_DESTINATION hack/include)
+ # dfhack lua files go here:
+-SET(DFHACK_LUA_DESTINATION hack/lua)
++SET(DFHACK_LUA_DESTINATION hack/lua CACHE INTERNAL "")
+ # the windows .lib file goes here:
+ SET(DFHACK_DEVLIB_DESTINATION hack)
+
+@@ -295,6 +295,7 @@ endif()
+
+ find_package(ZLIB REQUIRED)
+ include_directories(depends/protobuf)
++include_directories("${CMAKE_CURRENT_BINARY_DIR}/depends/lua/include")
+ include_directories(depends/lua/include)
+ include_directories(depends/md5)
+ include_directories(depends/jsoncpp)
+diff --git a/depends/lua/CMakeLists.txt b/depends/lua/CMakeLists.txt
+index 8b9ce8e2..ad7a209e 100644
+--- a/depends/lua/CMakeLists.txt
++++ b/depends/lua/CMakeLists.txt
+@@ -22,6 +22,10 @@ IF(UNIX)
+ ENDIF()
+ ENDIF()
+
++configure_file("include/luaconf.h.in" "include/luaconf.h" @ONLY)
++SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_BINARY_DIR}/include" PROPERTIES HEADER_FILE_ONLY TRUE)
++include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
++
+ SET (HDR_LIBLUA
+ include/lapi.h
+ include/lauxlib.h
+@@ -42,7 +46,6 @@ include/lstring.h
+ include/ltable.h
+ include/ltm.h
+ include/lua.h
+-include/luaconf.h
+ include/lualib.h
+ include/lundump.h
+ include/lvm.h
+diff --git a/depends/lua/include/luaconf.h b/depends/lua/include/luaconf.h.in
+similarity index 99%
+rename from depends/lua/include/luaconf.h
+rename to depends/lua/include/luaconf.h.in
+index ce96b474..f5e2bdc4 100644
+--- a/depends/lua/include/luaconf.h
++++ b/depends/lua/include/luaconf.h.in
+@@ -192,7 +192,7 @@
+
+ #else /* }{ */
+
+-#define LUA_LDIR "./hack/lua/"
++#define LUA_LDIR "@DFHACK_LUA_DESTINATION@" "/"
+ #define LUA_CDIR "./hack/"
+ #define LUA_PATH_DEFAULT \
+ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" "./?.lua"
+--
+2.11.1
+