Patch dwarf-fortress-unfuck to build in debug (pending upstream fix)

This commit is contained in:
Morgan Jones 2018-07-01 20:28:59 +00:00
parent 9a2898c6d1
commit 8d5b5fa68e
7 changed files with 25 additions and 7 deletions

View File

@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "DFHack"; owner = "DFHack";
repo = "dfhack"; repo = "dfhack";
sha256 = "16ypcl9378xxnq7ngzh93pmx2haf2i32xgxs2p1q4bvvafdxvirz"; sha256 = "1vzrpdw0pn18calayf9dwqpyg37cb7wkzkvskxjx9nak5ilxzywm";
rev = version; rev = version;
fetchSubmodules = true; fetchSubmodules = true;
}; };

View File

@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
'' else null; '' else null;
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Tool to manage dwarves in in a running game of Dwarf Fortress"; description = "Tool to manage dwarves in a running game of Dwarf Fortress";
maintainers = with maintainers; [ the-kenny abbradar bendlas ]; maintainers = with maintainers; [ the-kenny abbradar bendlas numinit ];
license = licenses.mit; license = licenses.mit;
platforms = platforms.unix; platforms = platforms.unix;
homepage = https://github.com/Dwarf-Therapist/Dwarf-Therapist; homepage = https://github.com/Dwarf-Therapist/Dwarf-Therapist;

View File

@ -91,3 +91,4 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ a1russell robbinch roconnor the-kenny abbradar numinit ]; maintainers = with maintainers; [ a1russell robbinch roconnor the-kenny abbradar numinit ];
}; };
} }

View File

@ -20,12 +20,26 @@ stdenv.mkDerivation {
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include" "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
]; ];
makeFlags = [
''CFLAGS="-fkeep-inline-functions"''
''CXXFLAGS="-fkeep-inline-functions"''
];
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ buildInputs = [
libSM SDL SDL_image SDL_ttf glew openalSoft libSM SDL SDL_image SDL_ttf glew openalSoft
ncurses gtk2 libsndfile zlib libGL ncurses gtk2 libsndfile zlib libGL
]; ];
patchPhase = ''
substituteInPlace CMakeLists.txt --replace \
'set(CMAKE_BUILD_TYPE Release)' \
'set(CMAKE_BUILD_TYPE Debug)'
'';
# Don't strip unused symbols; dfhack hooks into some of them.
dontStrip = true;
installPhase = '' installPhase = ''
install -D -m755 ../build/libgraphics.so $out/lib/libgraphics.so install -D -m755 ../build/libgraphics.so $out/lib/libgraphics.so
''; '';
@ -45,3 +59,4 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ abbradar ]; maintainers = with maintainers; [ abbradar ];
}; };
} }

View File

@ -83,3 +83,4 @@ stdenv.mkDerivation rec {
preferLocalBuild = true; preferLocalBuild = true;
} }

View File

@ -7,5 +7,6 @@ for i in dfhack.init-example dfhack-config/default hack/* stonesense/*; do
done done
cd "$DF_DIR" cd "$DF_DIR"
LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack:$LD_LIBRARY_PATH" \ export LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack:$LD_LIBRARY_PATH"
LD_PRELOAD="$env_dir/hack/libdfhack.so:$LD_PRELOAD" exec $env_dir/libs/Dwarf_Fortress "$@" export LD_PRELOAD="$env_dir/hack/libdfhack.so:$LD_PRELOAD"
exec "$env_dir/libs/Dwarf_Fortress" "$@"