diff options
15 files changed, 681 insertions, 1 deletions
diff --git a/games-util/dfhack/dfhack-0.40.13.1.ebuild b/games-util/dfhack/dfhack-0.40.13.1.ebuild index a94486f8..7af5abde 100644 --- a/games-util/dfhack/dfhack-0.40.13.1.ebuild +++ b/games-util/dfhack/dfhack-0.40.13.1.ebuild @@ -222,6 +222,7 @@ src_configure() { "-DDF_EXECUTABLE=${df_executable}" "-DDL_RUBY=OFF" "-DRUBYLIB=${WORKDIR}/libruby.so" + "-DINSTALL_NEW_LIBSTDCXX=OFF" ) # "-DSSENSE_ALLEGRO_DESTINATION=${dfhack_libdir}" # "-DSSENSE_RES_DESTINATION=${dfhack_datadir}/stonesense" diff --git a/games-util/dfhack/dfhack-0.40.23.1.ebuild b/games-util/dfhack/dfhack-0.40.23.1.ebuild new file mode 120000 index 00000000..1f968918 --- /dev/null +++ b/games-util/dfhack/dfhack-0.40.23.1.ebuild @@ -0,0 +1 @@ +dfhack-0.40.13.1.ebuild
\ No newline at end of file diff --git a/games-util/dfhack/files/dfhack-0.40.23/01-compile-static-libraries-as.patch b/games-util/dfhack/files/dfhack-0.40.23/01-compile-static-libraries-as.patch new file mode 120000 index 00000000..e15caa67 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/01-compile-static-libraries-as.patch @@ -0,0 +1 @@ +../dfhack-0.40.19/01-compile-static-libraries-as.patch
\ No newline at end of file diff --git a/games-util/dfhack/files/dfhack-0.40.23/02-drop-strange-build-options.patch b/games-util/dfhack/files/dfhack-0.40.23/02-drop-strange-build-options.patch new file mode 120000 index 00000000..527f6158 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/02-drop-strange-build-options.patch @@ -0,0 +1 @@ +../dfhack-0.40.19/02-drop-strange-build-options.patch
\ No newline at end of file diff --git a/games-util/dfhack/files/dfhack-0.40.23/03-configurable-install-paths.patch b/games-util/dfhack/files/dfhack-0.40.23/03-configurable-install-paths.patch new file mode 100644 index 00000000..633f7d00 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/03-configurable-install-paths.patch @@ -0,0 +1,96 @@ +configurable install paths + +From: eroen <eroen@occam.eroen.eu> + + +--- + CMakeLists.txt | 20 +++++++++++--------- + library/CMakeLists.txt | 6 +++--- + plugins/ruby/CMakeLists.txt | 4 ++-- + 3 files changed, 16 insertions(+), 14 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dc8d92d..a9dc99f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,30 +68,32 @@ add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}") + # the dfhack libraries will be installed here: + IF(UNIX) + # put the lib into DF/hack +- SET(DFHACK_LIBRARY_DESTINATION hack) +- SET(DFHACK_EGGY_DESTINATION libs) ++ SET(DFHACK_LIBRARY_DESTINATION hack CACHE PATH "DFHACK_LIBRARY_DESTINATION") ++ SET(DFHACK_EGGY_DESTINATION libs CACHE PATH "DFHACK_EGGY_DESTINATION") + ELSE() + # windows is crap, therefore we can't do nice things with it. leave the libs on a nasty pile... + SET(DFHACK_LIBRARY_DESTINATION .) + SET(DFHACK_EGGY_DESTINATION .) + ENDIF() + # external tools will be installed here: +-SET(DFHACK_BINARY_DESTINATION .) ++SET(DFHACK_BINARY_DESTINATION . CACHE PATH "DFHACK_BINARY_DESTINATION") + # dfhack data goes here: +-SET(DFHACK_DATA_DESTINATION hack) ++SET(DFHACK_DATA_DESTINATION hack CACHE PATH "DFHACK_DATA_DESTINATION") + # plugin libs go here: +-SET(DFHACK_PLUGIN_DESTINATION hack/plugins) ++SET(DFHACK_PLUGIN_DESTINATION hack/plugins CACHE PATH "DFHACK_PLUGIN_DESTINATION") + # dfhack header files go here: +-SET(DFHACK_INCLUDES_DESTINATION hack/include) ++SET(DFHACK_INCLUDES_DESTINATION hack/include CACHE PATH "DFHACK_INCLUDES_DESTINATION") + # dfhack lua files go here: +-SET(DFHACK_LUA_DESTINATION hack/lua) ++SET(DFHACK_LUA_DESTINATION hack/lua CACHE PATH "DFHACK_LUA_DESTINATION") ++# dfhack ruby files go here: ++SET(DFHACK_RUBY_DESTINATION hack/ruby CACHE PATH "DFHACK_RUBY_DESTINATION") + # the windows .lib file goes here: + SET(DFHACK_DEVLIB_DESTINATION hack) + + # user documentation goes here: +-SET(DFHACK_USERDOC_DESTINATION hack) ++SET(DFHACK_USERDOC_DESTINATION hack CACHE PATH "DFHACK_USERDOC_DESTINATION") + # developer documentation goes here: +-SET(DFHACK_DEVDOC_DESTINATION hack) ++SET(DFHACK_DEVDOC_DESTINATION hack CACHE PATH "DFHACK_DEVDOC_DESTINATION") + + ## some options for the user/developer to play with + OPTION(BUILD_LIBRARY "Build the library that goes into DF." ON) +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index 17ee451..4184a21 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -315,9 +315,9 @@ IF(UNIX) + else() + # On linux, copy our version of the df launch script which sets LD_PRELOAD + install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack +- DESTINATION .) ++ DESTINATION ${DFHACK_BINARY_DESTINATION}) + install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack-run +- DESTINATION .) ++ DESTINATION ${DFHACK_BINARY_DESTINATION}) + endif() + ELSE() + if(NOT BUILD_EGGY) +@@ -343,7 +343,7 @@ install(FILES xml/symbols.xml + DESTINATION ${DFHACK_DATA_DESTINATION}) #linux: share/dfhack + #install the example autoexec file + install(FILES ../dfhack.init-example +- DESTINATION ${DFHACK_BINARY_DESTINATION}) ++ DESTINATION ${DFHACK_USERDOC_DESTINATION}) + + install(TARGETS dfhack-run dfhack-client binpatch + LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION} +diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt +index eaa08b1..914ebf4 100644 +--- a/plugins/ruby/CMakeLists.txt ++++ b/plugins/ruby/CMakeLists.txt +@@ -36,7 +36,7 @@ ADD_DEPENDENCIES(ruby ruby-autogen-rb) + INSTALL(FILES ${RUBYLIB} DESTINATION ${DFHACK_LIBRARY_DESTINATION}) + + INSTALL(DIRECTORY . +- DESTINATION hack/ruby ++ DESTINATION ${DFHACK_RUBY_DESTINATION} + FILES_MATCHING PATTERN "*.rb") + +-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN} DESTINATION hack/ruby) ++INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN} DESTINATION ${DFHACK_RUBY_DESTINATION}) diff --git a/games-util/dfhack/files/dfhack-0.40.23/04-compile-time-configurable.patch b/games-util/dfhack/files/dfhack-0.40.23/04-compile-time-configurable.patch new file mode 100644 index 00000000..d502ebb3 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/04-compile-time-configurable.patch @@ -0,0 +1,142 @@ +compile-time configurable paths + +From: eroen <eroen@occam.eroen.eu> + +./hack/symbols.xml +- Breaks startup + +./hack/lua +./hack/ruby +- Make noise on startup +--- + CMakeLists.txt | 4 ++++ + depends/lua/include/luaconf.h | 8 ++++++++ + library/Core.cpp | 6 +++++- + plugins/ruby/ruby.cpp | 8 ++++++++ + plugins/sort.cpp | 8 ++++++++ + 5 files changed, 33 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a9dc99f..1a57d0e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,6 +69,7 @@ add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}") + IF(UNIX) + # put the lib into DF/hack + SET(DFHACK_LIBRARY_DESTINATION hack CACHE PATH "DFHACK_LIBRARY_DESTINATION") ++ ADD_DEFINITIONS(-DDFHACK_LIBRARY_DESTINATION="${DFHACK_LIBRARY_DESTINATION}") + SET(DFHACK_EGGY_DESTINATION libs CACHE PATH "DFHACK_EGGY_DESTINATION") + ELSE() + # windows is crap, therefore we can't do nice things with it. leave the libs on a nasty pile... +@@ -79,14 +80,17 @@ ENDIF() + SET(DFHACK_BINARY_DESTINATION . CACHE PATH "DFHACK_BINARY_DESTINATION") + # dfhack data goes here: + SET(DFHACK_DATA_DESTINATION hack CACHE PATH "DFHACK_DATA_DESTINATION") ++ADD_DEFINITIONS(-DDFHACK_DATA_DESTINATION="${DFHACK_DATA_DESTINATION}") + # plugin libs go here: + SET(DFHACK_PLUGIN_DESTINATION hack/plugins CACHE PATH "DFHACK_PLUGIN_DESTINATION") + # dfhack header files go here: + SET(DFHACK_INCLUDES_DESTINATION hack/include CACHE PATH "DFHACK_INCLUDES_DESTINATION") + # dfhack lua files go here: + SET(DFHACK_LUA_DESTINATION hack/lua CACHE PATH "DFHACK_LUA_DESTINATION") ++ADD_DEFINITIONS(-DDFHACK_LUA_DESTINATION="${DFHACK_LUA_DESTINATION}") + # dfhack ruby files go here: + SET(DFHACK_RUBY_DESTINATION hack/ruby CACHE PATH "DFHACK_RUBY_DESTINATION") ++ADD_DEFINITIONS(-DDFHACK_RUBY_DESTINATION="${DFHACK_RUBY_DESTINATION}") + # the windows .lib file goes here: + SET(DFHACK_DEVLIB_DESTINATION hack) + +diff --git a/depends/lua/include/luaconf.h b/depends/lua/include/luaconf.h +index af09ffb..b0e8a8a 100644 +--- a/depends/lua/include/luaconf.h ++++ b/depends/lua/include/luaconf.h +@@ -98,8 +98,16 @@ + + #else /* }{ */ + ++#ifdef DFHACK_LUA_DESTINATION ++#define LUA_LDIR DFHACK_LUA_DESTINATION "/" ++#else + #define LUA_LDIR "./hack/lua/" ++#endif ++#ifdef DFHACK_DATA_DESTINATION ++#define LUA_CDIR DFHACK_DATA_DESTINATION "/" ++#else + #define LUA_CDIR "./hack/" ++#endif + #define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" "./?.lua" + #define LUA_CPATH_DEFAULT \ +diff --git a/library/Core.cpp b/library/Core.cpp +index 19e2c43..d271840 100644 +--- a/library/Core.cpp ++++ b/library/Core.cpp +@@ -991,7 +991,11 @@ bool Core::Init() + + // find out what we are... + #ifdef LINUX_BUILD +- const char * path = "hack/symbols.xml"; ++ #ifdef DFHACK_DATA_DESTINATION ++ const char * path = DFHACK_DATA_DESTINATION "/symbols.xml"; ++ #else ++ const char * path = "hack/symbols.xml"; ++ #endif + #else + const char * path = "hack\\symbols.xml"; + #endif +diff --git a/plugins/ruby/ruby.cpp b/plugins/ruby/ruby.cpp +index 93d6501..789a031 100644 +--- a/plugins/ruby/ruby.cpp ++++ b/plugins/ruby/ruby.cpp +@@ -326,7 +326,11 @@ static int df_loadruby(void) + #elif defined(__APPLE__) + "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib"; + #else ++ #ifdef DFHACK_LIBRARY_DESTINATION ++ DFHACK_LIBRARY_DESTINATION "/libruby.so"; ++ #else + "hack/libruby.so"; ++ #endif + #endif + + libruby_handle = OpenPlugin(libpath); +@@ -434,7 +438,11 @@ static void df_rubythread(void *p) + + // load the default ruby-level definitions in the background + state=0; ++ #ifdef DFHACK_RUBY_DESTINATION ++ rb_eval_string_protect("require '" DFHACK_RUBY_DESTINATION "/ruby'", &state); ++ #else + rb_eval_string_protect("require './hack/ruby/ruby'", &state); ++ #endif + if (state) + dump_rb_error(); + +diff --git a/plugins/sort.cpp b/plugins/sort.cpp +index 7d80b4a..f7b4bce 100644 +--- a/plugins/sort.cpp ++++ b/plugins/sort.cpp +@@ -63,7 +63,11 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi + " The '>' prefix reverses the sort order for defined values.\n" + " Unit order examples:\n" + " name, age, arrival, squad, squad_position, profession\n" ++ #ifdef DFHACK_LUA_DESTINATION ++ "The orderings are defined in " DFHACK_LUA_DESTINATION "/plugins/sort/*.lua\n" ++ #else + "The orderings are defined in hack/lua/plugins/sort/*.lua\n" ++ #endif + )); + commands.push_back(PluginCommand( + "sort-items", "Sort the visible item list.", sort_items, item_list_hotkey, +@@ -73,7 +77,11 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi + " The '>' prefix reverses the sort order for defined values.\n" + " Item order examples:\n" + " description, material, wear, type, quality\n" ++ #ifdef DFHACK_LUA_DESTINATION ++ "The orderings are defined in " DFHACK_LUA_DESTINATION "/plugins/sort/*.lua\n" ++ #else + "The orderings are defined in hack/lua/plugins/sort/*.lua\n" ++ #endif + )); + return CR_OK; + } diff --git a/games-util/dfhack/files/dfhack-0.40.23/05-compile-time-configurable-0.patch b/games-util/dfhack/files/dfhack-0.40.23/05-compile-time-configurable-0.patch new file mode 100644 index 00000000..b8d86707 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/05-compile-time-configurable-0.patch @@ -0,0 +1,66 @@ +compile-time configurable paths + +From: eroen <eroen@occam.eroen.eu> + +hack/ +./ +--- + library/Core.cpp | 12 ++++++++++++ + plugins/zone.cpp | 2 ++ + 2 files changed, 14 insertions(+) + +diff --git a/library/Core.cpp b/library/Core.cpp +index d271840..50f19b1 100644 +--- a/library/Core.cpp ++++ b/library/Core.cpp +@@ -323,7 +323,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()); + } +@@ -411,7 +415,11 @@ string findScript(string path, string name) { + if (fileExists(file)) { + return file; + } ++ #ifdef DFHACK_DATA_DESTINATION ++ file = string(DFHACK_DATA_DESTINATION) + "/scripts/" + name; ++ #else + file = path + "/hack/scripts/" + name; ++ #endif + if (fileExists(file)) { + return file; + } +@@ -974,7 +982,11 @@ void Core::fatal (std::string output, bool deactivate) + 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 +diff --git a/plugins/zone.cpp b/plugins/zone.cpp +index f6a5255..5e00e53 100644 +--- a/plugins/zone.cpp ++++ b/plugins/zone.cpp +@@ -3202,8 +3202,10 @@ command_result df_autobutcher(color_ostream &out, vector <string> & parameters) + { + string run = "dfhack-run autobutcher "; + #ifdef LINUX_BUILD ++#ifndef DFHACK_DATA_DESTINATION + run = "./dfhack-run autobutcher "; + #endif ++#endif + // force creation of config + out << run << "start" << endl; + diff --git a/games-util/dfhack/files/dfhack-0.40.23/06-compile-time-configurable-1.patch b/games-util/dfhack/files/dfhack-0.40.23/06-compile-time-configurable-1.patch new file mode 120000 index 00000000..cd6372d1 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/06-compile-time-configurable-1.patch @@ -0,0 +1 @@ +../dfhack-0.40.19/06-compile-time-configurable-1.patch
\ No newline at end of file diff --git a/games-util/dfhack/files/dfhack-0.40.23/07-startup-scripts-configurable.patch b/games-util/dfhack/files/dfhack-0.40.23/07-startup-scripts-configurable.patch new file mode 100644 index 00000000..ba32c9a9 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/07-startup-scripts-configurable.patch @@ -0,0 +1,292 @@ +startup scripts - configurable paths + +From: eroen <eroen@occam.eroen.eu> + + +--- + CMakeLists.txt | 3 ++ + library/CMakeLists.txt | 13 +++++++ + package/linux/dfhack | 81 ------------------------------------------- + package/linux/dfhack-run | 8 ---- + package/linux/dfhack-run.in | 8 ++++ + package/linux/dfhack.in | 81 +++++++++++++++++++++++++++++++++++++++++++ + package/linux/egghack | 7 ---- + package/linux/egghack.in | 7 ++++ + 8 files changed, 112 insertions(+), 96 deletions(-) + delete mode 100755 package/linux/dfhack + delete mode 100755 package/linux/dfhack-run + create mode 100755 package/linux/dfhack-run.in + create mode 100755 package/linux/dfhack.in + delete mode 100755 package/linux/egghack + create mode 100755 package/linux/egghack.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b0adea4..8328183 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,6 +68,9 @@ add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}") + SET(DFHACK_STATEDIR "." CACHE PATH "DFHACK_STATEDIR") + ADD_DEFINITIONS(-DDFHACK_STATEDIR="${DFHACK_STATEDIR}") + ++## what to call to start DF, configured into startup scripts ++SET(DF_EXECUTABLE "./libs/Dwarf_Fortress" CACHE STRING "DF_EXECUTABLE") ++ + ## where to install things (after the build is done, classic 'make install' or package structure) + # the dfhack libraries will be installed here: + IF(UNIX) +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index 4184a21..a08ef3a 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -314,10 +314,23 @@ IF(UNIX) + ENDIF(INSTALL_NEW_LIBSTDCXX) + else() + # On linux, copy our version of the df launch script which sets LD_PRELOAD ++ configure_file(${dfhack_SOURCE_DIR}/package/linux/dfhack.in ++ ${dfhack_SOURCE_DIR}/package/linux/dfhack ++ @ONLY) ++ configure_file(${dfhack_SOURCE_DIR}/package/linux/dfhack-run.in ++ ${dfhack_SOURCE_DIR}/package/linux/dfhack-run ++ @ONLY) ++ configure_file(${dfhack_SOURCE_DIR}/package/linux/egghack.in ++ ${dfhack_SOURCE_DIR}/package/linux/egghack ++ @ONLY) + install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack + DESTINATION ${DFHACK_BINARY_DESTINATION}) + install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack-run + DESTINATION ${DFHACK_BINARY_DESTINATION}) ++ if(BUILD_EGGY) ++ install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/egghack ++ DESTINATION ${DFHACK_BINARY_DESTINATION}) ++ endif() + endif() + ELSE() + if(NOT BUILD_EGGY) +diff --git a/package/linux/dfhack b/package/linux/dfhack +deleted file mode 100755 +index 4fa3e20..0000000 +--- a/package/linux/dfhack ++++ /dev/null +@@ -1,81 +0,0 @@ +-#!/bin/sh +- +-# NOTE: This is dfhack's modification of the normal invocation script, +-# changed to properly set LD_PRELOAD so as to run DFHACK. +-# +-# You can run DF under gdb by passing -g or --gdb as the first argument. +-# +-# If the file ".dfhackrc" exists in the DF directory or your home directory +-# it will be sourced by this script, to let you set environmental variables. +-# If it exists in both places it will first source the one in your home +-# directory, then the on in the game directory. +-# +-# Shell variables .dfhackrc can set to affect this script: +-# DF_GDB_OPTS: Options to pass to gdb, if it's being run +-# DF_VALGRIND_OPTS: Options to pass to valgrind, if it's being run +-# DF_HELGRIND_OPTS: Options to pass to helgrind, if it's being run +-# DF_POST_CMD: Shell command to be run at very end of script +- +-DF_DIR=$(dirname "$0") +-cd "${DF_DIR}" +-export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch. +-#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing. +- +-# User config files +-RC=".dfhackrc" +- +-if [ -r "$HOME/$RC" ]; then +- . $HOME/$RC +-fi +-if [ -r "./$RC" ]; then +- . "./$RC" +-fi +- +-# Save current terminal settings +-old_tty_settings=$(stty -g) +- +-# Now run +- +-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack" +- +-PRELOAD_LIB=./hack/libdfhack.so +- +-case "$1" in +- -g | --gdb) +- shift +- echo "set environment LD_PRELOAD=$PRELOAD_LIB" > gdbcmd.tmp +- echo "set environment MALLOC_PERTURB_=45" >> gdbcmd.tmp +- gdb $DF_GDB_OPTS -x gdbcmd.tmp ./libs/Dwarf_Fortress "$@" +- rm gdbcmd.tmp +- ret=$? +- ;; +- -h | --helgrind) +- shift +- LD_PRELOAD=$PRELOAD_LIB setarch i386 -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress "$@" +- ret=$? +- ;; +- -v | --valgrind) +- shift +- LD_PRELOAD=$PRELOAD_LIB setarch i386 -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./libs/Dwarf_Fortress "$@" +- ret=$? +- ;; +- -c | --callgrind) +- shift +- LD_PRELOAD=$PRELOAD_LIB setarch i386 -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./libs/Dwarf_Fortress "$@" +- ret=$? +- ;; +- *) +- setarch i386 -R env LD_PRELOAD=$PRELOAD_LIB ./libs/Dwarf_Fortress "$@" +- ret=$? +- ;; +-esac +- +-# Restore previous terminal settings +-stty "$old_tty_settings" +-echo +- +-if [ -n "$DF_POST_CMD" ]; then +- eval $DF_POST_CMD +-fi +- +-exit $ret +diff --git a/package/linux/dfhack-run b/package/linux/dfhack-run +deleted file mode 100755 +index 55001cf..0000000 +--- a/package/linux/dfhack-run ++++ /dev/null +@@ -1,8 +0,0 @@ +-#!/bin/sh +- +-DF_DIR=$(dirname "$0") +-cd "${DF_DIR}" +- +-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack" +- +-exec hack/dfhack-run "$@" +diff --git a/package/linux/dfhack-run.in b/package/linux/dfhack-run.in +new file mode 100755 +index 0000000..f013053 +--- /dev/null ++++ b/package/linux/dfhack-run.in +@@ -0,0 +1,8 @@ ++#!/bin/sh ++ ++DF_DIR=$(dirname "$0") ++cd "${DF_DIR}" ++ ++export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"@DFHACK_LIBRARY_DESTINATION@"/libs:"@DFHACK_LIBRARY_DESTINATION@" ++ ++exec "@DFHACK_LIBRARY_DESTINATION@"/dfhack-run "${@}" +diff --git a/package/linux/dfhack.in b/package/linux/dfhack.in +new file mode 100755 +index 0000000..7c1ec1b +--- /dev/null ++++ b/package/linux/dfhack.in +@@ -0,0 +1,81 @@ ++#!/bin/sh ++ ++# NOTE: This is dfhack's modification of the normal invocation script, ++# changed to properly set LD_PRELOAD so as to run DFHACK. ++# ++# You can run DF under gdb by passing -g or --gdb as the first argument. ++# ++# If the file ".dfhackrc" exists in the DF directory or your home directory ++# it will be sourced by this script, to let you set environmental variables. ++# If it exists in both places it will first source the one in your home ++# directory, then the on in the game directory. ++# ++# Shell variables .dfhackrc can set to affect this script: ++# DF_GDB_OPTS: Options to pass to gdb, if it's being run ++# DF_VALGRIND_OPTS: Options to pass to valgrind, if it's being run ++# DF_HELGRIND_OPTS: Options to pass to helgrind, if it's being run ++# DF_POST_CMD: Shell command to be run at very end of script ++ ++DF_DIR=$(dirname "$0") ++cd "${DF_DIR}" ++export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch. ++#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing. ++ ++# User config files ++RC=".dfhackrc" ++ ++if [ -r "$HOME/$RC" ]; then ++ . $HOME/$RC ++fi ++if [ -r "./$RC" ]; then ++ . "./$RC" ++fi ++ ++# Save current terminal settings ++old_tty_settings=$(stty -g) ++ ++# Now run ++ ++export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"@DFHACK_LIBRARY_DESTINATION@"/libs:"@DFHACK_LIBRARY_DESTINATION@" ++ ++PRELOAD_LIB="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so ++ ++case "$1" in ++ -g | --gdb) ++ shift ++ echo "set environment LD_PRELOAD=@DFHACK_LIBRARY_DESTINATION@/libdfhack.so" > gdbcmd.tmp ++ echo "set environment MALLOC_PERTURB_=45" >> gdbcmd.tmp ++ gdb ${DF_GDB_OPTS} -x gdbcmd.tmp "@DF_EXECUTABLE@" "${@}" ++ rm gdbcmd.tmp ++ ret=$? ++ ;; ++ -h | --helgrind) ++ shift ++ LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so setarch i386 -R valgrind ${DF_HELGRIND_OPTS} --tool=helgrind --log-file=helgrind.log "@DF_EXECUTABLE@" "${@}" ++ ret=$? ++ ;; ++ -v | --valgrind) ++ shift ++ LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so setarch i386 -R valgrind ${DF_VALGRIND_OPTS} --log-file=valgrind.log "@DF_EXECUTABLE@" "${@}" ++ ret=$? ++ ;; ++ -c | --callgrind) ++ shift ++ LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so setarch i386 -R valgrind ${DF_CALLGRIND_OPTS} --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log "@DF_EXECUTABLE@" "${@}" ++ ret=$? ++ ;; ++ *) ++ setarch i386 -R env LD_PRELOAD=$PRELOAD_LIB "@DF_EXECUTABLE@" "$@" ++ ret=$? ++ ;; ++esac ++ ++# Restore previous terminal settings ++stty "$old_tty_settings" ++echo ++ ++if [ -n "$DF_POST_CMD" ]; then ++ eval $DF_POST_CMD ++fi ++ ++exit $ret +diff --git a/package/linux/egghack b/package/linux/egghack +deleted file mode 100755 +index 5b3b03b..0000000 +--- a/package/linux/egghack ++++ /dev/null +@@ -1,7 +0,0 @@ +-#!/bin/sh +-DF_DIR=$(dirname "$0") +-cd "${DF_DIR}" +-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack" +-export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch. +-#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing. +-./libs/Dwarf_Fortress $* # Go, go, go! :) +diff --git a/package/linux/egghack.in b/package/linux/egghack.in +new file mode 100755 +index 0000000..4bf4c9d +--- /dev/null ++++ b/package/linux/egghack.in +@@ -0,0 +1,7 @@ ++#!/bin/sh ++DF_DIR=$(dirname "$0") ++cd "${DF_DIR}" ++export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"@DFHACK_LIBRARY_DESTINATION@"/libs:"@DFHACK_LIBRARY_DESTINATION@" ++export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch. ++#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing. ++"@DF_EXECUTABLE@" ${*} # Go, go, go! :) diff --git a/games-util/dfhack/files/dfhack-0.40.23/08-ruby-plugin-configurable-paths.patch b/games-util/dfhack/files/dfhack-0.40.23/08-ruby-plugin-configurable-paths.patch new file mode 120000 index 00000000..488c90bd --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/08-ruby-plugin-configurable-paths.patch @@ -0,0 +1 @@ +../dfhack-0.40.19/08-ruby-plugin-configurable-paths.patch
\ No newline at end of file diff --git a/games-util/dfhack/files/dfhack-0.40.23/09-eggy-remove-annoying-banner.patch b/games-util/dfhack/files/dfhack-0.40.23/09-eggy-remove-annoying-banner.patch new file mode 120000 index 00000000..60bd94e7 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/09-eggy-remove-annoying-banner.patch @@ -0,0 +1 @@ +../dfhack-0.40.19/09-eggy-remove-annoying-banner.patch
\ No newline at end of file diff --git a/games-util/dfhack/files/dfhack-0.40.23/10-unbreak-egg.patch b/games-util/dfhack/files/dfhack-0.40.23/10-unbreak-egg.patch new file mode 100644 index 00000000..6ea6243a --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/10-unbreak-egg.patch @@ -0,0 +1,27 @@ +Unbreak egg + +From: eroen <eroen@occam.eroen.eu> + +See: + commit fc24d24ccc2147fff61e309bcb2167b9709249b6 + Merge Console-linux and Console-darwin into Console-posix +--- + library/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index a08ef3a..c1db87a 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -99,9 +99,9 @@ Process-darwin.cpp + ) + + SET(MAIN_SOURCES_LINUX_EGGY +-Console-linux.cpp ++Console-posix.cpp + Hooks-egg.cpp +-PlugLoad-linux.cpp ++PlugLoad-posix.cpp + Process-linux.cpp + ) + diff --git a/games-util/dfhack/files/dfhack-0.40.23/11-dfhack-init-example.patch b/games-util/dfhack/files/dfhack-0.40.23/11-dfhack-init-example.patch new file mode 100644 index 00000000..b6cb1bef --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/11-dfhack-init-example.patch @@ -0,0 +1,39 @@ +dfhack.init.example + +From: eroen <eroen@occam.eroen.eu> + + +--- + library/CMakeLists.txt | 2 +- + library/Core.cpp | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index ac419d4..84d637f 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -356,7 +356,7 @@ install(FILES xml/symbols.xml + DESTINATION ${DFHACK_DATA_DESTINATION}) #linux: share/dfhack + #install the example autoexec file + install(FILES ../dfhack.init-example +- DESTINATION ${DFHACK_USERDOC_DESTINATION}) ++ DESTINATION ${DFHACK_DATA_DESTINATION}) + + install(TARGETS dfhack-run dfhack-client binpatch + LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION} +diff --git a/library/Core.cpp b/library/Core.cpp +index 583fea9..e9df20a 100644 +--- a/library/Core.cpp ++++ b/library/Core.cpp +@@ -861,7 +861,11 @@ static void run_dfhack_init(color_ostream &out, Core *core) + if (!core->loadScriptFile(out, "dfhack.init", true)) + { + core->runCommand(out, "gui/no-dfhack-init"); ++#ifdef DFHACK_DATA_DESTINATION ++ core->loadScriptFile(out, DFHACK_DATA_DESTINATION "/dfhack.init-example", true); ++#else + core->loadScriptFile(out, "dfhack.init-example", true); ++#endif + } + } + diff --git a/games-util/dfhack/files/dfhack-0.40.23/series b/games-util/dfhack/files/dfhack-0.40.23/series new file mode 100644 index 00000000..f8330638 --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.40.23/series @@ -0,0 +1,12 @@ +# This series applies on GIT commit 448404a4650964fec1cae0867707483514629d44 +01-compile-static-libraries-as.patch +02-drop-strange-build-options.patch +03-configurable-install-paths.patch +04-compile-time-configurable.patch +05-compile-time-configurable-0.patch +06-compile-time-configurable-1.patch +07-startup-scripts-configurable.patch +08-ruby-plugin-configurable-paths.patch +09-eggy-remove-annoying-banner.patch +10-unbreak-egg.patch +11-dfhack-init-example.patch diff --git a/profiles/package.use.mask b/profiles/package.use.mask index d65a601b..d6d93793 100644 --- a/profiles/package.use.mask +++ b/profiles/package.use.mask @@ -1,5 +1,4 @@ dev-libs/libgraphics:40.24 egg -dev-libs/libgraphics:40.23 egg dev-libs/libgraphics:40.22 egg dev-libs/libgraphics:40.21 egg dev-libs/libgraphics:40.20 egg |
