summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreroen <eroen-overlay@occam.eroen.eu>2017-03-07 23:02:29 +0100
committereroen <eroen-overlay@occam.eroen.eu>2017-03-07 23:50:19 +0100
commit711e7dd8eaec29453fa0c13cbeae591e65b1a1fb (patch)
treef954c4f13b8a5d1bc66cc6a6f86fdc5d6dc31b93
parentsunlesssea-2.2.2.3129 - bump (diff)
downloaderoen-711e7dd8eaec29453fa0c13cbeae591e65b1a1fb.tar.gz
eroen-711e7dd8eaec29453fa0c13cbeae591e65b1a1fb.tar.bz2
eroen-711e7dd8eaec29453fa0c13cbeae591e65b1a1fb.zip
dfhack - bump to 0.43.05-beta1
-rw-r--r--games-roguelike/dwarf-fortress/dwarf-fortress-0.43.05.ebuild9
-rw-r--r--games-util/dfhack/dfhack-0.40.13.9999.ebuild279
-rw-r--r--games-util/dfhack/dfhack-0.43.05.9999.ebuild104
-rw-r--r--games-util/dfhack/dfhack-0.43.05_alpha_pre20160726.ebuild (renamed from games-util/dfhack/dfhack-0.43.05_pre20160726.ebuild)6
-rw-r--r--games-util/dfhack/dfhack-0.43.05_beta1.ebuild104
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/01-respect.patch (renamed from games-util/dfhack/files/dfhack-0.43.05_pre20160726/01-respect.patch)0
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/02-respect-dfhack_lua_destination.patch (renamed from games-util/dfhack/files/dfhack-0.43.05_pre20160726/02-respect-dfhack_lua_destination.patch)0
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/03-respect-0.patch (renamed from games-util/dfhack/files/dfhack-0.43.05_pre20160726/03-respect-0.patch)0
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/04-respect-1.patch (renamed from games-util/dfhack/files/dfhack-0.43.05_pre20160726/04-respect-1.patch)0
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/05-introduce.patch (renamed from games-util/dfhack/files/dfhack-0.43.05_pre20160726/05-introduce.patch)0
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/series (renamed from games-util/dfhack/files/dfhack-0.43.05_pre20160726/series)0
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_beta1/0001-Respect-DFHACK_DATA_DESTINATION.patch95
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_beta1/0002-respect-DFHACK_LUA_DESTINATION.patch75
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_beta1/0003-respect-DFHACK_PLUGIN_DESTINATION.patch65
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_beta1/0004-respect-DFHACK_LIBRARY_DESTINATION.patch65
-rw-r--r--games-util/dfhack/files/dfhack-0.43.05_beta1/0005-introduce-DFHACK_RUBY_DESTINATION.patch88
16 files changed, 605 insertions, 285 deletions
diff --git a/games-roguelike/dwarf-fortress/dwarf-fortress-0.43.05.ebuild b/games-roguelike/dwarf-fortress/dwarf-fortress-0.43.05.ebuild
index 7d2979b..b2368e7 100644
--- a/games-roguelike/dwarf-fortress/dwarf-fortress-0.43.05.ebuild
+++ b/games-roguelike/dwarf-fortress/dwarf-fortress-0.43.05.ebuild
@@ -1,11 +1,10 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id$
EAPI=6
MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit multilib-build toolchain-funcs versionator
+inherit multilib-build pax-utils toolchain-funcs versionator
MY_PV=$(replace_all_version_separators _ "$(get_version_component_range 2-)")
MY_PN=df
@@ -66,6 +65,9 @@ src_prepare() {
}
src_configure() {
+ # gcc 6 somehow removes symbols requred by dfhack
+ tc-is-gcc && [[ $(gcc-major-version) -ge 6 ]] && CXXFLAGS+=" -O0"
+
CXXFLAGS+=" -D$(use debug || echo N)DEBUG"
}
@@ -107,8 +109,9 @@ src_install() {
dodoc README.linux *.txt
fperms 755 "${gamesdir}"/libs/Dwarf_Fortress
+ pax-mark m "${ED}${gamesdir}"/libs/Dwarf_Fortress # needed to load plugins with dfhack
if ! multilib_is_native_abi; then
- mv "${ED}${gamesdir}/libs" "${ED}${gamesdir}/libs_${MULTILIB_ABI_FLAG}"
+ mv "${ED}${gamesdir}/libs" "${ED}${gamesdir}/libs_${MULTILIB_ABI_FLAG}" || die
fi
}
multilib_foreach_abi abi_src_install
diff --git a/games-util/dfhack/dfhack-0.40.13.9999.ebuild b/games-util/dfhack/dfhack-0.40.13.9999.ebuild
deleted file mode 100644
index 02ab44a..0000000
--- a/games-util/dfhack/dfhack-0.40.13.9999.ebuild
+++ /dev/null
@@ -1,279 +0,0 @@
-# By eroen, 2012-2014
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# $Header: $
-
-EAPI=5
-inherit base eutils multilib git-r3 cmake-utils games
-
-df_PV=${PV%.${PV#*.*.*.}}
-df_PV=${df_PV#0.}
-df_PV=${df_PV%%_*}
-
-DESCRIPTION="Memory hacking library for Dwarf Fortress and a set of tools that
-use it"
-HOMEPAGE="http://github.com/DFHack/dfhack"
-EGIT_REPO_URI="git://github.com/DFHack/dfhack.git"
-EGIT_BRANCH=develop
-#EGIT_COMMIT=
-SRC_URI="http://cloud.github.com/downloads/jjyg/dfhack/libruby187.tar.gz"
-
-KEYWORDS="" # ~amd64 ~x86
-
-CMAKE_MIN_VERSION=2.8.9
-CMAKE_REMOVE_MODULES_LIST="FindCurses FindDoxygen CMakeVS10FindMake"
-
-LICENSE="ZLIB MIT BSD-2"
-SLOT=${df_PV}
-IUSE="api dfusion doc egg isoworld minimal stonesense"
-
-HDEPEND="
- dev-perl/XML-LibXML
- dev-perl/XML-LibXSLT
- doc? ( app-doc/doxygen )
- "
-LIBRARY_DEPEND="
- || ( sys-libs/zlib[abi_x86_32]
- ( sys-libs/zlib
- app-emulation/emul-linux-x86-baselibs ) )
- stonesense? ( media-libs/fontconfig[abi_x86_32]
- app-emulation/emul-linux-x86-baselibs[development]
- media-libs/freetype[abi_x86_32]
- x11-libs/libICE[abi_x86_32]
- x11-libs/libSM[abi_x86_32]
- x11-libs/libX11[abi_x86_32]
- x11-libs/libXcursor[abi_x86_32]
- x11-libs/libXext[abi_x86_32]
- x11-libs/libXinerama[abi_x86_32]
- x11-libs/libXrandr[abi_x86_32]
- )
- "
-DEPEND="${LIBRARY_DEPEND}
- ${HDEPEND}"
-RDEPEND="${LIBRARY_DEPEND}
- stonesense? ( app-emulation/emul-linux-x86-opengl
- app-emulation/emul-linux-x86-xlibs
- )
- "
-# Circular dependency when building egg.
-PDEPEND="~games-simulation/dwarffortress-${df_PV}"
-
-## missing multilib
-#dev-lang/lua - binary bundled
-#dev-libs/protobuf - bundled
-## stonesense
-#allegro - binary bundled
-# dev-libs/atk (libatk-1.0.so.0) - gtklibs
-# dev-libs/glib (libgthread-2.0.so.0,libglib-2.0.so.0,libgobject-2.0.so.0,libgmodule-2.0.so.0,libgio-2.0.so.0) - baselibs
-# media-libs/fontconfig (libfontconfig.so.1)
-# media-libs/freetype (libfreetype.so.6)
-# media-libs/jpeg:62 (libjpeg.so.62) - baselibs
-# virtual/glu (libGLU.so.1) - opengl
-# media-libs/libpng:1.2 (libpng12.so.0) - baselibs
-# virtual/opengl (libGL.so.1)
-# sys-libs/zlib (libz.so.1) - baselibs
-# x11-libs/cairo (libcairo.so.2) - gtklibs
-# x11-libs/gdk-pixbuf (libgdk_pixbuf) - gtklibs
-# x11-libs/gtk+ (libgdk-x11-2.0.so.0,libgtk-x11-2.0.so.0) - gtklibs
-# x11-libs/libICE (libICE.so.6)
-# x11-libs/libSM (libSM.so.6)
-# x11-libs/libX11 (libX11.so.6)
-# x11-libs/libXcursor (libXcursor.so.1)
-# x11-libs/libXext (libXext.so.6)
-# x11-libs/libXinerama (libXinerama.so.1)
-# x11-libs/libXrandr (libXrandr.so.2)
-# x11-libs/pango (libpangocairo-1.0.so.0,libpango-1.0.so.0,libpangoft2-1.0.so.0) - gtklibs
-
-pkg_setup() {
- multilib_toolchain_setup x86
-
- df_executable="dwarffortress-${df_PV}"
- dfhack_datadir="${GAMES_DATADIR}/${P}"
- dfhack_docdir="/usr/share/doc/${P}"
- dfhack_statedir="${GAMES_STATEDIR}/${P}"
-
- dfhack_libdir=$(games_get_libdir)/dwarffortress-${df_PV}
-
- QA_FLAGS_IGNORED=("${dfhack_libdir#/}"/libruby.so)
- QA_PRESTRIPPED=("${dfhack_libdir#/}"/libruby.so)
- QA_SONAME_NO_SYMLINK=("${dfhack_libdir#/}"/libruby.so)
-}
-
-src_unpack() {
- git-r3_src_unpack
- unpack ${A}
- mv "${WORKDIR}"/libruby1.8.so.1.8.7 "${WORKDIR}"/libruby.so || die
-}
-
-src_prepare() {
- # rm -r patches-master-$(date -I)/
- # stg export -n -d patches-master-$(date -I) -e patch
- # rm /usr/local/portage/games-util/dfhack/files/dfhack-0.40.06.9999/*
- # cp patches-master-$(date -I)/* /usr/local/portage/games-util/dfhack/files/dfhack-0.40.06.9999/
- epatch "${FILESDIR}"/${PN}-0.${df_PV}/*.patch
-
- pushd "${S}"/depends/clsocket
- epatch "${FILESDIR}"/clsocket/0001-Compile-static-library-as-PIC.patch
- popd
-
- #if use stonesense; then
- # pushd "${S}"/plugins/stonesense
- # epatch "${FILESDIR}"/stonesense-${PV}/01-null-isn-t-an-int32.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/02-configurable-install-paths.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/03-don-t-segfault-if-logfile-is.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/04-compile-time-configuration-of.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/05-compile-time-configurable-log.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/06-fix-b0rked-xml-file.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/07-compile-time-configurable-dump.patch
- # epatch "${FILESDIR}"/stonesense-${PV}/08-compile-time-configurable.patch
- # # Patches that no longer fit upstream, not updated yet.
- # #epatch "${FILESDIR}"/stonesense/0003-screenshots-in-home-dir.patch
- # popd
- #fi
- #if use isoworld; then
- # pushd "${S}"/plugins/isoworld
- # epatch "${FILESDIR}"/isoworld-${PV}/01-missing-include-dir.patch
- # popd
- # ewarn "The isoworld plugin requires agui, and will probably fail to build"
- #fi
-
- # Fix other scripts
-# if use dfusion; then
-# sed -f - -i plugins/Dfusion/luafiles/{init.lua,friendship/{init.lua,plugin.lua,install.lua},triggers/{plugin.lua,functions_menu.lua},friendship_civ/init.lua,common.lua,embark/{init.lua,plugin.lua},migrants/{init.lua,plugin.lua},xml_struct.lua,xml_types.lua} <<- EOF || die
-# s:("dfusion/:("${datadir}/dfusion/:
-# s:('dfusion/:('${datadir}/dfusion/:
-# EOF
-# sed -i "s:libs/Dwarf_Fortress:Dwarf_Fortress:" plugins/Dfusion/luafiles/common.lua
-# fi
-
- ##Issues:
- # - dfusion is strange. It's always been that, though.
- # - prebuilt ruby
- # - bundled lua
- # - isoworld requires agui
- # - prebuilt allegro for stonesense.
- # - stonesense conf file: /usr/share/games/dfhack-9999/stonesense/init.txt
- # Set in ./Config.cpp, installed together with the rest of the directory.
- # - output files
- # - - Make symlinks to (unversioned) /var
-
- # Doesn't build:
- sed -e '/autolabor2/d' \
- -e '/rprobe/d' \
- -i plugins/devel/CMakeLists.txt || die
-}
-
-src_configure() {
- # cmake -Wno-dev -LA .. | grep -v '^--' | sed -e 's/:\S*=/=/' -e 's/.*/"-D&"/'
- mycmakeargs=(
- #"-DBUILD_DEVEL=OFF"
- "$(cmake-utils_use_build api DEVEL)"
- #"-DBUILD_DEV_PLUGINS=OFF"
- "$(cmake-utils_use_build !minimal DEV_PLUGINS)"
- #"-DBUILD_DFUSION=ON"
- "$(cmake-utils_use_build dfusion DFUSION)"
- #"-DBUILD_DOXYGEN=OFF"
- "$(cmake-utils_use_build doc DOXYGEN)"
- #"-DBUILD_DWARFEXPORT=ON"
- "$(cmake-utils_use_build !minimal DWARFEXPORT)"
- #"-DBUILD_EGGY=OFF"
- "$(cmake-utils_use_build egg EGGY)"
- #"-DBUILD_ISOWORLD=OFF"
- "$(cmake-utils_use_build isoworld ISOWORLD)"
- "-DBUILD_LIBRARY=ON"
- #"-DBUILD_MAPEXPORT=ON"
- "$(cmake-utils_use_build !minimal MAPEXPORT)"
- "-DBUILD_PLUGINS=ON"
- "-DBUILD_RUBY=ON"
- "-DBUILD_SKELETON=OFF"
- #"-DBUILD_STONESENSE=OFF"
- "$(cmake-utils_use_build stonesense STONESENSE)"
- #"-DBUILD_SUPPORTED=ON"
- "$(cmake-utils_use_build !minimal SUPPORTED)"
- #"-DCMAKE_INSTALL_PREFIX=/usr/local"
- "-DCMAKE_INSTALL_PREFIX=${GAMES_DATADIR}"
- "-DCONSOLE_NO_CATCH=OFF"
- #"-DDFHACK_BINARY_DESTINATION=."
- "-DDFHACK_BINARY_DESTINATION=${GAMES_BINDIR}"
- #"-DDFHACK_DATA_DESTINATION=hack"
- "-DDFHACK_DATA_DESTINATION=${dfhack_datadir}"
- #"-DDFHACK_DEVDOC_DESTINATION=hack"
- "-DDFHACK_DEVDOC_DESTINATION=${dfhack_docdir}/dev"
- #"-DDFHACK_EGGY_DESTINATION=libs"
- "-DDFHACK_EGGY_DESTINATION=${dfhack_libdir}"
- #"-DDFHACK_INCLUDES_DESTINATION=hack/include"
- "-DDFHACK_INCLUDES_DESTINATION=${GAMES_PREFIX}/include"
- #"-DDFHACK_LIBRARY_DESTINATION=hack"
- "-DDFHACK_LIBRARY_DESTINATION=${dfhack_libdir}"
- #"-DDFHACK_LUA_DESTINATION=hack/lua"
- "-DDFHACK_LUA_DESTINATION=${dfhack_datadir}/lua"
- #"-DDFHACK_PLUGIN_DESTINATION=hack/plugins"
- "-DDFHACK_PLUGIN_DESTINATION=${dfhack_datadir}/plugins"
- #"-DDFHACK_RUBY_DESTINATION=hack/ruby"
- "-DDFHACK_RUBY_DESTINATION=${dfhack_datadir}/ruby"
- #"-DDFHACK_STATEDIR=."
- "-DDFHACK_STATEDIR=${GAMES_STATEDIR}/${P}"
- #"-DDFHACK_USERDOC_DESTINATION=hack"
- "-DDFHACK_USERDOC_DESTINATION=${dfhack_docdir}"
- #"-DDF_EXECUTABLE=./libs/Dwarf_Fortress"
- "-DDF_EXECUTABLE=${df_executable}"
- "-DDL_RUBY=OFF"
- "-DRUBYLIB=${WORKDIR}/libruby.so"
- )
- # "-DSSENSE_ALLEGRO_DESTINATION=${dfhack_libdir}"
- # "-DSSENSE_RES_DESTINATION=${dfhack_datadir}/stonesense"
- # "-DSSENSE_DOC_DESTINATION=${dfhack_docdir}/stonesense"
-
- cmake-utils_src_configure
-}
-
-src_compile() {
- cmake-utils_src_compile
-}
-
-DOCS=""
-src_install() {
- cmake-utils_src_install
- mv "${D%/}/${GAMES_BINDIR}/dfhack" \
- "${D%/}/${GAMES_BINDIR}/dfhack-${df_PV}" || die
- mv "${D%/}/${GAMES_BINDIR}/dfhack-run" \
- "${D%/}/${GAMES_BINDIR}/dfhack-run-${df_PV}" || die
- ! use egg || mv "${D%/}/${GAMES_BINDIR}/egghack" \
- "${D%/}/${GAMES_BINDIR}/egghack-${df_PV}" || die
- rm -f "${D%/}/${dfhack_docdir}"/LICENSE || die
- dodir "${dfhack_statedir}"
- if use stonesense; then
- dodir "${GAMES_SYSCONFDIR#/}/${P}/stonesense"
- mv "${D%/}/${dfhack_datadir#/}/stonesense/init.txt" \
- "${D%/}/${GAMES_SYSCONFDIR#/}/${P}/stonesense/init.txt" || die
- dosym "${ROOT}${GAMES_SYSCONFDIR#/}/${P}/stonesense/init.txt" \
- "${dfhack_datadir#/}/stonesense/init.txt"
- elog
- elog "The Stonesense configuration file can be found at"
- elog "${GAMES_SYSCONFDIR#/}/${P}/stonesense/init.txt"
- fi
- prepgamesdirs
- fperms g+w "${dfhack_statedir}"
- # userpriv: portage user needs to be able to link:
- fperms o+rx "${dfhack_libdir}"
- use egg && fperms o+rx "${dfhack_libdir}"/libegg.so
-}
-
-pkg_postinst() {
- games_pkg_postinst
- elog
- elog "Due to Dwarf Fortress' special needs regarding working directory,"
- elog "specifying relative paths to DFHack plugins can give unintended results."
- elog
- elog "Your dfhack.init should be placed in \${HOME}/.dwarffortress-${df-PV}/ ,"
- elog "otherwise the example configuration will be used."
- elog
- if ! use egg; then
- elog "To start DFHack, please run dfhack-${df_PV}"
- else
- elog "To start DFHack, please run dwarffortress-${df_PV}"
- fi
-}
diff --git a/games-util/dfhack/dfhack-0.43.05.9999.ebuild b/games-util/dfhack/dfhack-0.43.05.9999.ebuild
new file mode 100644
index 0000000..b75b0b2
--- /dev/null
+++ b/games-util/dfhack/dfhack-0.43.05.9999.ebuild
@@ -0,0 +1,104 @@
+# By eroen <eroen-overlay@occam.eroen.eu>, 2012 - 2017
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+
+EAPI=6
+
+inherit versionator git-r3 cmake-utils
+
+df_PV=$(get_version_component_range 1-3)
+
+DESCRIPTION="Memory hacking library for Dwarf Fortress and a set of tools that use it"
+HOMEPAGE="http://github.com/DFHack/dfhack"
+EGIT_REPO_URI="https://github.com/DFHack/dfhack.git"
+if [[ $PV == *.9999 ]]; then
+ EGIT_BRANCH="develop"
+elif [[ $PV == *_alpha* || $PV == *_beta* ]]; then
+ EGIT_MIN_CLONE="single"
+ EGIT_COMMIT="${PV/_alpha/-alpha}"
+ EGIT_COMMIT="${EGIT_COMMIT/_beta/-beta}"
+else
+ EGIT_MIN_CLONE_TYPE=mirror
+ EGIT_COMMIT="X"
+ xml_EGIT_COMMIT="X"
+fi
+
+# KEYWORDS="-* ~amd64" # ~x86
+
+CMAKE_MIN_VERSION=2.8.0
+CMAKE_REMOVE_MODULES_LIST="FindCurses FindDoxygen CMakeVS10FindMake"
+
+LICENSE="ZLIB MIT BSD-2 BSD CC-BY-SA-3.0"
+SLOT="0"
+IUSE=""
+
+HDEPEND="
+ >=sys-devel/gcc-4.5
+ dev-lang/perl
+ dev-perl/XML-LibXML
+ dev-perl/XML-LibXSLT
+ "
+LIBRARY_DEPEND="
+ sys-libs/zlib
+ "
+DEPEND="${LIBRARY_DEPEND}
+ ${HDEPEND}"
+RDEPEND="${LIBRARY_DEPEND}
+ ~games-roguelike/dwarf-fortress-$df_PV"
+
+#PATCHES=( "$FILESDIR"/dfhack-$PV )
+
+QA_PREBUILT="opt/dfhack/hack/libruby.so"
+
+src_unpack() {
+ git-r3_src_unpack
+ if [[ -n $xml_EGIT_COMMIT ]]; then
+ cd "$S/library/xml" || die
+ git checkout "$xml_EGIT_COMMIT" || die
+ fi
+}
+
+src_prepare() {
+ default
+ local install="\${HOME}/.dwarf-fortress-${df_PV}_dfhack" exe="./libs/Dwarf_Fortress"
+ sed -e "s:^install=.*:install=${install}:" \
+ -e "s:^exe=.*:exe=\"${exe}\":" \
+ "$FILESDIR"/dfhack > "$T"/dfhack || die
+ cp "$FILESDIR"/dfhack-run "$T" || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DDFHACK_BUILD_ARCH=$(usex amd64 64 "")$(usex x86 32 "")
+ -DEXTERNAL_TINYXML=NO # https://bugs.gentoo.org/show_bug.cgi?id=592696
+ -DCMAKE_INSTALL_PREFIX=/opt/dfhack
+ -DDFHACK_DATA_DESTINATION=/opt/dfhack/hack
+ -DDFHACK_LUA_DESTINATION=/opt/dfhack/hack/lua
+ -DDFHACK_PLUGIN_DESTINATION=/opt/dfhack/hack/plugins
+ -DDFHACK_LIBRARY_DESTINATION=/opt/dfhack/hack
+ -DDFHACK_RUBY_DESTINATION=/opt/dfhack/hack/ruby
+ -DBUILD_RUBY=OFF # TODO: downloads libruby.so
+ -DBUILD_DEV_PLUGINS=ON
+ -DBUILD_SKELETON=ON
+ )
+
+ cmake-utils_src_configure
+}
+
+DOCS=""
+src_install() {
+ cmake-utils_src_install
+
+ dobin "$T"/dfhack{,-run}
+}
+
+pkg_postinst() {
+ elog "Due to Dwarf Fortress' special needs regarding working directory,"
+ elog "specifying relative paths to DFHack plugins can give unintended results."
+ elog
+ elog "Your dfhack.init should be placed in \${HOME}/.dwarf-fortress-${df_PV}_dfhack/ ,"
+ elog "otherwise the example configuration will be used."
+ elog
+ elog "To start DFHack, please run dfhack"
+}
diff --git a/games-util/dfhack/dfhack-0.43.05_pre20160726.ebuild b/games-util/dfhack/dfhack-0.43.05_alpha_pre20160726.ebuild
index cbf20ee..79feebc 100644
--- a/games-util/dfhack/dfhack-0.43.05_pre20160726.ebuild
+++ b/games-util/dfhack/dfhack-0.43.05_alpha_pre20160726.ebuild
@@ -16,9 +16,9 @@ HOMEPAGE="http://github.com/DFHack/dfhack"
EGIT_REPO_URI="https://github.com/DFHack/dfhack.git"
if [[ $PV == *.9999 ]]; then
EGIT_BRANCH="develop"
-elif [[ $PV == *_alpha* ]]; then
- EGIT_MIN_CLONE="single"
- EGIT_COMMIT="${PV/_alpha/-alpha}"
+#elif [[ $PV == *_alpha* ]]; then
+# EGIT_MIN_CLONE="single"
+# EGIT_COMMIT="${PV/_alpha/-alpha}"
else
EGIT_MIN_CLONE_TYPE=mirror
EGIT_COMMIT="29963f4b67b9edae74cd69e159bb63730b524d27"
diff --git a/games-util/dfhack/dfhack-0.43.05_beta1.ebuild b/games-util/dfhack/dfhack-0.43.05_beta1.ebuild
new file mode 100644
index 0000000..744a2e8
--- /dev/null
+++ b/games-util/dfhack/dfhack-0.43.05_beta1.ebuild
@@ -0,0 +1,104 @@
+# By eroen <eroen-overlay@occam.eroen.eu>, 2012 - 2017
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+
+EAPI=6
+
+inherit versionator git-r3 cmake-utils
+
+df_PV=$(get_version_component_range 1-3)
+
+DESCRIPTION="Memory hacking library for Dwarf Fortress and a set of tools that use it"
+HOMEPAGE="http://github.com/DFHack/dfhack"
+EGIT_REPO_URI="https://github.com/DFHack/dfhack.git"
+if [[ $PV == *.9999 ]]; then
+ EGIT_BRANCH="develop"
+elif [[ $PV == *_alpha* || $PV == *_beta* ]]; then
+ EGIT_MIN_CLONE="single"
+ EGIT_COMMIT="${PV/_alpha/-alpha}"
+ EGIT_COMMIT="${EGIT_COMMIT/_beta/-beta}"
+else
+ EGIT_MIN_CLONE_TYPE=mirror
+ EGIT_COMMIT="X"
+ xml_EGIT_COMMIT="X"
+fi
+
+KEYWORDS="-* ~amd64" # ~x86
+
+CMAKE_MIN_VERSION=2.8.0
+CMAKE_REMOVE_MODULES_LIST="FindCurses FindDoxygen CMakeVS10FindMake"
+
+LICENSE="ZLIB MIT BSD-2 BSD CC-BY-SA-3.0"
+SLOT="0"
+IUSE=""
+
+HDEPEND="
+ >=sys-devel/gcc-4.5
+ dev-lang/perl
+ dev-perl/XML-LibXML
+ dev-perl/XML-LibXSLT
+ "
+LIBRARY_DEPEND="
+ sys-libs/zlib
+ "
+DEPEND="${LIBRARY_DEPEND}
+ ${HDEPEND}"
+RDEPEND="${LIBRARY_DEPEND}
+ ~games-roguelike/dwarf-fortress-$df_PV"
+
+PATCHES=( "$FILESDIR"/dfhack-$PV )
+
+QA_PREBUILT="opt/dfhack/hack/libruby.so"
+
+src_unpack() {
+ git-r3_src_unpack
+ if [[ -n $xml_EGIT_COMMIT ]]; then
+ cd "$S/library/xml" || die
+ git checkout "$xml_EGIT_COMMIT" || die
+ fi
+}
+
+src_prepare() {
+ default
+ local install="\${HOME}/.dwarf-fortress-${df_PV}_dfhack" exe="./libs/Dwarf_Fortress"
+ sed -e "s:^install=.*:install=${install}:" \
+ -e "s:^exe=.*:exe=\"${exe}\":" \
+ "$FILESDIR"/dfhack > "$T"/dfhack || die
+ cp "$FILESDIR"/dfhack-run "$T" || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DDFHACK_BUILD_ARCH=$(usex amd64 64 "")$(usex x86 32 "")
+ -DEXTERNAL_TINYXML=NO # https://bugs.gentoo.org/show_bug.cgi?id=592696
+ -DCMAKE_INSTALL_PREFIX=/opt/dfhack
+ -DDFHACK_DATA_DESTINATION=/opt/dfhack/hack
+ -DDFHACK_LUA_DESTINATION=/opt/dfhack/hack/lua
+ -DDFHACK_PLUGIN_DESTINATION=/opt/dfhack/hack/plugins
+ -DDFHACK_LIBRARY_DESTINATION=/opt/dfhack/hack
+ -DDFHACK_RUBY_DESTINATION=/opt/dfhack/hack/ruby
+ -DBUILD_RUBY=OFF # TODO: downloads libruby.so
+ -DBUILD_DEV_PLUGINS=ON
+ -DBUILD_SKELETON=ON
+ )
+
+ cmake-utils_src_configure
+}
+
+DOCS=""
+src_install() {
+ cmake-utils_src_install
+
+ dobin "$T"/dfhack{,-run}
+}
+
+pkg_postinst() {
+ elog "Due to Dwarf Fortress' special needs regarding working directory,"
+ elog "specifying relative paths to DFHack plugins can give unintended results."
+ elog
+ elog "Your dfhack.init should be placed in \${HOME}/.dwarf-fortress-${df_PV}_dfhack/ ,"
+ elog "otherwise the example configuration will be used."
+ elog
+ elog "To start DFHack, please run dfhack"
+}
diff --git a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/01-respect.patch b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/01-respect.patch
index d06df3c..d06df3c 100644
--- a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/01-respect.patch
+++ b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/01-respect.patch
diff --git a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/02-respect-dfhack_lua_destination.patch b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/02-respect-dfhack_lua_destination.patch
index 1c7c654..1c7c654 100644
--- a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/02-respect-dfhack_lua_destination.patch
+++ b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/02-respect-dfhack_lua_destination.patch
diff --git a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/03-respect-0.patch b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/03-respect-0.patch
index b6b073f..b6b073f 100644
--- a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/03-respect-0.patch
+++ b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/03-respect-0.patch
diff --git a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/04-respect-1.patch b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/04-respect-1.patch
index 47c169a..47c169a 100644
--- a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/04-respect-1.patch
+++ b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/04-respect-1.patch
diff --git a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/05-introduce.patch b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/05-introduce.patch
index c14a4fd..c14a4fd 100644
--- a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/05-introduce.patch
+++ b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/05-introduce.patch
diff --git a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/series b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/series
index 706c489..706c489 100644
--- a/games-util/dfhack/files/dfhack-0.43.05_pre20160726/series
+++ b/games-util/dfhack/files/dfhack-0.43.05_alpha_pre20160726/series
diff --git a/games-util/dfhack/files/dfhack-0.43.05_beta1/0001-Respect-DFHACK_DATA_DESTINATION.patch b/games-util/dfhack/files/dfhack-0.43.05_beta1/0001-Respect-DFHACK_DATA_DESTINATION.patch
new file mode 100644
index 0000000..974a42f
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.43.05_beta1/0001-Respect-DFHACK_DATA_DESTINATION.patch
@@ -0,0 +1,95 @@
+From 7a33b82491455f073dddc0fc4c6223d03d4aaf19 Mon Sep 17 00:00:00 2001
+From: eroen <eroen@occam.eroen.eu>
+Date: Tue, 7 Mar 2017 22:43:57 +0100
+Subject: [PATCH 1/5] Respect DFHACK_DATA_DESTINATION
+
+---
+ CMakeLists.txt | 2 +-
+ library/CMakeLists.txt | 3 +++
+ library/Core.cpp | 14 ++++++++++----
+ 3 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c7c0835a..01a84b92 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -156,7 +156,7 @@ ENDIF()
+ # external tools will be installed here:
+ SET(DFHACK_BINARY_DESTINATION .)
+ # dfhack data goes here:
+-SET(DFHACK_DATA_DESTINATION hack)
++SET(DFHACK_DATA_DESTINATION hack CACHE INTERNAL "")
+ # plugin libs go here:
+ SET(DFHACK_PLUGIN_DESTINATION hack/plugins)
+ # dfhack header files go here:
+diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
+index 9f847799..ed1650e9 100644
+--- a/library/CMakeLists.txt
++++ b/library/CMakeLists.txt
+@@ -78,6 +78,9 @@ RemoteServer.cpp
+ RemoteTools.cpp
+ )
+
++set_property( SOURCE "Core.cpp" APPEND PROPERTY COMPILE_DEFINITIONS
++ "DFHACK_DATA_DESTINATION=\"${DFHACK_DATA_DESTINATION}\"" )
++
+ SET(MAIN_SOURCES_WINDOWS
+ Console-windows.cpp
+ Hooks-windows.cpp
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 642da61e..23917833 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -75,6 +75,7 @@ using namespace DFHack;
+ #include <stdio.h>
+ #include <iomanip>
+ #include <stdlib.h>
++#include <string.h>
+ #include <fstream>
+ #include "tinythread.h"
+ #include "md5wrapper.h"
+@@ -383,7 +384,7 @@ static command_result runRubyScript(color_ostream &out, PluginManager *plug_mgr,
+ rbcmd += "'" + args[i] + "', ";
+ rbcmd += "]\n";
+
+- rbcmd += "catch(:script_finished) { load './hack/scripts/" + name + ".rb' }";
++ rbcmd += "catch(:script_finished) { load '" DFHACK_DATA_DESTINATION "/scripts/" + name + ".rb' }";
+
+ return plug_mgr->ruby->eval_ruby(out, rbcmd.c_str());
+ }
+@@ -501,6 +502,7 @@ void Core::getScriptPaths(std::vector<std::string> *dest)
+ }
+ dest->push_back(df_path + "/raw/scripts");
+ dest->push_back(df_path + "/hack/scripts");
++ dest->push_back(DFHACK_DATA_DESTINATION "/scripts");
+ for (auto it = script_paths[1].begin(); it != script_paths[1].end(); ++it)
+ dest->push_back(*it);
+ }
+@@ -1448,7 +1450,11 @@ void Core::fatal (std::string output)
+ std::string Core::getHackPath()
+ {
+ #ifdef LINUX_BUILD
+- return p->getPath() + "/hack/";
++ if(strncmp(DFHACK_DATA_DESTINATION, "hack", 5) == 0)
++ // This is the default value
++ return p->getPath() + "/hack/";
++ else
++ return DFHACK_DATA_DESTINATION "/";
+ #else
+ return p->getPath() + "\\hack\\";
+ #endif
+@@ -1467,9 +1473,9 @@ bool Core::Init()
+
+ // find out what we are...
+ #ifdef LINUX_BUILD
+- const char * path = "hack/symbols.xml";
++ const char * path = DFHACK_DATA_DESTINATION "/symbols.xml";
+ #else
+- const char * path = "hack\\symbols.xml";
++ const char * path = DFHACK_DATA_DESTINATION "\\symbols.xml";
+ #endif
+ vif = new DFHack::VersionInfoFactory();
+ cerr << "Identifying DF version.\n";
+--
+2.11.1
+
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 0000000..c48c6df
--- /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
+
diff --git a/games-util/dfhack/files/dfhack-0.43.05_beta1/0003-respect-DFHACK_PLUGIN_DESTINATION.patch b/games-util/dfhack/files/dfhack-0.43.05_beta1/0003-respect-DFHACK_PLUGIN_DESTINATION.patch
new file mode 100644
index 0000000..b8f67de
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.43.05_beta1/0003-respect-DFHACK_PLUGIN_DESTINATION.patch
@@ -0,0 +1,65 @@
+From 13be7ec2962986659d53cbcf1262a285c2629c11 Mon Sep 17 00:00:00 2001
+From: eroen <eroen@occam.eroen.eu>
+Date: Tue, 7 Mar 2017 22:43:57 +0100
+Subject: [PATCH 3/5] respect DFHACK_PLUGIN_DESTINATION
+
+---
+ CMakeLists.txt | 2 +-
+ library/CMakeLists.txt | 2 ++
+ library/PluginManager.cpp | 7 ++++++-
+ 3 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fc5438f8..9e8d30ce 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -158,7 +158,7 @@ SET(DFHACK_BINARY_DESTINATION .)
+ # dfhack data goes here:
+ SET(DFHACK_DATA_DESTINATION hack CACHE INTERNAL "")
+ # plugin libs go here:
+-SET(DFHACK_PLUGIN_DESTINATION hack/plugins)
++SET(DFHACK_PLUGIN_DESTINATION hack/plugins CACHE INTERNAL "")
+ # dfhack header files go here:
+ SET(DFHACK_INCLUDES_DESTINATION hack/include)
+ # dfhack lua files go here:
+diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
+index ed1650e9..a858c8f8 100644
+--- a/library/CMakeLists.txt
++++ b/library/CMakeLists.txt
+@@ -80,6 +80,8 @@ RemoteTools.cpp
+
+ set_property( SOURCE "Core.cpp" APPEND PROPERTY COMPILE_DEFINITIONS
+ "DFHACK_DATA_DESTINATION=\"${DFHACK_DATA_DESTINATION}\"" )
++set_property( SOURCE "PluginManager.cpp" APPEND PROPERTY COMPILE_DEFINITIONS
++ "DFHACK_PLUGIN_DESTINATION=\"${DFHACK_PLUGIN_DESTINATION}\"" )
+
+ SET(MAIN_SOURCES_WINDOWS
+ Console-windows.cpp
+diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp
+index a4927a75..a4cefb13 100644
+--- a/library/PluginManager.cpp
++++ b/library/PluginManager.cpp
+@@ -52,6 +52,7 @@ using namespace std;
+ using namespace tthread;
+
+ #include <assert.h>
++#include <string.h>
+
+ #define MUTEX_GUARD(lock) auto lock_##__LINE__ = make_mutex_guard(lock);
+ template <typename T>
+@@ -70,7 +71,11 @@ tthread::lock_guard<T> make_mutex_guard (T *mutex)
+
+ static string getPluginPath()
+ {
+- return Core::getInstance().getHackPath() + "plugins/";
++ if(strncmp(DFHACK_PLUGIN_DESTINATION, "hack/plugins", 13) == 0)
++ // This is the default value
++ return Core::getInstance().getHackPath() + "plugins/";
++ else
++ return DFHACK_PLUGIN_DESTINATION "/";
+ }
+
+ static string getPluginPath (std::string name)
+--
+2.11.1
+
diff --git a/games-util/dfhack/files/dfhack-0.43.05_beta1/0004-respect-DFHACK_LIBRARY_DESTINATION.patch b/games-util/dfhack/files/dfhack-0.43.05_beta1/0004-respect-DFHACK_LIBRARY_DESTINATION.patch
new file mode 100644
index 0000000..7c0b2b2
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.43.05_beta1/0004-respect-DFHACK_LIBRARY_DESTINATION.patch
@@ -0,0 +1,65 @@
+From 9f367aaa1381476871b72d08c4fb62995556337a Mon Sep 17 00:00:00 2001
+From: eroen <eroen@occam.eroen.eu>
+Date: Tue, 7 Mar 2017 22:43:57 +0100
+Subject: [PATCH 4/5] respect DFHACK_LIBRARY_DESTINATION
+
+---
+ CMakeLists.txt | 4 ++--
+ plugins/ruby/CMakeLists.txt | 2 ++
+ plugins/ruby/ruby.cpp | 6 +++---
+ 3 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9e8d30ce..40b17434 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -146,11 +146,11 @@ set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")
+ # the dfhack libraries will be installed here:
+ IF(UNIX)
+ # put the lib into DF/hack
+- SET(DFHACK_LIBRARY_DESTINATION hack)
++ SET(DFHACK_LIBRARY_DESTINATION hack CACHE INTERNAL "")
+ SET(DFHACK_EGGY_DESTINATION libs)
+ 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_LIBRARY_DESTINATION . CACHE INTERNAL "")
+ SET(DFHACK_EGGY_DESTINATION .)
+ ENDIF()
+ # external tools will be installed here:
+diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt
+index 6b5e62c6..d75e9f1e 100644
+--- a/plugins/ruby/CMakeLists.txt
++++ b/plugins/ruby/CMakeLists.txt
+@@ -69,6 +69,8 @@ INCLUDE_DIRECTORIES("${dfhack_SOURCE_DIR}/depends/tthread")
+
+ DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread)
+ ADD_DEPENDENCIES(ruby ruby-autogen-rb)
++set_property( SOURCE "ruby.cpp" APPEND PROPERTY COMPILE_DEFINITIONS
++ "DFHACK_LIBRARY_DESTINATION=\"${DFHACK_LIBRARY_DESTINATION}\"" )
+
+ IF(EXISTS ${RUBYLIB})
+ INSTALL(FILES ${RUBYLIB} DESTINATION ${DFHACK_LIBRARY_DESTINATION} RENAME ${RUBYLIB_INSTALL_NAME})
+diff --git a/plugins/ruby/ruby.cpp b/plugins/ruby/ruby.cpp
+index ed38868b..cd2dcb1f 100644
+--- a/plugins/ruby/ruby.cpp
++++ b/plugins/ruby/ruby.cpp
+@@ -320,12 +320,12 @@ static int df_loadruby(void)
+ {
+ const char *libpaths[] = {
+ #if defined(WIN32)
+- "./libruby.dll",
++ DFHACK_LIBRARY_DESTINATION "./libruby.dll",
+ #elif defined(__APPLE__)
+- "hack/libruby.dylib",
++ DFHACK_LIBRARY_DESTINATION "/libruby.dylib",
+ "/System/Library/Frameworks/Ruby.framework/Ruby",
+ #else
+- "hack/libruby.so",
++ DFHACK_LIBRARY_DESTINATION "hack/libruby.so",
+ "libruby.so",
+ #endif
+ NULL
+--
+2.11.1
+
diff --git a/games-util/dfhack/files/dfhack-0.43.05_beta1/0005-introduce-DFHACK_RUBY_DESTINATION.patch b/games-util/dfhack/files/dfhack-0.43.05_beta1/0005-introduce-DFHACK_RUBY_DESTINATION.patch
new file mode 100644
index 0000000..e703e16
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.43.05_beta1/0005-introduce-DFHACK_RUBY_DESTINATION.patch
@@ -0,0 +1,88 @@
+From 7ef8631e6dd86d4e717c1c13ef40801e907a4b24 Mon Sep 17 00:00:00 2001
+From: eroen <eroen@occam.eroen.eu>
+Date: Tue, 7 Mar 2017 22:43:57 +0100
+Subject: [PATCH 5/5] introduce DFHACK_RUBY_DESTINATION
+
+---
+ CMakeLists.txt | 2 ++
+ plugins/ruby/CMakeLists.txt | 8 ++++++--
+ plugins/ruby/ruby.cpp | 2 +-
+ plugins/ruby/{ruby.rb => ruby.rb.in} | 6 +++---
+ 4 files changed, 12 insertions(+), 6 deletions(-)
+ rename plugins/ruby/{ruby.rb => ruby.rb.in} (97%)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 40b17434..b058de03 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -163,6 +163,8 @@ SET(DFHACK_PLUGIN_DESTINATION hack/plugins CACHE INTERNAL "")
+ SET(DFHACK_INCLUDES_DESTINATION hack/include)
+ # dfhack lua files go here:
+ SET(DFHACK_LUA_DESTINATION hack/lua CACHE INTERNAL "")
++# dfhack ruby files go here:
++SET(DFHACK_RUBY_DESTINATION hack/ruby CACHE INTERNAL "")
+ # the windows .lib file goes here:
+ SET(DFHACK_DEVLIB_DESTINATION hack)
+
+diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt
+index d75e9f1e..0ad0630a 100644
+--- a/plugins/ruby/CMakeLists.txt
++++ b/plugins/ruby/CMakeLists.txt
+@@ -70,7 +70,8 @@ INCLUDE_DIRECTORIES("${dfhack_SOURCE_DIR}/depends/tthread")
+ DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread)
+ ADD_DEPENDENCIES(ruby ruby-autogen-rb)
+ set_property( SOURCE "ruby.cpp" APPEND PROPERTY COMPILE_DEFINITIONS
+- "DFHACK_LIBRARY_DESTINATION=\"${DFHACK_LIBRARY_DESTINATION}\"" )
++ "DFHACK_LIBRARY_DESTINATION=\"${DFHACK_LIBRARY_DESTINATION}\""
++ "DFHACK_RUBY_DESTINATION=\"${DFHACK_RUBY_DESTINATION}\"")
+
+ IF(EXISTS ${RUBYLIB})
+ INSTALL(FILES ${RUBYLIB} DESTINATION ${DFHACK_LIBRARY_DESTINATION} RENAME ${RUBYLIB_INSTALL_NAME})
+@@ -80,8 +81,11 @@ ELSE()
+ ENDIF()
+ ENDIF()
+
++configure_file( ruby.rb.in ruby.rb @ONLY )
+ INSTALL(DIRECTORY .
+- DESTINATION hack/ruby
++ DESTINATION ${DFHACK_RUBY_DESTINATION}
+ FILES_MATCHING PATTERN "*.rb")
++INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ruby.rb
++ DESTINATION ${DFHACK_RUBY_DESTINATION})
+
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RUBYAUTOGEN} DESTINATION hack/ruby)
+diff --git a/plugins/ruby/ruby.cpp b/plugins/ruby/ruby.cpp
+index cd2dcb1f..2b7d6ef2 100644
+--- a/plugins/ruby/ruby.cpp
++++ b/plugins/ruby/ruby.cpp
+@@ -457,7 +457,7 @@ static void df_rubythread(void *p)
+
+ // load the default ruby-level definitions in the background
+ state=0;
+- rb_eval_string_protect("require './hack/ruby/ruby'", &state);
++ rb_eval_string_protect("require '" DFHACK_RUBY_DESTINATION "/ruby'", &state);
+ if (state)
+ dump_rb_error();
+
+diff --git a/plugins/ruby/ruby.rb b/plugins/ruby/ruby.rb.in
+similarity index 97%
+rename from plugins/ruby/ruby.rb
+rename to plugins/ruby/ruby.rb.in
+index c696c23e..62be24c5 100644
+--- a/plugins/ruby/ruby.rb
++++ b/plugins/ruby/ruby.rb.in
+@@ -251,8 +251,8 @@ def df
+ end
+
+ # load autogenned file
+-require './hack/ruby/ruby-autogen-defs'
+-require(RUBY_PLATFORM =~ /mswin|mingw|cygwin/i ? './hack/ruby/ruby-autogen-win' : './hack/ruby/ruby-autogen-gcc')
++require '@DFHACK_RUBY_DESTINATION@/ruby-autogen-defs'
++require(RUBY_PLATFORM =~ /mswin|mingw|cygwin/i ? '@DFHACK_RUBY_DESTINATION@/ruby-autogen-win' : '@DFHACK_RUBY_DESTINATION@/ruby-autogen-gcc')
+
+ # load all modules
+-Dir['./hack/ruby/*.rb'].each { |m| require m.chomp('.rb') if m !~ /ruby-autogen/ }
++Dir['@DFHACK_RUBY_DESTINATION@/*.rb'].each { |m| require m.chomp('.rb') if m !~ /ruby-autogen/ }
+--
+2.11.1
+